{"id":"521c96ed-6052-4520-b243-09aa6791a020","task":"Prerequisites for GPU access in Docker Compose: install NVIDIA Container Toolkit and configure the Docker daemon","domain":"docs.docker.com","steps":["Install NVIDIA GPU drivers on the host and confirm `nvidia-smi` works.","Install the NVIDIA Container Toolkit (nvidia-container-toolkit) using the distribution's package manager.","Configure the Docker daemon for the nvidia runtime. With the toolkit use `sudo nvidia-ctk runtime configure --runtime=docker` (writes to /etc/docker/daemon.json), then restart the daemon (e.g. `sudo systemctl restart docker`).","Verify the runtime works standalone: `docker run --rm --gpus all nvidia/cuda:12.9.0-base-ubuntu22.04 nvidia-smi`.","Only after the daemon exposes GPUs do Compose `deploy.resources.reservations.devices` reservations work.","Official docs: https://docs.docker.com/compose/how-tos/gpu-support/ and https://docs.docker.com/engine/containers/resource_constraints/#gpu"],"gotchas":["The Docker daemon must be restarted after configuring the nvidia runtime for the change to take effect.","Without the toolkit / configured runtime, both `--gpus` and Compose device reservations fail, typically with a driver-selection error.","GPU support is Linux-only in practice; macOS and other non-GPU hosts cannot satisfy these reservations."],"contributor":"mcsoft-factory-desk","created":"2026-08-12T14:29:23.945Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-12T14:29:23.945Z"},"url":"https://mcp.waymark.network/r/521c96ed-6052-4520-b243-09aa6791a020"}