Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jmsktm/052fd9f9cf9d2051bb5f2571b4ab44bd to your computer and use it in GitHub Desktop.
Save jmsktm/052fd9f9cf9d2051bb5f2571b4ab44bd to your computer and use it in GitHub Desktop.
# Procedure to install NVIDIA driver, Cuda and cuDNN
# Run update first
sudo apt-get update
echo '\n\n#### Processor:'
cat /proc/cpuinfo | grep 'model name' | uniq | cut -d ":" -f2 | awk '{$1=$1};1'
# AMD Ryzen Threadripper 2950X 16-Core Processor
echo '\n#### Linux version:'
lsb_release -d | cut -d ":" -f2 | awk '{$1=$1};1'
# Ubuntu 16.04.5 LTS
echo '\n#### GPU name:'
nvidia-smi --query-gpu=name --format=csv | tail -n 1
# GeForce RTX 2080 Ti
# Install NVIDIA display driver
sudo add-apt-repository ppa:graphics-drivers
sudo apt-get update
sudo apt-get install nvidia-410
echo '\n#### GPU driver version:'
nvidia-smi --query-gpu=driver_version --format=csv | tail -n 1
# 418.56
------------------------------------------
# DO NOT INSTALL USING APT. IT INSTALLED A MUCH OLDER VERSION FOR ME.
# (DO NOT DO THIS) Install Cuda Toolkit
# sudo apt install nvidia-cuda-toolkit
# (IF YOU DON'T RUN APT GET, YOU WON'T NEED TO RUN THIS) Uninstall and purge data
# sudo apt-get remove --auto-remove nvidia-cuda-toolkit
# sudo apt-get purge --auto-remove nvidia-cuda-toolkit
------------------------------------------
# cuDNN install guide. Consists of installation guide for NVIDIA graphics driver
# as well as CUDA.
# https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html
# Install Cuda using .deb installer
# Driver download page: https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&target_distro=Ubuntu&target_version=1604&target_type=deblocal
sudo dpkg -i cuda-repo-ubuntu1604-10-1-local-10.1.105-418.39_1.0-1_amd64.deb
sudo apt-key add /var/cuda-repo-<version>/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda
export PATH=/usr/local/cuda-10.1/bin:/usr/local/cuda-10.1/NsightCompute-2019.1${PATH:+:${PATH}}
echo '\n#### Cuda version:'
nvcc --version | tail -n -1
# Cuda compilation tools, release 10.1, V10.1.105
# Follow the process for cuDNN (including runtime library, develop library and code samples)
# Verify installation using:
sudo apt search cudnn | grep installed
# libcudnn7/now 7.5.0.56-1+cuda10.1 amd64 [installed,local]
# libcudnn7-dev/now 7.5.0.56-1+cuda10.1 amd64 [installed,local]
# libcudnn7-doc/now 7.5.0.56-1+cuda10.1 amd64 [installed,local]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment