Tutorial: CUDA v10.2 + CUDNN v7.6.5 Installation @ Ubuntu 18.04

Installation of CUDA v10.2 and cuDNN v7.6.5 @ Ubuntu 18.04

Sik-Ho Tsang
2 min readFeb 12, 2020

In this story, I will talk about the installation of CUDA v10.2 and cuDNN v7.6.5. (Sik-Ho Tsang)

Outline

  1. CUDA v10.2 Installation
  2. cuDNN v7.6.5 Installation

1. CUDA v10.2 Installation

  • Go to https://developer.nvidia.com/cuda-downloads
  • Select the target platform based on your OS setting.
  • I chose to use runfile (local) for installation. There will be installation instructions to follow. My instruction at this moment is:
wget http://developer.download.nvidia.com/compute/cuda/10.2/Prod/local_installers/cuda_10.2.89_440.33.01_linux.run
  • After downloading, run the second script. (If you have installed an updated GPU driver, you can uncheck to not install the driver during the installation.)
sudo sh cuda_10.2.89_440.33.01_linux.run
  • Then, edit the ~/.bashrc.
sudo gedit ~/.bashrc
  • Add the following to the end of file:
export PATH=/usr/local/cuda/bin:$PATH  
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
  • Run the ~/.bashrc again.
source /.bashrc
  • Check the CUDA version to see if it is successfully installed.
nvcc -V

2. cuDNN v7.6.5 Installation

  • Go to login and download cuDNN v7.6.5 for CUDA v10.2. There are 3 deb files. That’s it.
sudo dpkg -i libcudnn7_7.6.5.32-1+cuda10.2_amd64.deb
sudo dpkg -i libcudnn7-dev_7.6.5.32-1+cuda10.2_amd64.deb
sudo dpkg -i libcudnn7-doc_7.6.5.32-1+cuda10.2_amd64.deb
  • To verify, copy the sample files to :
cp -r /usr/src/cudnn_samples_v7/ ~
  • Then change the directory:
cd ~/cudnn_samples_v7/mnistCUDNN
  • Make file:
make clean && make
  • If failed to install, it should not able to make. One of the solutions is to edit cudnn.h:
sudo gedit  /usr/include/cudnn.h
  • Change #include “driver_types.h” to #include <driver_types.h>.
  • Then try to make again:
make clean && make
  • If successful to install:
./mnistCUDNN
  • There will be classification results, and say:
Test passed!

--

--

Sik-Ho Tsang

PhD, Researcher. I share what I learn. :) Linktree: https://linktr.ee/shtsang for Twitter, LinkedIn, etc.