Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

nvidia - How can I install CuDNN on Ubuntu 16... https://askubuntu.com/questions/767269/how-ca...

Ubuntu Community Ask! Developer Design Hardware Insights Juju Shop More


sign up log in tour help

_
Ask Ubuntu is a question and answer Here's how it works:
site for Ubuntu users and developers.
Join them; it only takes a minute:

Sign up
Anybody can ask Anybody can The best answers are voted
a question answer up and rise to the top

How can I install CuDNN on Ubuntu 16.04?

For TensorFlow I would like to install cuda and CuDNN. How do I do that on Ubuntu
16.04?

nvidia 16.04 cuda

edited Nov 18 '16 at 5:45 asked May 4 '16 at 6:12


Seanny123 Martin Thoma
159 2 13 3,248 9 30 57

Warning: if you're trying to run tensorow and need cudnn, make sure to install 5.1 and not 6.0 for now.
wordsforthewise Apr 18 at 5:50

4 Answers

Step 0: Install cuda from the standard repositories. (See How can I install CUDA on Ubuntu
16.04?)

Step 1: Register an nvidia developer account and download cudnn here (about 80 MB)

Step 2: Check where your cuda installation is. For the installation from the repository it is
/usr/lib/... and /usr/include . Otherwise, it will be /urs/local/cuda/ . You can check it
with which nvcc or ldconfig -p | grep cuda

Step 3: Copy the les:

$ cd folder/extracted/contents
$ sudo cp -P include/cudnn.h /usr/include
$ sudo cp -P lib64/libcudnn* /usr/lib/x86_64-linux-gnu/
$ sudo chmod a+r /usr/lib/x86_64-linux-gnu/libcudnn*

edited Apr 13 at 12:25 answered May 4 '16 at 6:12


Community Martin Thoma
1 3,248 9 30 57

7 Adding -P retains the symbolic links, i.e. sudo cp -P lib64/libcudnn* /usr/lib/x86_64-


linux-gnu/ , and avoids the message: /sbin/ldconfig.real: /usr/lib/x86_64-linux-
gnu/libcudnn.so.5 is not a symbolic link Max Gordon Jun 26 '16 at 8:56

@MaxGordon Thank you! Martin Thoma Jun 26 '16 at 13:07

Update from here: "Download cuDNN v4 (v5 is currently a release candidate and is only supported when installing
TensorFlow from sources)." nobar Sep 4 '16 at 23:06

16 For Tensorow to nd everything, I had to copy include/cudnn.h and the libraries in lib64/ to
/usr/local/cuda-8.0/include and /usr/local/cuda-8.0/lib64 (using CUDA 8.0, Ubuntu 14.04,
Tensorow 0.12.0rc0) - maybe this is helpful for somebody. David Stutz Dec 9 '16 at 12:16

1. Register on NVidia's website. It may take a day, or two before they'll get your account
approved. At least that used to be the case back when I registered.
2. Download and Install latest CUDA from NVidia, or the latest version that ts the software
you'll be working with, if any, in this case your version of TFlow.

1 of 2 25.04.2017 20:11
nvidia - How can I install CuDNN on Ubuntu 16... https://askubuntu.com/questions/767269/how-ca...

3. Download CuDNN from NVidia


4. You can nd where CUDA is located via which nvcc . Usually /usr/local/cuda/ will be a
symbolic link to your currently installed version.
5. Open CuDNN archive and copy appropriate contents into appropriate places within CUDA
installation folder ( cuda/lib64/ and cuda/include/ ). I usually sudo nautilus and do it
from there visually.

answered Aug 11 '16 at 16:35


hor M
73 1 4

Also, you can download the deb packages for Debian based distributions.

From the NVIDIA web page, for the developer prole are available the next les :

cuDNN v5.1 Runtime Library for Linux (Deb)


cuDNN v5.1 Developer Library for Linux (Deb)
cuDNN v5.1 Code Samples and User Guide Linux (Deb)

I tested this, over my machine with Debian (Stretch) and TensorFlow is working !

answered Jun 28 '16 at 16:56


LAraque
21 1

3 Please note that as of now (July 2016) cuDNN v5.1 won't work with TensorFlow unless you compiled it from
source, see tensorow.org/versions/r0.9/get_started/os_setup.html mastazi Jul 12 '16 at 4:48

the answer is correct but for cuDNN 5.1 some names have been changed. So if you use this
version after extracting the cuDNN le you will nd two folder: lib and include. change the
name of *.h le in include folder to cudnn.h and then follow https://askubuntu.com/a/767270
/641589. this change is needed if you wanted to use cuDNN for Cae!

edited Apr 13 at 12:24 answered Jan 12 at 18:03


Community abolfazl taghribi
1 1 1

Please edit your answer and add the reference, 'the instruction above'. sudodus Jan 12 at 18:42

2 of 2 25.04.2017 20:11

You might also like