Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save praveen-palanisamy/9690f8f92a74e038e6181df3e0dff75d to your computer and use it in GitHub Desktop.
Save praveen-palanisamy/9690f8f92a74e038e6181df3e0dff75d to your computer and use it in GitHub Desktop.
Setup latest NVIDIA drivers (410.73), cuda (10.0) , cuDNN (7.4) on Ubuntu

NOTE: This is for the latest drivers, cuda and cudnn versions available as of 11/2018. Change the version numbers & URL for future releases

0. Prerequisites
  1. Drop to a tty shell, stop the display manager (sudo service lightdm stop ). Make sure no X server is running.
  2. Uninstall & purge installed/previous nvidia drivers
    • sudo apt purge nvidia*
    • sudo apt autoremove
    • sudo dpkg -P cuda-*<TAB>
  3. Blacklist nouveau drivers if not already done
    • sudo bash -c "echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
    • sudo bash -c "echo options nouveau modeset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
    • Update kernel initramfs: sudo update-initramfs -u
  4. Install necessary packages: sudo apt-get install dkms build-essential make
  5. Reboot sudo reboot
1. Download and install the latest NVIDIA driver using the .run file
  1. wget http://us.download.nvidia.com/XFree86/Linux-x86_64/410.73/NVIDIA-Linux-x86_64-410.73.run
  2. sudo sh NVIDIA-Linux-x86_64-410.73.run --no-opengl-files
2. Download and install the latest cuda
  1. wget https://developer.nvidia.com/compute/cuda/10.0/Prod/local_installers/cuda_10.0.130_410.48_linux
  2. sudo sh cuda_10.0.130_410.48_linux --no-opengl-libs
  3. Say:
    • no when it asks for installing the driver since we have installed in the previous step
    • yes when it asks for symlinking /usr/local/cuda to /usr/local/cuda-10.0
    • Default installa location (/usr/local/cuda-10.0) should be good
  4. Add the binaries & libraries to appropriate system paths:
    • echo 'export PATH=$PATH:/usr/local/cuda/bin' >> ${HOME}/.bashrc
    • echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64' >> ${HOME}/.bashrc
3. Download and Install the latest cuDNN
  1. wget https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libcudnn7_7.4.1.5-1+cuda10.0_amd64.deb
  2. sudo dpkg -i libcudnn7_7.4.1.5-1+cuda10.0_amd64.deb
Done!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment