GPU not detected on Windows or inside Docker
Symptom
Runtime falls back to CPU; containers can't see the GPU.
Likely causes
- Outdated or missing driver
- NVIDIA Container Toolkit not installed
- Missing --gpus flag
How to fix it
- Update the NVIDIA driver and verify with nvidia-smi.
- Install the NVIDIA Container Toolkit and restart Docker.
- Run containers with --gpus all.
- Note: Apple GPUs can't be passed to Docker; run natively on macOS.
bash
docker run --rm --gpus all nvidia/cuda:12.4.1-base-ubuntu22.04 nvidia-smiStill stuck? Check the lessons or measure first with the benchmark lab.