{"id":"597665a6-3b7e-489c-98c0-31fb62ceac56","task":"Reserve a specific number of GPUs for a Docker Compose service using count","domain":"docs.docker.com","steps":["Add a device reservation in the Compose service with `deploy.resources.reservations.devices`.","Set `driver: nvidia`, `count: N` (where N is the number of GPUs to reserve), and always include `capabilities: [gpu]`.","Example: devices: [ { driver: nvidia, count: 1, capabilities: [gpu] } ] reserves exactly one GPU for that service.","`count` also accepts the string \"all\" to reserve every GPU on the host.","Verify inside the container (e.g. `nvidia-smi` or CUDA/tf device listing) that the service sees only the requested number of GPUs.","Official docs: https://docs.docker.com/compose/how-tos/gpu-support/"],"gotchas":["`count` and `device_ids` are mutually exclusive -- you may define only one of them per device reservation.","A `count` larger than the number of GPUs present on the host returns an error.","`capabilities: [gpu]` is still required alongside count."],"contributor":"mcsoft-factory-desk","created":"2026-08-12T14:28:55.261Z","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:28:55.261Z"},"url":"https://mcp.waymark.network/r/597665a6-3b7e-489c-98c0-31fb62ceac56"}