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.

  • 1
  • Welcome to Ask Ubuntu! A couple of heads-up -- first, please don't cross-post the same question to multiple Stack Exchange sites at once. Even if you have it posted on other non-exchange sites, it's still good practice to link to the other postings so that people don't waste their time duplicating effort on something that has already been solved in another post. – NotTheDr01ds May 11 '22 at 13:28
  • Second, please make sure the How do I ask a good question page, specifically "Search, and Research ...". What research have you done on the messages you received? What did you find? Which brings us to (third), please read and follow the warnings and messages in the output. They have instructions for what to try. In this case, I've linked to a popular post here on Ask Ubuntu regarding this particular scenario. If that doesn't help, then please edit the question with details on exactly what you've tried. Thanks! – NotTheDr01ds May 11 '22 at 13:30
  • @NotTheDr01ds Thank you for replying. I apologize for posting here and there; I though both are separate entities. The question you have mentioned may have a relevance to my problem, but I am not sure as I am new to the world of linux and wsl. I just follow the commands, but I don't think about them much. So I didn't get much of how to do it in the question you posted, or how to embbed it with my commands. And another thing, sure it mentions the apt-key(8) part, but will it solve the last problem which was "libcufile-11-6 : Depends: liburcu6 but it is not installable" when installing cuda? – Peter Ragheb May 11 '22 at 14:21
  • @NotTheDr01ds I followed the steps, and I was able to fix part of the problem which is the apt-key(8). However, it didn't fix the "libcufile-11-6 : Depends: liburcu6 but it is not installable", which is the most important part to fix to install cuda. But great thanks for the link. – Peter Ragheb May 11 '22 at 15:34
  • Good to hear at least part of the problem is solved! Go ahead and edit the question so that it reflects your latest attempts (what you've done so far, including the apt-key fix) and the new output. Thanks! – NotTheDr01ds May 11 '22 at 18:23
  • I also facing same issue, any solution ?! – X6Entrepreneur May 15 '22 at 09:47
  • @X6Entrepreneur Yes, check the solution that I have just posted – Peter Ragheb May 15 '22 at 13:11

6 Answers6

1

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.

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
  • can you clarify this by showing HOW to download.. all the mirrors when I click the link give a 404.. and instructions imply I should instead be adding these URLs to a deb list or something – Erik Aug 09 '22 at 08:56
  • Click a link until it manage to download... for example this one https://ubuntu.mirrors.tds.net/ubuntu/pool/main/libu/liburcu/liburcu6_0.12.2-1build1_amd64.deb – TecHunter Aug 11 '22 at 21:11
  • 1
    I had to write a script just to find an available mirror; but in the end it works. – Galigator Aug 16 '22 at 07:48
1

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
  • 111
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
  • 260
  • 1
  • 6
  • 24
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
  • 38,003
  • 27
  • 156
  • 232
deez
  • 1