5

I was following the chain of commands provided here: https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=WSL-Ubuntu&target_version=2.0&target_type=deb_local to install cuda (v11.6) on wsl2. However, the last three lines failed. Here is what is in the terminal:

(base) peter72@Peter72:~$ sudo apt-key add /var/cuda-repo-wsl-ubuntu-11-6-local/7fa2af80.pub
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK

(base) peter72@Peter72:~$ sudo apt-get update Get:1 file:/var/cuda-repo-wsl-ubuntu-11-5-local InRelease Ign:1 file:/var/cuda-repo-wsl-ubuntu-11-5-local InRelease Get:2 file:/var/cuda-repo-wsl-ubuntu-11-6-local InRelease Ign:2 file:/var/cuda-repo-wsl-ubuntu-11-6-local InRelease Get:3 file:/var/cuda-repo-wsl-ubuntu-11-5-local Release Err:3 file:/var/cuda-repo-wsl-ubuntu-11-5-local Release File not found - /var/cuda-repo-wsl-ubuntu-11-5-local/Release (2: No such file or directory) Get:4 file:/var/cuda-repo-wsl-ubuntu-11-6-local Release [564 B] Get:4 file:/var/cuda-repo-wsl-ubuntu-11-6-local Release [564 B] Get:6 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB] Hit:7 https://nvidia.github.io/libnvidia-container/stable/ubuntu18.04/amd64 InRelease Hit:8 https://nvidia.github.io/nvidia-container-runtime/stable/ubuntu18.04/amd64 InRelease Hit:9 http://archive.ubuntu.com/ubuntu jammy InRelease Hit:10 https://nvidia.github.io/nvidia-docker/ubuntu18.04/amd64 InRelease Hit:11 http://archive.ubuntu.com/ubuntu jammy-updates InRelease Hit:12 http://archive.ubuntu.com/ubuntu jammy-backports InRelease Reading package lists... Done E: The repository 'file:/var/cuda-repo-wsl-ubuntu-11-5-local Release' no longer has a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. W: file:/var/cuda-repo-wsl-ubuntu-11-6-local/Release.gpg: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details. W: https://nvidia.github.io/libnvidia-container/stable/ubuntu18.04/amd64/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details. W: https://nvidia.github.io/nvidia-container-runtime/stable/ubuntu18.04/amd64/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details. W: https://nvidia.github.io/nvidia-docker/ubuntu18.04/amd64/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.

(base) peter72@Peter72:~$ sudo apt-get -y install cuda Reading package lists... Done Building dependency tree... Done Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:

The following packages have unmet dependencies: libcufile-11-6 : Depends: liburcu6 but it is not installable E: Unable to correct problems, you have held broken packages.

In the attempt to fix them, I downloaded another cuda version (v11.5) in hopes that it will work, but it didn't. I also removed the cuda repo folders manually, which led to chaos that I can't fix. I tried purging cuda and nvidia in the attempt to start fresh, but it didn't deliver.

6 Answers6

2

ppa:cloudhan/liburcu6 provides a forward-port of liburcu6 for Ubuntu 22.04.

sudo add-apt-repository ppa:cloudhan/liburcu6
sudo apt update
sudo apt install liburcu6

Then, you can proceed with the CUDA 11.6 installation.

iutlu
  • 121
1

For Ubuntu 22 you will need to manually install the lib. Download it from any one of these mirror: https://packages.ubuntu.com/impish/amd64/liburcu6/download

Then sudo apt install ./liburcu6*.deb

Should be OK then.

TecHunter
  • 111
  • 3
0

N.B: The solution is in the last line. Don't start opening links

The apt-key(8) problem can be fixed here: What commands (exactly) should replace the deprecated apt-key?

However, that won't fix the libcufile-11-6 : Depends: liburcu6 but it is not installable. That is because if you tried to install libcufile-11-6 using the instructions from this source here: https://ubuntu.pkgs.org/20.04/ubuntu-main-amd64/liburcu6_0.11.1-2_amd64.deb.html, you will get in your terminal when using sudo apt-get install liburcu6:

Package liburcu6 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'liburcu6' has no installation candidate

That happened because liburcu6 is not supported or doesn't exist for some reason in Ubuntu version 22.04. Besides that, if you look closely at the beginning of the page of the same link, you will find that the installation commands are for Ubuntu version 20.04.

So, finally, the way to dodge all of that is to use Ubuntu 20.04 instead of 22.04. This way, you won't have either problems.

0

Replace the 11-6 to your own cuda version.

sudo cp /var/cuda-repo-wsl-ubuntu-11-6-local/*.gpg /usr/share/keyrings/

and then execute

sudo apt-get update
sudo apt-get -y install cuda
0

My advice.. is to just install CUDA 11.7 and ignore prior versions if you're on Ubuntu 22.04.. when I tried downloading CUDA 11.6.x from NVIDIA it was clear their instructions don't even give 22.04 as an option.. ONLY when I stepped up to 11.7 CUDA ... and in my quick testing.. Pytorch didn't care even though it officially only supports 11.6 as of todays date

Erik
  • 288
0

Use the run file version of 11.6.2 and it should work:

wget https://developer.download.nvidia.com/compute/cuda/11.6.2/local_installers/cuda_11.6.2_510.47.03_linux.run
sudo sh cuda_11.6.2_510.47.03_linux.run

Slightly longer download but it works to install it.

andrew.46
  • 39,359
deez
  • 1