Skip to content

Instantly share code, notes, and snippets.

@danielhavir
Last active December 13, 2020 08:45
Show Gist options
  • Save danielhavir/38d59a450ea8869d54ef770029484fc8 to your computer and use it in GitHub Desktop.
Save danielhavir/38d59a450ea8869d54ef770029484fc8 to your computer and use it in GitHub Desktop.
tput setaf 6; echo '#### Downloading and installing CUDA ####'; tput sgr0;
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
wget http://developer.download.nvidia.com/compute/cuda/11.0.2/local_installers/cuda-repo-ubuntu2004-11-0-local_11.0.2-450.51.05-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2004-11-0-local_11.0.2-450.51.05-1_amd64.deb
sudo apt-key add /var/cuda-repo-ubuntu2004-11-0-local/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda
echo 'export PATH=/usr/local/cuda-11.0/bin${PATH:+:${PATH}}' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda/lib64/' >> ~/.bashrc
source ~/.bashrc
tput setaf 2; echo '#### CUDA has been successfully installed ####'; tput sgr0;
tput setaf 2; echo '#### Rebooting in 5s ... ####'; tput sgr0;
sleep 5
sudo reboot
tput setaf 6; echo '#### Installing nVidia drivers ####'; tput sgr0;
wget http://us.download.nvidia.com/tesla/418.87/nvidia-driver-local-repo-ubuntu1804-418.87.00_1.0-1_amd64.deb
sudo dpkg -i nvidia-driver-local-repo-ubuntu1804-418.87.00_1.0-1_amd64.deb
sudo apt-key add /var/nvidia-driver-local-repo-ubuntu1804-418.87.00/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda-drivers
tput setaf 2; echo '#### New drivers installed, rebooting in 5s ... ####'; tput sgr0;
sleep 5
sudo reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment