could not select device driver 🐳 Docker

could not select device driver "" with capabilities: [[gpu]]

docker run --gpus was used, but the NVIDIA Container Toolkit isn’t installed/configured, so Docker can’t expose the GPU.

Seen on: Docker

Meaning

GPU access needs the NVIDIA driver on the host plus nvidia-container-toolkit registered as a Docker runtime. After installing, Docker must be restarted.

Common causes

  • NVIDIA Container Toolkit not installed
  • Docker not restarted after installing
  • Host NVIDIA driver missing or broken
  • Rootless Docker or Docker Desktop without GPU support

⚡ Quick fix

  1. Install nvidia-container-toolkit and configure the runtime
  2. Restart Docker
  3. Check nvidia-smi on the host

Detailed fix by platform

Linux

  1. bash
    sudo apt-get install -y nvidia-container-toolkit
    sudo nvidia-ctk runtime configure --runtime=docker
    sudo systemctl restart docker
    docker run --rm --gpus all nvidia/cuda:12.4.1-base-ubuntu22.04 nvidia-smi

How to diagnose

  1. Host — nvidia-smi works?
  2. Runtime — docker info | grep -i runtime

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.