Installing CUDA Toolking in Ubuntu 20.04

Run following commands

Source: https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=20.04&target_type=deb_network

sudo apt-get update
sudo apt-get upgrade 
sudo apt-get -f update 
sudo apt-get -f install 
sudo apt autoremove 
sudo apt-get clean 
sudo apt-get --purge remove cuda 
sudo apt-get --purge remove "nvidia" 
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/ubuntu1804/x86_64/3bf863cc.pub 
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

Restart the machine

Run following command

nvidia-smi

Last updated