Docker Desktop WSL 2 backend is not supported yet with GPUs. You will have to install Docker as you would traditionally in Linux for WSL 2 and then install NVIDIA Container Toolkit (or nvidia-docker2) for now. nvidia-container-toolkit and nvidia-docker2 in the end are just wrappers. There is a slight variation depending on which version of Docker you use (19.03 vs. 18.09), but if you chose to install nvidia-docker2, then that works across both releases of Docker. I’ll look into making that more clear in the documentation. nvidia-smi does not work because we don’t support NVML in WSL 2 yet - this is part of the Known Limitations in the user-guide. We will be adding support for it in the near future. https://forums.developer.nvidia.com/t/hiccups-setting-up-wsl2-cuda/128641
Last active
May 9, 2022 19:26
-
-
Save jgwill/5af202b551cdc4fb91a2dbef2f817a50 to your computer and use it in GitHub Desktop.
WSL Ubuntu setup 2011261142
- AI Linux Platform on Windows using GPU
Source : https://ngc.nvidia.com/catalog/containers/nvidia:pytorch
The two commands bellow makes me realize that Docker 19.03 with WSL 2 and experimental feature probably is already using the NVidia Driver when you run a container.
The ultimate test will be to run a training or inference that uses GPU and see if that works on the container.
docker run --gpus all -it --rm -v local_dir:container_dir nvcr.io/nvidia/pytorch:xx.xx-py3
#If you have Docker 19.02 or earlier, a typical command to launch the container is:
nvidia-docker run -it --rm -v local_dir:container_dir nvcr.io/nvidia/pytorch:xx.xx-py3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install Build Essential | |
sudo apt update | |
sudo apt install build-essential | |
# download NVIdia Latest CUDA | |
wget https://developer.download.nvidia.com/compute/cuda/11.1.1/local_installers/cuda_11.1.1_455.32.00_linux.run | |
sudo sh cuda_11.1.1_455.32.00_linux.run | |
##@STCAction Accept and select option then install | |
wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-wsl-ubuntu.pin
sudo mv cuda-wsl-ubuntu.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/7fa2af80.pub
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/ /"
sudo apt-get update
sudo apt-get -y install cuda
sudo apt-get update && sudo apt-get install -y nvidia-container-toolkit
sudo apt-get install nvidia-container-runtime
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment