Linux Host: Install the NVIDIA driver and Docker ≥ 23, add the user to the docker group (then log in again), install the NVIDIA Container Toolkit, and configure the Docker runtime.
sudo usermod -aG docker "$USER" sudo nvidia-ctk runtime configure --runtime=docker sudo systemctl restart docker
On Windows, the container runs in a Linux VM under WSL 2 (Windows 10 21H2 or later). Important: The NVIDIA driver is installed only on Windows — never within WSL; the GPU is automatically passed through.
wsl --install -d Ubuntu-22.04 wsl --update
Enable the WSL 2 engine and WSL integration for the distribution in Docker Desktop; a container toolkit is then not necessary. Without Docker Desktop, install Docker Engine in the distribution, add the user to the docker group, enable systemd in /etc/wsl.conf; if the service does not start, restart WSL and install the NVIDIA Container Toolkit.
Joint test for all three paths—this command must detect the graphics card . If it fails, any further configuration is pointless:
docker run --rm --gpus all nvidia/cuda:12.8.0-base-ubuntu22.04 nvidia-smi
