Force version 11.6 of nvidia-cuda-toolkit in Ubuntu 18.04

I just installed cuda following instructions in nvidia site:

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
sudo mv cuda-ubuntu1804.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/11.6.0/local_installers/cuda-repo-ubuntu1804-11-6-local_11.6.0-510.39.01-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1804-11-6-local_11.6.0-510.39.01-1_amd64.deb
sudo apt-key add /var/cuda-repo-ubuntu1804-11-6-local/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda

I then installed nvidia-cuda-toolkit:

sudo apt install nvidia-cuda-toolkit

All of this went without issues, but it installed the version 9.1 of the toolkit:

$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Fri_Nov__3_21:07:56_CDT_2017
Cuda compilation tools, release 9.1, V9.1.85

I need to have version 11.1 or later of the toolkit, but it seems 9.1 is the latest in the repos:

$ sudo apt install nvidia-cuda-toolkit
Reading package lists... Done
Building dependency tree       
Reading state information... Done
nvidia-cuda-toolkit is already the newest version (9.1.85-3ubuntu1).

How can I force the installation of the latest?

This are the details of my system:

$ cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.6 LTS"
NAME="Ubuntu"
VERSION="18.04.6 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.6 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

$ uname -m
x86_64

$ uname -r
4.15.0-167-generic

Thanks in advance!

Not verified or tested for 18.04, but in general i find Ubuntu packages to be horrible.
To control and use what version YOU CHOOSE, i would actually use the .run packages manually.
This requires adding various $PATH statements to your .profile and whatnot after it is installed, but atleast you are able to install the version of choice.

I would think it also requires up-to-date drivers to actually run the samples yourself. It is not ideal, but especially for “older” Ubuntu versions this is more and more useful to do. The sad facts of a non-rolling distro is that you are basically stuck with whatever version is available at installdate. New gcc version you say? Nah… stuck with gcc-6 or whatever… even if the rest of the world is compiling happily with >11.x .

Probably not overly helpful… just an advice to look into using the .run packages manually to do what you want :)

1 Like