How to Install NVIDIA cuDNN on Ubuntu 16.04/18.04 Linux

This post will guide you how to install cuDNN on your Ubuntu Linux server. How do I install the latest version of cuDNN and check for correct operation of NIDIA cuDNN on Ubuntu 16.04 or 18.04 Linux.

What is cuDNN?

The NVIDIA CUDA Deep Neural Network library (cuDNN) is a GPU-accelerated library of primitives for deep neural networks. cuDNN provides highly tuned implementations for standard routines such as forward and backward convolution, pooling, normalization, and activation layers. cuDNN is part of the NVIDIA Deep Learning SDK. It can be used for high-performance GPU acceleration. cuDNN accelerates widely used deep learning frameworks, including Caffe, Caffe2, TensorFlow, Theano, Torch, PyTorch, MXNet, and Microsoft Cognitive Toolkit. cuDNN is freely available to members of the NVIDIA Developer Program.

ubuntu install cudnn4


Before installing cuDNN tool, you need to make sure that your system match the following requirements:

  • A GPU of compute capability 3.0 or higher
  • One of the following supported CUDA versions and NVIDIA graphics driver:

NVIDIA graphics driver R410 or newer for CUDA 10.0
NVIDIA graphics driver R396 or newer for CUDA 9.2
NVIDIA graphics driver R384 or newer for CUDA 9
NVIDIA graphics driver R375 or newer for CUDA 8

So you also need to make sure that the latest NVIDIA graphics driver and CUDA Toolkit are installed on your system.

Installing cuDNN

Step1: Installing the Latest NVIDIA Graphics Drivers

You need to install the latest NVIDIA graphics drivers on your system based on your actual NVIDIA hardware before installing cuDNN, just do the following steps:

#1 you can go to the official download web page of NVIDIA to download the latest NVIDIA graphics driver.

#2 select Product Type and Operating System from the drop down menu list. click SEARCH button.

ubuntu install cudnn1

#3 clicking on Download button to download the driver to your local disk. or you can use the wget command to get the driver file. type:

ubuntu install cudnn2

$ wget

#4 installing the downloaded NVIDIA graphics driver with the following command:

$ sudo ./

#5 after installed drivers, you need to reatart your system to ensure the NVIDIA graphics driver takes effect.

Step2: Installing CUDA Toolkit

Before installing cuDNN, you also need to install CUDA Toolkit on your system, and we have explained that how to install CUDA toolkit on Ubuntu system in the previous post.

Step3: Downloading cuDNN

To download cuDNN to your local disk, you need to do the following steps:

#1 you need to register for the NVIDIA Developer Program firstly.

ubuntu install cudnn3

#2 go the NVIDIA cuDNN home page, click Download button, and then you need to complete the short survey and click Submit.

#3 you should see a list of available download versions of cuDNN displays, you need to choose one based on CUDA version installed on your system. For example, if you have installed CUDA 10.1 on your Ubuntu system, you should choose the first one.

ubuntu install cudnn5

#4 You can download a tar file or deb files with the following commands:

$ wget


$ wget

$ wget


Step 4: Installing cuDNN from a Tar File

If you are using a Linux system, such as: CentOS or Ubuntu Linux, you can try to install cuDNN tool from a tar file, just do the following steps:

#1 extract all files from cuDNN tar package with the following steps:

$ tar -zxvf cudnn-10.1-linux-x64-v7.5.0.56.tgz

#2 you need to copy the following files into the CUDA Toolkit directory with the following commands:

$ sudo cp cuda/include/cudnn.h /usr/local/cuda/include
$ sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64

#3 change the file permissions for those files, type:

$ sudo chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*

Step 5: Installing cuDNN from a Deb File

If you are using Debian or Ubuntu Linux, you can use dpkg command to install those above deb files, type:

$ sudo dpkg -i libcudnn7_7.0.3.11-1+cuda9.0_amd64.deb

$ sudo dpkg -i libcudnn7-devel_7.0.3.11-1+cuda9.0_amd64.deb

$ sudo dpkg -i libcudnn7-doc_7.0.3.11-1+cuda9.0_amd64.deb

Note: the first command will install the Runtime library, the second command will install the developer library, and the third command will install the code samples and the cuDNN Libray User Guide.


You should know that how to install cuDNN tool on Ubuntu 16.04 or 18.04 from this guide, and you also know how to install cuDNN with the different methods on Ubuntu Linux server(tar file or deb file). If you want to see more information about cuDNN, you can go the official web site of cuDNN directly.

You might also like:


back to top