Manually update the config because docker desktop doesnāt use the config at /etc/docker instead it uses the one at /home/username/.docker which the steps at NVidia - Configuring Docker modify.
Run docker run --runtime=nvidia --gpus all nvcr.io/nvidia/k8s/cuda-sample:nbody to confirm functionality.
(these steps are to the best of my memoryā¦)
Only Docker Desktop for Windows supports GPUs when the WSL2 backend is used, since WSL2 supports GPUs. Otherwise you have a virtual machine without GPUs. So Docker Desktop for Linux does not support it, but on Linux, you can install Docker CE which does.
By the way as far as I know, you donāt need the runtime option when you use the gpus option since Docker CE 19.03. The nvidia container runtime project is archived
Thanks for the feedback @rimelek . Iāve got it working re your advice that docker desktop on linux doesnāt work for GPU related workloads, and instead to use Docker CE (a.k.a Docker Engine). Itās a real shame because I kinda loved that UI. Iām now using VSCode and the Docker plugin to manage my containers. I had to add my user to the docker group, but itās working and Iām happy.
To make a note of what I did to get this working, Iāll leave this for posterity:
Uninstalled Docker Desktop completely before installing Docker CE
sudo apt remove docker-desktop
sudo apt purge docker-desktop
sudo rm -rf ~/.docker #plus any other places there's docker config
Removed any leftover packages that werenāt used elsewhere, just in case
Manually removed Dockerās network settings by removing the relevant configurations, basically any daemon.json files that were hanging around my system.
sudo docker run --rm --runtime=nvidia --gpus all ubuntu nvidia-smi
ā¦and finally got the sexy output:
Fri Oct 25 22:53:04 2024
------------------------------------------------------------------------------------------
| NVIDIA-SMI 550.107.02 Driver Version: 550.107.02 CUDA Version: 12.4 |
|-----------------------------------------------------------------------------------------
| Extra stuff went here
------------------------------------------------------------------------------------------
Iāll consider this a moderate success. Iām going to miss that UI xD. Thanks for the guidance @rimelek !