Troubleshooting

Could not select device driver: Docker GPU fix

Docker prints could not select device driver "" with capabilities: [[gpu]] when it has no GPU device driver to hand the --gpus request to. Usually the NVIDIA Container Toolkit is missing, or installed but not registered with Docker. Confirm nvidia-smi works on the host, install the toolkit, run sudo nvidia-ctk runtime configure --runtime=docker, restart Docker, then test with a CUDA container.

A shipping container on a dock reaching for a GPU card with a missing adapter plug between them
The error means Docker has no GPU driver registered to connect a container to the card. AI-generated illustration.

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.

Causes, ranked by how often they occur
RankCauseHow to confirm
1NVIDIA Container Toolkit not installeddpkg -l or rpm -qa shows no nvidia-container-toolkit
2Toolkit installed, Docker not configured or not restarteddocker info lists no nvidia runtime
3No working host GPU drivernvidia-smi fails on the host
4Rootless Docker using the wrong config fileDocker runs as your user, not root
5Docker Desktop on Windows without WSL 2 GPU supportWSL 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

A small bridge being bolted between a server host and a row of containers, with a GPU card beneath
Installing and registering the NVIDIA Container Toolkit bridges Docker to the host GPU driver. AI-generated illustration.

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 and fix table
SymptomCheckFix
Error on every --gpus runPackage query for nvidia-container-toolkitInstall the toolkit from NVIDIA’s repository
Toolkit installed, error persistsdocker info | grep -i runtimenvidia-ctk runtime configure --runtime=docker, restart Docker
nvidia-smi fails on the hostnvidia-smi; dmesg for driver messagesInstall or repair the NVIDIA driver, reboot
Works with sudo, fails as your userIs the daemon rootless?Configure $HOME/.config/docker/daemon.json, restart user daemon
Only Compose failsdevices entry has capabilities: [gpu]?Add driver: nvidia, count or device_ids, capabilities
Windows Docker Desktop failsWSL 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

NeuraMesh prices per GPU-hour in USD, excluding taxes, as of 2026-11-27. Live prices are on the rental pages.
GPUMemoryData centerValue
RTX 409024 GB$0.46$0.40
L40S48 GB$1.26$0.54
A10080 GB$1.56$0.98
H10080 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

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.

Read the editorial policy.

Need this GPU? Rent it from NeuraMesh: choose a GPU and plan, get a confirmed quotation, and pay only when you approve. See pricing.