Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to install CUDA on Ubuntu 16.04

Tags:

cuda

nvidia

I have been installing various versions of CUDA this way for years:

sudo apt-get update
sudo apt-get purge cuda --yes

# eg for 9.0:
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_9.0.176-1_amd64.deb

sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub

sudo dpkg -i cuda-repo-ubuntu1604_9.0.176-1_amd64.deb

sudo apt-get install cuda=9.0.176-1 --yes

This has always worked well, I had that in a script that would automatically setup my CI machines. But today I noticed that things aren't working anymore:

sudo apt-get install cuda=9.0.176-1 --yes
E: Unable to locate package cuda

Apparently, the GPG key expired: https://github.com/NVIDIA/nvidia-docker/issues/1081#issuecomment-533717708

To solve this, you now need to do:

curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey |  sudo apt-key add -

But still, same error! I tried with CUDA version 10.0 as well but it fails in the same way.

like image 619
MasterScrat Avatar asked Mar 03 '23 04:03

MasterScrat


1 Answers

This works:

sudo apt-key adv --fetch-keys  http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
sudo bash -c 'echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/cuda.list'
sudo apt update
sudo apt install cuda-10-0 --yes

The same approach works for CUDA 9.0. Not sure why my previous approach doesn't work anymore.

like image 129
MasterScrat Avatar answered Apr 06 '23 23:04

MasterScrat