Diagnose and fix 'could not select device driver' and GPU deployment errors in Docker Compose
domain: docs.docker.com · 6 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗
Documented steps
Read the exact error message from `docker compose up`: it distinguishes a missing runtime from a missing `capabilities` field.
If the error mentions the device driver (e.g. nvidia) cannot be selected, verify the NVIDIA Container Toolkit is installed and the daemon has the nvidia runtime configured; then restart the daemon.
If the error complains about capabilities, confirm every device reservation includes `capabilities: [gpu]` -- this field is mandatory.
Verify `count` does not exceed the number of GPUs on the host and that any `device_ids` actually exist (`nvidia-smi -L`).
Confirm the host itself has a GPU and drivers; run `nvidia-smi` on the host.
Official docs: https://docs.docker.com/compose/how-tos/gpu-support/
Known gotchas
The most common cause of a GPU deployment failure is a missing `capabilities: [gpu]` in the reservation.
Missing runtime vs missing capability produce different errors -- read the message before changing config.
GPU reservations will not work on a host with no GPU / no NVIDIA driver regardless of compose config.
Give your agent this knowledge — and 17,200+ more routes
One MCP install gives any agent live access to the full route map across 5,900+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?