Which NVIDIA cuDNN release type for TensorFlow on Ubuntu 16.04

traveh picture traveh · Feb 14, 2018 · Viewed 7k times · Source

According to TensorFlow 1.5 installation instructions for Ubuntu 16.04, you need to install cuDNN 7.0 but they don't mention exactly what should be installed:

cuDNN v7.0. For details, see NVIDIA's documentation. Ensure that you create the CUDA_HOME environment variable as described in the NVIDIA documentation.

After registering and going through all the hoops to download cuDNN there is are multiple options to download and install:

enter image description here

Obviously, for Ubuntu 16.04 it's either the Linux or Ubuntu Runtime or Developer but since I saw different mentions on the web of which file exactly should be installed I was wondering which is the best one to install, or if there's actually any difference?

Answer

Robert Crovella picture Robert Crovella · Feb 14, 2018

First of all, I would encourage you to read the developer guide and the install guide. I'm going to try not to duplicate information contained there (such as specific install steps/command lines).

There are basically 2 install methods, which is true for a number of different kinds of NVIDIA software:

  • direct install (in this particular case via a .tgz compressed archive)
  • package manager install (i.e. using dpkg/apt/apt-get on Ubuntu)

There are various reasons including just personal preferences as to why you may prefer to use a tar archive (.tgz) and "unzip" everything, vs. letting apt or apt-get handle the install for you.

If you choose the .tgz method, everything you need is contained in the single .tgz archive "cuDNN v7.0.5 Library for Linux", and right off the bat we can make the observation that if you were using some Linux OS besides Ubuntu, this is the (only) way to go. This zip file contains the compiled libraries, the header files needed for development against the cuDNN API, and other things you will need to compile/link code against cuDNN.

If you choose the package manager method, this is currently only available for the listed OS's (Ubuntu 16.04 and Ubuntu 14.04 in this example). You have some independent choices:

  • Runtime Library - this is sufficient if the only thing you will be doing with cuDNN is running another binary that is already compiled to use that version of cuDNN on that version of Ubuntu. For example, if you have installed Tensorflow (TF) via a pip method, so you get precompiled binaries that are ready to go, and those precompiled binaries are set up for Ubuntu 16.04 and cuDNN 7.0.5, then you could just install the cuDNN runtime library (follow the steps in the install guide) and that would be sufficient to begin using your precompiled TF.

  • Developer Library - this will include header files and other things that are needed to compile and build codes against this particular version of the cuDNN API. So if you wanted to build or rebuild TF (for CUDA GPU usage), or you simply were working on your own API usage of cuDNN, you would want this option.

  • Code Samples and User Guide - In the .tgz install method, all of these components, including documentation and code samples, are included in the single .tgz archive. In the package manager method, even the Code samples and API user guide are broken out into a separate .deb install, so you don't have to download it if you don't need it (for example if you were just rebuilding TF against cuDNN 7.0.5, you would want the Developer Library but would not need the Code Samples or API User Guide).

UPDATE: With more recent versions of CUDNN, the .tgz file/method no longer contains the sample codes or documentation. The documentation (user guide and install guide) is here. The samples are only available in the .deb installer(s).