Skip to content

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

  1. Update the NVIDIA driver and verify with nvidia-smi.
  2. Install the NVIDIA Container Toolkit and restart Docker.
  3. Run containers with --gpus all.
  4. 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-smi

Still stuck? Check the lessons or measure first with the benchmark lab.