In this blog post cuda is installed on Ubuntu 20.4 just by running:
sudo apt update && sudo apt install nvidia-cuda-toolkitHowever, Nvidia's official instructions are different and contain more steps. Essential parts of the steps:
Install repository meta-data:
sudo dpkg -i cuda-repo-<distro>_<version>_<architecture>.deb
Install the CUDA public GPG key:
When installing using the local repo:
sudo apt-key add /var/cuda-repo-<distro>-<version>/7fa2af80.pub
When installing using network repo on Ubuntu 20.04/18.04:
sudo apt-key adv --fetch-keys
When installing using network repo on Ubuntu 16.04:
sudo apt-key adv --fetch-keys
Pin file to prioritize CUDA repository:
wget
sudo mv cuda-<distro>.pin /etc/apt/preferences.d/cuda-repository-pin-600
Update the Apt repository cache:
sudo apt-get update
Install CUDA:
Note: These two commands must be executed separately.
sudo apt-get install cudaWhat is the essential difference between the two installation methods?
1 Answer
The main difference boils down to installing the tested version in the official Ubuntu repositories (preferable) versus installing a version from a 3rd party repository (Nvidia's).
The former is preferable due to the fact that it has been packaged specifically for and tested in your Ubuntu release.
The latter is in most situations a newer version but newer doesn't automatically makes it "better".