user1779646
user1779646

Reputation: 819

How to install cuda-toolkit-10-0 on ubuntu 18.1?

I've installed Nvidia 415, and Result of command :- cat /proc/driver/nvidia/version.

NVRM version: NVIDIA UNIX x86_64 Kernel Module 415.13 Wed Oct 31 19:07:36 CDT 2018 GCC version: gcc version 8.2.0 (Ubuntu 8.2.0-7ubuntu1)

Result of command sudo apt-cache policy cuda-toolkit-10-0.

cuda-toolkit-10-0:

Installed: (none)

Candidate: (none)

Version table:

 10.0.130-1 -1

    100 /var/lib/dpkg/status

But when I try to install using sudo apt-get install cuda-toolkit-10-0, i get error

Reading package lists... Done Building dependency tree
Reading state information... Done Package cuda-toolkit-10-0 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 'cuda-toolkit-10-0' has no installation candidate

Upvotes: 2

Views: 2458

Answers (1)

Adam Krawczyk
Adam Krawczyk

Reputation: 193

To install any version of cuda and nvcc follow steps on nvidia docs

For ubuntu 20.04 and cuda 11.6:

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
sudo apt-get update
sudo apt-get -y install cuda

For ubuntu 18.04 and cuda 10.0:

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
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/ /"
sudo apt-get update
sudo apt-get -y install cuda=10.0

IMPORTANT:

To have default behavior (as with installation with 1 sudo apt install nvidia-cuda-toolkit) create symlink

sudo ln -s /usr/local/<your-cuda-version>/bin/nvcc /usr/bin/nvcc
sudo ln -s /usr/local/cuda-11.6/bin/nvcc /usr/bin/nvcc 
or 
sudo ln -s /usr/local/cuda-10.0/bin/nvcc /usr/bin/nvcc

Upvotes: 1

Related Questions