Reputation: 41
I am very much struggling to get NVIDIA's CUDA 11.2 and cuDNN 8.1 for TensorFlow 2 on my WSL2 machine.
Can anybody give me the commands to get CUDA 11.2 and cuDNN 8.1 on my WSL2 machine so that I can finally get back to coding in TensorFlow 2? I am thinking about something like this :
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
wget https://developer.download.nvidia.com/compute/cuda/11.8.0/local_installers/cuda-repo-wsl-ubuntu-11-8-local_11.8.0-1_amd64.deb
sudo dpkg -i cuda-repo-wsl-ubuntu-11-8-local_11.8.0-1_amd64.deb
sudo cp /var/cuda-repo-wsl-ubuntu-11-8-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda
My specs :
Upvotes: 3
Views: 9511
Reputation: 11
You could check out Nvidia's download installer for WSL-Ubuntu from its download archives.
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
wget https://developer.download.nvidia.com/compute/cuda/11.2.0/local_installers/cuda-repo-wsl-ubuntu-11-2-local_11.2.0-1_amd64.deb
sudo dpkg -i cuda-repo-wsl-ubuntu-11-2-local_11.2.0-1_amd64.deb
sudo apt-key add /var/cuda-repo-wsl-ubuntu-11-2-local/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda
Upvotes: 1
Reputation: 381
Here is how I did it:
Follow the instructions from NVIDIA's CUDA Toolkit Downloads page to setup their package repository with the versions specifically for WSL2
> wget https://developer.download.nvidia.com/compute/cuda/repos/wsl-ubuntu/x86_64/cuda-keyring_1.1-1_all.deb
> sudo dpkg -i cuda-keyring_1.1-1_all.deb
> sudo apt-get update
And now the fun part, since the repo contains all previous CUDA versions too:
> sudo apt install cuda-toolkit-11-7
I hope this helps some fellow traveler ^^
Upvotes: -1
Reputation: 766
I just read your question please follow.
That is because they question then screenshot added see TF2.11 and WSL2.0 related to my answers
Upvotes: -4