The exact error and what it means
The full message reads: docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]]. Docker Compose and SDKs wrap the same text, sometimes inside an HTTP 500 server error.
Read it literally. You asked for a device with the gpu capability, through --gpus or a Compose device reservation. The Docker daemon looked for a registered device driver that could satisfy that request, found none, and gave up. The empty quotes are the driver name it was asked for: none was specified, so it tried to pick one and failed.
The error comes from Docker, not from your image or the NVIDIA driver. A container never starts, so nothing inside the image can fix it. The repair is always on the host: the GPU driver, the NVIDIA Container Toolkit, and Docker’s configuration.
References: Alibaba Cloud: could not select device driver with capabilities [[gpu]] · Docker docs: GPU access
Causes, ranked by how often they occur
Check the host in this order. Most cases end at the first or second item.
First, the NVIDIA Container Toolkit is not installed. Alibaba Cloud’s guide for this exact message names it as the cause: without the toolkit, Docker cannot select a GPU device. Second, the toolkit is installed but Docker was never configured to use it, or the daemon was not restarted afterwards. NVIDIA’s install guide makes both steps explicit.
Third, the host has no working NVIDIA driver, so there is nothing for the toolkit to expose. Fourth, Docker runs in rootless mode, which reads a per-user daemon.json rather than the system file. Fifth, on Windows, Docker Desktop is not using the WSL 2 backend, or the NVIDIA driver does not support WSL 2 GPU paravirtualization.
| Rank | Cause | How to confirm |
|---|---|---|
| 1 | NVIDIA Container Toolkit not installed | dpkg -l or rpm -qa shows no nvidia-container-toolkit |
| 2 | Toolkit installed, Docker not configured or not restarted | docker info lists no nvidia runtime |
| 3 | No working host GPU driver | nvidia-smi fails on the host |
| 4 | Rootless Docker using the wrong config file | Docker runs as your user, not root |
| 5 | Docker Desktop on Windows without WSL 2 GPU support | WSL 2 backend off, or driver lacks WSL support |
References: Alibaba Cloud: could not select device driver with capabilities [[gpu]] · NVIDIA Container Toolkit installation guide · Docker docs: GPU support in Docker Desktop for Windows
Diagnose could not select device driver in four commands
Run these on the host, not in a container. First, nvidia-smi. If it fails, fix the driver before anything else; Docker’s GPU documentation lists a working driver as the first prerequisite, and nvidia-smi -L lists each GPU’s index and UUID.
Second, check the toolkit package: dpkg -l | grep nvidia-container-toolkit on Ubuntu or Debian, or rpm -qa | grep nvidia-container-toolkit on RHEL-family systems. Third, docker info | grep -i runtime. After configuration you should see nvidia listed among the runtimes.
Fourth, run NVIDIA’s sample workload: sudo docker run --rm --runtime=nvidia --gpus all ubuntu nvidia-smi. If it prints the GPU table, the stack works and any remaining failure is in your run command or Compose file.
References: Docker docs: GPU access · Alibaba Cloud: could not select device driver with capabilities [[gpu]] · NVIDIA Container Toolkit: running a sample workload
Fix: install and register the NVIDIA Container Toolkit
On Ubuntu or Debian, add NVIDIA’s repository and signing key as the install guide shows, run apt-get update, then install nvidia-container-toolkit. The guide currently pins version 1.20.2-1 across four packages: nvidia-container-toolkit, nvidia-container-toolkit-base, libnvidia-container-tools and libnvidia-container1. On RHEL, Fedora, Amazon Linux and similar systems the same packages install with dnf.
Installing the packages is not enough. Register the runtime with sudo nvidia-ctk runtime configure --runtime=docker, which modifies /etc/docker/daemon.json so Docker can use the NVIDIA Container Runtime. Then restart the daemon with sudo systemctl restart docker. Skipping the restart is a common reason the error survives a correct install.
For rootless Docker, the guide uses a different path: nvidia-ctk runtime configure --runtime=docker --config=$HOME/.config/docker/daemon.json, then systemctl --user restart docker, then sudo nvidia-ctk config --set nvidia-container-cli.no-cgroups --in-place. A fuller walkthrough of the setup is in Docker with NVIDIA GPUs.
References: NVIDIA Container Toolkit installation guide

Symptom, check and fix table
Match what you see to a row, run the check, and apply the fix. Retest with the sample workload after each change.
| Symptom | Check | Fix |
|---|---|---|
| Error on every --gpus run | Package query for nvidia-container-toolkit | Install the toolkit from NVIDIA’s repository |
| Toolkit installed, error persists | docker info | grep -i runtime | nvidia-ctk runtime configure --runtime=docker, restart Docker |
| nvidia-smi fails on the host | nvidia-smi; dmesg for driver messages | Install or repair the NVIDIA driver, reboot |
| Works with sudo, fails as your user | Is the daemon rootless? | Configure $HOME/.config/docker/daemon.json, restart user daemon |
| Only Compose fails | devices entry has capabilities: [gpu]? | Add driver: nvidia, count or device_ids, capabilities |
| Windows Docker Desktop fails | WSL 2 backend enabled? Driver supports WSL 2? | Turn on WSL 2 backend, update the NVIDIA driver |
References: NVIDIA Container Toolkit installation guide · Docker docs: GPU access · Docker docs: GPU support in Compose · Docker docs: GPU support in Docker Desktop for Windows
Docker Compose, Desktop and CDI variants
Compose requests GPUs under deploy.resources.reservations.devices. Docker’s documentation says you must set the capabilities field, for example capabilities: [gpu], or deployment returns an error. count and device_ids are mutually exclusive, and omitting count reserves all GPUs. The toolkit fixes above still apply, because Compose uses the same daemon.
Docker Desktop on Windows needs an NVIDIA GPU, an up to date Windows 10 or 11, NVIDIA drivers that support WSL 2 GPU paravirtualization, and the WSL 2 backend switched on. Docker’s test command is docker run --rm -it --gpus=all nvcr.io/nvidia/k8s/cuda-sample:nbody nbody -gpu -benchmark.
Some hosts use the Container Device Interface instead. NVIDIA generates the CDI spec with sudo nvidia-ctk cdi generate --output=/var/run/cdi/nvidia.yaml, and nvidia-ctk cdi list shows the devices it defines. From toolkit 1.18.0, a service regenerates the spec when drivers are installed or upgraded, but MIG reconfiguration still needs a manual regenerate.
References: Docker docs: GPU support in Compose · Docker docs: GPU support in Docker Desktop for Windows · NVIDIA Container Toolkit: CDI support
Prevention and what to ask a GPU provider
Bake the toolkit install and the nvidia-ctk configure step into your machine image or setup script, and end the script with the sample workload so a broken host fails loudly. Pin the toolkit version you tested. After a driver upgrade, rerun nvidia-smi on the host and the sample container before you launch real jobs.
On a rented GPU, ask before you start. Is the NVIDIA driver preinstalled, and which version? Is the NVIDIA Container Toolkit installed and registered with Docker? Do you get root, or will Docker run rootless? Is the GPU passed through to a VM or exposed inside a container you cannot configure? The answers decide whether you can fix this error yourself. Portable GPU workloads covers keeping images independent of the host, and evaluate a GPU operator lists further questions.
References: NVIDIA Container Toolkit installation guide
Checklist and next step
Run nvidia-smi on the host. Confirm the nvidia-container-toolkit package. Run sudo nvidia-ctk runtime configure --runtime=docker. Restart Docker. Check docker info for the nvidia runtime. Run the sample workload. Add capabilities: [gpu] in Compose. If the container still cannot see a GPU but starts, move on to torch.cuda.is_available() False.
If you would rather start from a host where this already works, NeuraMesh rents GPUs by the hour: pick a GPU, plan, count, hours and region on rent GPUs, confirm the software you need, and you receive a confirmed quotation, typically within one business day, before anything is charged.
NeuraMesh prices for these GPUs
| GPU | Memory | Data center | Value |
|---|---|---|---|
| RTX 4090 | 24 GB | $0.46 | $0.40 |
| L40S | 48 GB | $1.26 | $0.54 |
| A100 | 80 GB | $1.56 | $0.98 |
| H100 | 80 GB | $2.88 | $2.00 |
Every order is confirmed in a quotation before you pay. See all GPU prices.
Questions readers ask
How do I fix could not select device driver with capabilities gpu?
Install the NVIDIA Container Toolkit on the host, run sudo nvidia-ctk runtime configure --runtime=docker, and restart Docker with sudo systemctl restart docker. Then test with sudo docker run --rm --runtime=nvidia --gpus all ubuntu nvidia-smi.
Why does the error persist after installing the toolkit?
Usually Docker was not configured or not restarted. The nvidia-ctk runtime configure step edits /etc/docker/daemon.json, and the daemon only reads it on restart. Rootless Docker needs the per-user config file instead.
Do I need the CUDA toolkit on the host to run GPU containers?
No. Docker’s prerequisites are the NVIDIA driver and the NVIDIA Container Toolkit. CUDA libraries ship inside the container image, and official CUDA images set the required environment variables themselves.
Why does docker compose say could not select device driver?
Either the host toolkit is missing or the Compose file lacks a valid device reservation. Docker requires the capabilities field, for example capabilities: [gpu], under deploy.resources.reservations.devices.
Can I fix this error inside the container image?
No. The daemon rejects the request before the container starts, so the fix is on the host: the driver, the toolkit and Docker’s runtime configuration. On a rented server, ask the provider if you lack root access.
Sources and editorial notes
- Alibaba Cloud: could not select device driver with capabilities [[gpu]]
- Docker docs: GPU access
- NVIDIA Container Toolkit installation guide
- Docker docs: GPU support in Docker Desktop for Windows
- NVIDIA Container Toolkit: running a sample workload
- Docker docs: GPU support in Compose
- NVIDIA Container Toolkit: CDI support
Primary documentation reviewed November 24, 2026. Provider descriptions reflect published documentation. Recommendations are our analysis; worked figures are illustrative unless explicitly stated otherwise. No independent provider benchmark or uptime ranking is claimed.
Need this GPU? Rent it from NeuraMesh: choose a GPU and plan, get a confirmed quotation, and pay only when you approve. See pricing.


