Skip to content

Instantly share code, notes, and snippets.

@nathzi1505
Last active November 26, 2021 21:42
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nathzi1505/18f44ec51187342bbcaaed98ae1c9642 to your computer and use it in GitHub Desktop.
Save nathzi1505/18f44ec51187342bbcaaed98ae1c9642 to your computer and use it in GitHub Desktop.
Setup CUDA in Ubuntu 20.04 LTS
# Nvidia Driver installation
sudo apt install nvidia-driver-440
sudo reboot
# CUDA installation
sudo apt update
sudo apt install nvidia-cuda-toolkit # Focal: version 10.1
nvcc --version
# Download cuDNN from Nvidia: https://developer.nvidia.com/rdp/cudnn-download for version 10.1
cd ~/Downloads
tar -xzvf cudnn-10.1-linux-x64-v7.6.5.32.tgz
sudo cp cuda/include/cudnn.h /usr/local/cuda/include
sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2
# Add the following line to ~/.bashrc
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment