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?
16.04 nvidia cuda gpu
add a comment |
For TensorFlow I would like to install cuda and CuDNN. How do I do that on Ubuntu 16.04?
16.04 nvidia cuda gpu
4
Warning: if you're trying to run tensorflow and need cudnn, make sure to install 5.1 and not 6.0 for now.
– wordsforthewise
Apr 18 '17 at 5:50
@wordsforthewise CuDNN 6.0 is now supported (for TF 1.4 at least).
– ComputerScientist
Nov 26 '17 at 21:56
add a comment |
For TensorFlow I would like to install cuda and CuDNN. How do I do that on Ubuntu 16.04?
16.04 nvidia cuda gpu
For TensorFlow I would like to install cuda and CuDNN. How do I do that on Ubuntu 16.04?
16.04 nvidia cuda gpu
16.04 nvidia cuda gpu
edited Jul 18 '18 at 17:22
Amir
2621313
2621313
asked May 4 '16 at 6:12
Martin ThomaMartin Thoma
6,468155172
6,468155172
4
Warning: if you're trying to run tensorflow and need cudnn, make sure to install 5.1 and not 6.0 for now.
– wordsforthewise
Apr 18 '17 at 5:50
@wordsforthewise CuDNN 6.0 is now supported (for TF 1.4 at least).
– ComputerScientist
Nov 26 '17 at 21:56
add a comment |
4
Warning: if you're trying to run tensorflow and need cudnn, make sure to install 5.1 and not 6.0 for now.
– wordsforthewise
Apr 18 '17 at 5:50
@wordsforthewise CuDNN 6.0 is now supported (for TF 1.4 at least).
– ComputerScientist
Nov 26 '17 at 21:56
4
4
Warning: if you're trying to run tensorflow and need cudnn, make sure to install 5.1 and not 6.0 for now.
– wordsforthewise
Apr 18 '17 at 5:50
Warning: if you're trying to run tensorflow and need cudnn, make sure to install 5.1 and not 6.0 for now.
– wordsforthewise
Apr 18 '17 at 5:50
@wordsforthewise CuDNN 6.0 is now supported (for TF 1.4 at least).
– ComputerScientist
Nov 26 '17 at 21:56
@wordsforthewise CuDNN 6.0 is now supported (for TF 1.4 at least).
– ComputerScientist
Nov 26 '17 at 21:56
add a comment |
8 Answers
8
active
oldest
votes
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 /usr/local/cuda/
or /usr/local/cuda-<version>
. You can check it with which nvcc
or ldconfig -p | grep cuda
Step 3: Copy the files:
Repository installation:
$ 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*
Runfile installation:
$ cd folder/extracted/contents
$ sudo cp include/cudnn.h /usr/local/cuda/include
$ sudo cp lib64/libcudnn* /usr/local/cuda/lib64
$ sudo chmod a+r /usr/local/cuda/lib64/libcudnn*
14
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
1
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
36
For Tensorflow to find everything, I had to copyinclude/cudnn.h
and the libraries inlib64/
to/usr/local/cuda-8.0/include
and/usr/local/cuda-8.0/lib64
(using CUDA 8.0, Ubuntu 14.04, Tensorflow 0.12.0rc0) - maybe this is helpful for somebody.
– David Stutz
Dec 9 '16 at 12:16
@MaxGordon Hi, does it matter if I use the runtime library for ubuntu16.04 power8 or the library for linux?
– tryingtolearn
Jun 15 '17 at 16:17
1
Another tip - make sure you install cuda before you install cudnn. Otherwise the cuda installers won't overwrite any /usr/local/cuda directories you may have created.
– kevins
Dec 8 '17 at 10:32
|
show 5 more comments
From 5.1 onwards you can't install according to what @Martin mentioned.
Download libcudnn6_6.0.21-1+cuda8.0_amd64.deb, libcudnn6-dev_6.0.21-1+cuda8.0_amd64.deb, libcudnn6-doc_6.0.21-1+cuda8.0_amd64.deb
from nvidia site and install one by one follwing way.
sudo dpkg -i <library_name>.deb
1
Thanks. I have fallen into this problem multiple times. Let's just establish a thumb rule. When things don't work, stick to installing using .deb packages.
– Anuraag Vaidya
Aug 17 '17 at 11:45
6
When compiling Tensorflow from source it is good to know that the cuDNN library installation path is/usr/lib/x86_64-linux-gnu/
– Visionscaper
Dec 11 '17 at 11:59
add a comment |
- 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.
Download and Install latest CUDA from NVidia, or the latest version that fits the software you'll be working with, if any, in this case your version of T-Flow.
Note, that installing via ubuntu's standard package manager via clicking probably won't work appropriately.
Instead, you'll probably have to follow these instructions in the terminal to install
.deb
pakage. After that you'll have to add a few lines to.bashrc
, or wherever appropriate in your case. For example, if you're configuring a server, it's probably going to be a different place, maybe somewhere prior to your app's autolaunch, as.bashrc
will probably not get executed in that case.
Download CuDNN from NVidia
I used the "Library for Linux" version, didn't have much luck with
.deb
packages.
You can find where CUDA is located via
which nvcc
. Usually/usr/local/cuda/
will be a symbolic link to your currently installed version.- Open CuDNN archive and copy appropriate contents into appropriate places within CUDA installation folder (
cuda/lib64/
andcuda/include/
). I usuallysudo nautilus
and do it from there visually.
add a comment |
Fast forward 2018 and NVIDIA now provides cuDNN 7.x for download. The installation steps are still similar with those described by @GPrathap. But if you want to replace the old cuDNN version with the newer one, you need to remove it first prior to the installation.
To recap:
Step 0. Verify that you already have installed CUDA toolkit. Proceed with CUDA toolkit installation if you haven't.
Step 1. Go to NVIDIA developer portal https://developer.nvidia.com/cudnn and download cuDNN.
Step 2. If you have previously installed cuDNN, remove it
sudo dpkg -r <old-cudnn-runtime>.deb
sudo dpkg -r <old-cudnn-dev>.deb
Step 3. Install the cuDNN library (runtime, dev, doc) using dpkg
sudo dpkg -i <new-cudnn-runtime>.deb
sudo dpkg -i <new-cudnn-dev>.deb
sudo ldconfig
Step 4. If you want to find where the library was installed you can update the locate index and then find the library location.
sudo updatedb
locate libcudnn
If you are specifically installing cuDNN 7.x against CUDA toolkit 9.1, this article provides more elaboration that can be of some help: http://tech.amikelive.com/node-679/quick-tip-installing-cuda-deep-neural-network-7-cudnn-7-x-library-for-cuda-toolkit-9-1-on-ubuntu-16-04/
Thanks @Mike, do you know what the difference is between using the deb files and the ordinary .tar file? which one is recommended and why? (By the way I myself used to install CUDA using the runfile and also use the .tar package for cuDNN in ubuntu)
– Breeze
Apr 6 '18 at 19:21
According to the relevant installation documents from Nvidia, what you say about having to remove the old versions is not correct:cuDNN v7 can coexist with previous versions of cuDNN, such as v5 or v6.
– n1k31t4
Apr 30 '18 at 23:13
add a comment |
Also, you can download the deb packages for Debian based distributions.
From the NVIDIA web page, for the developer profile are available the next files :
- 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 !
6
Please note that as of now (July 2016) cuDNN v5.1 won't work with TensorFlow unless you compiled it from source, see tensorflow.org/versions/r0.9/get_started/os_setup.html
– mastazi
Jul 12 '16 at 4:48
add a comment |
Adding an important detail to the still valid answers by @Martin Thoma and @Íhor Mé:
After copying the libcudnn files to the cuda directories, you must update your .bashrc file:
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"
export CUDA_HOME=/usr/local/cuda
You must then add the include directory to any config file that uses it.
Caffe e.g. has a config file which you must edit before compiling with make. For this, edit caffe/Makefile.config to add the paths to these config variables(add whitespace between paths):
INCLUDE_DIRS: /usr/local/caffe/cuda/include/
LIBRARY_DIRS: /usr/local/cuda/lib64/
For every current terminal window you want these changes to be effective, don't forget to execute the file once!
. ~/.bashrc
add a comment |
the answer is correct but for cuDNN 5.1 some names have been changed. So if you use this version after extracting the cuDNN file you will find two folder: lib and include. change the name of *.h file 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 Caffe!
Please edit your answer and add the reference, 'the instruction above'.
– sudodus
Jan 12 '17 at 18:42
add a comment |
In 16.04 if you are installing CUDA directly from Nvidia's website and you are also building Tensorflow from source then you can specificy the directory you want to indicate as being Cudnn. By default it is :
/usr/include/x86_64-linux-gnu
When you are building Tensorflow it will ask you which version you want to indicate you are using for Cudnn. Then after that it will ask where is it located. Just indicate the directory above and it will work fine. It should create a wheel file at that point and you can install it with pip.
add a comment |
protected by Community♦ Jun 28 '17 at 6:47
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
8 Answers
8
active
oldest
votes
8 Answers
8
active
oldest
votes
active
oldest
votes
active
oldest
votes
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 /usr/local/cuda/
or /usr/local/cuda-<version>
. You can check it with which nvcc
or ldconfig -p | grep cuda
Step 3: Copy the files:
Repository installation:
$ 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*
Runfile installation:
$ cd folder/extracted/contents
$ sudo cp include/cudnn.h /usr/local/cuda/include
$ sudo cp lib64/libcudnn* /usr/local/cuda/lib64
$ sudo chmod a+r /usr/local/cuda/lib64/libcudnn*
14
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
1
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
36
For Tensorflow to find everything, I had to copyinclude/cudnn.h
and the libraries inlib64/
to/usr/local/cuda-8.0/include
and/usr/local/cuda-8.0/lib64
(using CUDA 8.0, Ubuntu 14.04, Tensorflow 0.12.0rc0) - maybe this is helpful for somebody.
– David Stutz
Dec 9 '16 at 12:16
@MaxGordon Hi, does it matter if I use the runtime library for ubuntu16.04 power8 or the library for linux?
– tryingtolearn
Jun 15 '17 at 16:17
1
Another tip - make sure you install cuda before you install cudnn. Otherwise the cuda installers won't overwrite any /usr/local/cuda directories you may have created.
– kevins
Dec 8 '17 at 10:32
|
show 5 more comments
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 /usr/local/cuda/
or /usr/local/cuda-<version>
. You can check it with which nvcc
or ldconfig -p | grep cuda
Step 3: Copy the files:
Repository installation:
$ 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*
Runfile installation:
$ cd folder/extracted/contents
$ sudo cp include/cudnn.h /usr/local/cuda/include
$ sudo cp lib64/libcudnn* /usr/local/cuda/lib64
$ sudo chmod a+r /usr/local/cuda/lib64/libcudnn*
14
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
1
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
36
For Tensorflow to find everything, I had to copyinclude/cudnn.h
and the libraries inlib64/
to/usr/local/cuda-8.0/include
and/usr/local/cuda-8.0/lib64
(using CUDA 8.0, Ubuntu 14.04, Tensorflow 0.12.0rc0) - maybe this is helpful for somebody.
– David Stutz
Dec 9 '16 at 12:16
@MaxGordon Hi, does it matter if I use the runtime library for ubuntu16.04 power8 or the library for linux?
– tryingtolearn
Jun 15 '17 at 16:17
1
Another tip - make sure you install cuda before you install cudnn. Otherwise the cuda installers won't overwrite any /usr/local/cuda directories you may have created.
– kevins
Dec 8 '17 at 10:32
|
show 5 more comments
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 /usr/local/cuda/
or /usr/local/cuda-<version>
. You can check it with which nvcc
or ldconfig -p | grep cuda
Step 3: Copy the files:
Repository installation:
$ 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*
Runfile installation:
$ cd folder/extracted/contents
$ sudo cp include/cudnn.h /usr/local/cuda/include
$ sudo cp lib64/libcudnn* /usr/local/cuda/lib64
$ sudo chmod a+r /usr/local/cuda/lib64/libcudnn*
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 /usr/local/cuda/
or /usr/local/cuda-<version>
. You can check it with which nvcc
or ldconfig -p | grep cuda
Step 3: Copy the files:
Repository installation:
$ 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*
Runfile installation:
$ cd folder/extracted/contents
$ sudo cp include/cudnn.h /usr/local/cuda/include
$ sudo cp lib64/libcudnn* /usr/local/cuda/lib64
$ sudo chmod a+r /usr/local/cuda/lib64/libcudnn*
edited Jun 9 '18 at 9:16
answered May 4 '16 at 6:12
Martin ThomaMartin Thoma
6,468155172
6,468155172
14
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
1
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
36
For Tensorflow to find everything, I had to copyinclude/cudnn.h
and the libraries inlib64/
to/usr/local/cuda-8.0/include
and/usr/local/cuda-8.0/lib64
(using CUDA 8.0, Ubuntu 14.04, Tensorflow 0.12.0rc0) - maybe this is helpful for somebody.
– David Stutz
Dec 9 '16 at 12:16
@MaxGordon Hi, does it matter if I use the runtime library for ubuntu16.04 power8 or the library for linux?
– tryingtolearn
Jun 15 '17 at 16:17
1
Another tip - make sure you install cuda before you install cudnn. Otherwise the cuda installers won't overwrite any /usr/local/cuda directories you may have created.
– kevins
Dec 8 '17 at 10:32
|
show 5 more comments
14
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
1
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
36
For Tensorflow to find everything, I had to copyinclude/cudnn.h
and the libraries inlib64/
to/usr/local/cuda-8.0/include
and/usr/local/cuda-8.0/lib64
(using CUDA 8.0, Ubuntu 14.04, Tensorflow 0.12.0rc0) - maybe this is helpful for somebody.
– David Stutz
Dec 9 '16 at 12:16
@MaxGordon Hi, does it matter if I use the runtime library for ubuntu16.04 power8 or the library for linux?
– tryingtolearn
Jun 15 '17 at 16:17
1
Another tip - make sure you install cuda before you install cudnn. Otherwise the cuda installers won't overwrite any /usr/local/cuda directories you may have created.
– kevins
Dec 8 '17 at 10:32
14
14
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
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
1
1
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
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
36
36
For Tensorflow to find 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, Tensorflow 0.12.0rc0) - maybe this is helpful for somebody.– David Stutz
Dec 9 '16 at 12:16
For Tensorflow to find 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, Tensorflow 0.12.0rc0) - maybe this is helpful for somebody.– David Stutz
Dec 9 '16 at 12:16
@MaxGordon Hi, does it matter if I use the runtime library for ubuntu16.04 power8 or the library for linux?
– tryingtolearn
Jun 15 '17 at 16:17
@MaxGordon Hi, does it matter if I use the runtime library for ubuntu16.04 power8 or the library for linux?
– tryingtolearn
Jun 15 '17 at 16:17
1
1
Another tip - make sure you install cuda before you install cudnn. Otherwise the cuda installers won't overwrite any /usr/local/cuda directories you may have created.
– kevins
Dec 8 '17 at 10:32
Another tip - make sure you install cuda before you install cudnn. Otherwise the cuda installers won't overwrite any /usr/local/cuda directories you may have created.
– kevins
Dec 8 '17 at 10:32
|
show 5 more comments
From 5.1 onwards you can't install according to what @Martin mentioned.
Download libcudnn6_6.0.21-1+cuda8.0_amd64.deb, libcudnn6-dev_6.0.21-1+cuda8.0_amd64.deb, libcudnn6-doc_6.0.21-1+cuda8.0_amd64.deb
from nvidia site and install one by one follwing way.
sudo dpkg -i <library_name>.deb
1
Thanks. I have fallen into this problem multiple times. Let's just establish a thumb rule. When things don't work, stick to installing using .deb packages.
– Anuraag Vaidya
Aug 17 '17 at 11:45
6
When compiling Tensorflow from source it is good to know that the cuDNN library installation path is/usr/lib/x86_64-linux-gnu/
– Visionscaper
Dec 11 '17 at 11:59
add a comment |
From 5.1 onwards you can't install according to what @Martin mentioned.
Download libcudnn6_6.0.21-1+cuda8.0_amd64.deb, libcudnn6-dev_6.0.21-1+cuda8.0_amd64.deb, libcudnn6-doc_6.0.21-1+cuda8.0_amd64.deb
from nvidia site and install one by one follwing way.
sudo dpkg -i <library_name>.deb
1
Thanks. I have fallen into this problem multiple times. Let's just establish a thumb rule. When things don't work, stick to installing using .deb packages.
– Anuraag Vaidya
Aug 17 '17 at 11:45
6
When compiling Tensorflow from source it is good to know that the cuDNN library installation path is/usr/lib/x86_64-linux-gnu/
– Visionscaper
Dec 11 '17 at 11:59
add a comment |
From 5.1 onwards you can't install according to what @Martin mentioned.
Download libcudnn6_6.0.21-1+cuda8.0_amd64.deb, libcudnn6-dev_6.0.21-1+cuda8.0_amd64.deb, libcudnn6-doc_6.0.21-1+cuda8.0_amd64.deb
from nvidia site and install one by one follwing way.
sudo dpkg -i <library_name>.deb
From 5.1 onwards you can't install according to what @Martin mentioned.
Download libcudnn6_6.0.21-1+cuda8.0_amd64.deb, libcudnn6-dev_6.0.21-1+cuda8.0_amd64.deb, libcudnn6-doc_6.0.21-1+cuda8.0_amd64.deb
from nvidia site and install one by one follwing way.
sudo dpkg -i <library_name>.deb
edited Mar 19 '18 at 23:44
Craig S. Anderson
1246
1246
answered May 19 '17 at 5:17
GPrathapGPrathap
51153
51153
1
Thanks. I have fallen into this problem multiple times. Let's just establish a thumb rule. When things don't work, stick to installing using .deb packages.
– Anuraag Vaidya
Aug 17 '17 at 11:45
6
When compiling Tensorflow from source it is good to know that the cuDNN library installation path is/usr/lib/x86_64-linux-gnu/
– Visionscaper
Dec 11 '17 at 11:59
add a comment |
1
Thanks. I have fallen into this problem multiple times. Let's just establish a thumb rule. When things don't work, stick to installing using .deb packages.
– Anuraag Vaidya
Aug 17 '17 at 11:45
6
When compiling Tensorflow from source it is good to know that the cuDNN library installation path is/usr/lib/x86_64-linux-gnu/
– Visionscaper
Dec 11 '17 at 11:59
1
1
Thanks. I have fallen into this problem multiple times. Let's just establish a thumb rule. When things don't work, stick to installing using .deb packages.
– Anuraag Vaidya
Aug 17 '17 at 11:45
Thanks. I have fallen into this problem multiple times. Let's just establish a thumb rule. When things don't work, stick to installing using .deb packages.
– Anuraag Vaidya
Aug 17 '17 at 11:45
6
6
When compiling Tensorflow from source it is good to know that the cuDNN library installation path is
/usr/lib/x86_64-linux-gnu/
– Visionscaper
Dec 11 '17 at 11:59
When compiling Tensorflow from source it is good to know that the cuDNN library installation path is
/usr/lib/x86_64-linux-gnu/
– Visionscaper
Dec 11 '17 at 11:59
add a comment |
- 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.
Download and Install latest CUDA from NVidia, or the latest version that fits the software you'll be working with, if any, in this case your version of T-Flow.
Note, that installing via ubuntu's standard package manager via clicking probably won't work appropriately.
Instead, you'll probably have to follow these instructions in the terminal to install
.deb
pakage. After that you'll have to add a few lines to.bashrc
, or wherever appropriate in your case. For example, if you're configuring a server, it's probably going to be a different place, maybe somewhere prior to your app's autolaunch, as.bashrc
will probably not get executed in that case.
Download CuDNN from NVidia
I used the "Library for Linux" version, didn't have much luck with
.deb
packages.
You can find where CUDA is located via
which nvcc
. Usually/usr/local/cuda/
will be a symbolic link to your currently installed version.- Open CuDNN archive and copy appropriate contents into appropriate places within CUDA installation folder (
cuda/lib64/
andcuda/include/
). I usuallysudo nautilus
and do it from there visually.
add a comment |
- 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.
Download and Install latest CUDA from NVidia, or the latest version that fits the software you'll be working with, if any, in this case your version of T-Flow.
Note, that installing via ubuntu's standard package manager via clicking probably won't work appropriately.
Instead, you'll probably have to follow these instructions in the terminal to install
.deb
pakage. After that you'll have to add a few lines to.bashrc
, or wherever appropriate in your case. For example, if you're configuring a server, it's probably going to be a different place, maybe somewhere prior to your app's autolaunch, as.bashrc
will probably not get executed in that case.
Download CuDNN from NVidia
I used the "Library for Linux" version, didn't have much luck with
.deb
packages.
You can find where CUDA is located via
which nvcc
. Usually/usr/local/cuda/
will be a symbolic link to your currently installed version.- Open CuDNN archive and copy appropriate contents into appropriate places within CUDA installation folder (
cuda/lib64/
andcuda/include/
). I usuallysudo nautilus
and do it from there visually.
add a comment |
- 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.
Download and Install latest CUDA from NVidia, or the latest version that fits the software you'll be working with, if any, in this case your version of T-Flow.
Note, that installing via ubuntu's standard package manager via clicking probably won't work appropriately.
Instead, you'll probably have to follow these instructions in the terminal to install
.deb
pakage. After that you'll have to add a few lines to.bashrc
, or wherever appropriate in your case. For example, if you're configuring a server, it's probably going to be a different place, maybe somewhere prior to your app's autolaunch, as.bashrc
will probably not get executed in that case.
Download CuDNN from NVidia
I used the "Library for Linux" version, didn't have much luck with
.deb
packages.
You can find where CUDA is located via
which nvcc
. Usually/usr/local/cuda/
will be a symbolic link to your currently installed version.- Open CuDNN archive and copy appropriate contents into appropriate places within CUDA installation folder (
cuda/lib64/
andcuda/include/
). I usuallysudo nautilus
and do it from there visually.
- 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.
Download and Install latest CUDA from NVidia, or the latest version that fits the software you'll be working with, if any, in this case your version of T-Flow.
Note, that installing via ubuntu's standard package manager via clicking probably won't work appropriately.
Instead, you'll probably have to follow these instructions in the terminal to install
.deb
pakage. After that you'll have to add a few lines to.bashrc
, or wherever appropriate in your case. For example, if you're configuring a server, it's probably going to be a different place, maybe somewhere prior to your app's autolaunch, as.bashrc
will probably not get executed in that case.
Download CuDNN from NVidia
I used the "Library for Linux" version, didn't have much luck with
.deb
packages.
You can find where CUDA is located via
which nvcc
. Usually/usr/local/cuda/
will be a symbolic link to your currently installed version.- Open CuDNN archive and copy appropriate contents into appropriate places within CUDA installation folder (
cuda/lib64/
andcuda/include/
). I usuallysudo nautilus
and do it from there visually.
edited Mar 2 '18 at 18:50
answered Aug 11 '16 at 16:35
Íhor MéÍhor Mé
21226
21226
add a comment |
add a comment |
Fast forward 2018 and NVIDIA now provides cuDNN 7.x for download. The installation steps are still similar with those described by @GPrathap. But if you want to replace the old cuDNN version with the newer one, you need to remove it first prior to the installation.
To recap:
Step 0. Verify that you already have installed CUDA toolkit. Proceed with CUDA toolkit installation if you haven't.
Step 1. Go to NVIDIA developer portal https://developer.nvidia.com/cudnn and download cuDNN.
Step 2. If you have previously installed cuDNN, remove it
sudo dpkg -r <old-cudnn-runtime>.deb
sudo dpkg -r <old-cudnn-dev>.deb
Step 3. Install the cuDNN library (runtime, dev, doc) using dpkg
sudo dpkg -i <new-cudnn-runtime>.deb
sudo dpkg -i <new-cudnn-dev>.deb
sudo ldconfig
Step 4. If you want to find where the library was installed you can update the locate index and then find the library location.
sudo updatedb
locate libcudnn
If you are specifically installing cuDNN 7.x against CUDA toolkit 9.1, this article provides more elaboration that can be of some help: http://tech.amikelive.com/node-679/quick-tip-installing-cuda-deep-neural-network-7-cudnn-7-x-library-for-cuda-toolkit-9-1-on-ubuntu-16-04/
Thanks @Mike, do you know what the difference is between using the deb files and the ordinary .tar file? which one is recommended and why? (By the way I myself used to install CUDA using the runfile and also use the .tar package for cuDNN in ubuntu)
– Breeze
Apr 6 '18 at 19:21
According to the relevant installation documents from Nvidia, what you say about having to remove the old versions is not correct:cuDNN v7 can coexist with previous versions of cuDNN, such as v5 or v6.
– n1k31t4
Apr 30 '18 at 23:13
add a comment |
Fast forward 2018 and NVIDIA now provides cuDNN 7.x for download. The installation steps are still similar with those described by @GPrathap. But if you want to replace the old cuDNN version with the newer one, you need to remove it first prior to the installation.
To recap:
Step 0. Verify that you already have installed CUDA toolkit. Proceed with CUDA toolkit installation if you haven't.
Step 1. Go to NVIDIA developer portal https://developer.nvidia.com/cudnn and download cuDNN.
Step 2. If you have previously installed cuDNN, remove it
sudo dpkg -r <old-cudnn-runtime>.deb
sudo dpkg -r <old-cudnn-dev>.deb
Step 3. Install the cuDNN library (runtime, dev, doc) using dpkg
sudo dpkg -i <new-cudnn-runtime>.deb
sudo dpkg -i <new-cudnn-dev>.deb
sudo ldconfig
Step 4. If you want to find where the library was installed you can update the locate index and then find the library location.
sudo updatedb
locate libcudnn
If you are specifically installing cuDNN 7.x against CUDA toolkit 9.1, this article provides more elaboration that can be of some help: http://tech.amikelive.com/node-679/quick-tip-installing-cuda-deep-neural-network-7-cudnn-7-x-library-for-cuda-toolkit-9-1-on-ubuntu-16-04/
Thanks @Mike, do you know what the difference is between using the deb files and the ordinary .tar file? which one is recommended and why? (By the way I myself used to install CUDA using the runfile and also use the .tar package for cuDNN in ubuntu)
– Breeze
Apr 6 '18 at 19:21
According to the relevant installation documents from Nvidia, what you say about having to remove the old versions is not correct:cuDNN v7 can coexist with previous versions of cuDNN, such as v5 or v6.
– n1k31t4
Apr 30 '18 at 23:13
add a comment |
Fast forward 2018 and NVIDIA now provides cuDNN 7.x for download. The installation steps are still similar with those described by @GPrathap. But if you want to replace the old cuDNN version with the newer one, you need to remove it first prior to the installation.
To recap:
Step 0. Verify that you already have installed CUDA toolkit. Proceed with CUDA toolkit installation if you haven't.
Step 1. Go to NVIDIA developer portal https://developer.nvidia.com/cudnn and download cuDNN.
Step 2. If you have previously installed cuDNN, remove it
sudo dpkg -r <old-cudnn-runtime>.deb
sudo dpkg -r <old-cudnn-dev>.deb
Step 3. Install the cuDNN library (runtime, dev, doc) using dpkg
sudo dpkg -i <new-cudnn-runtime>.deb
sudo dpkg -i <new-cudnn-dev>.deb
sudo ldconfig
Step 4. If you want to find where the library was installed you can update the locate index and then find the library location.
sudo updatedb
locate libcudnn
If you are specifically installing cuDNN 7.x against CUDA toolkit 9.1, this article provides more elaboration that can be of some help: http://tech.amikelive.com/node-679/quick-tip-installing-cuda-deep-neural-network-7-cudnn-7-x-library-for-cuda-toolkit-9-1-on-ubuntu-16-04/
Fast forward 2018 and NVIDIA now provides cuDNN 7.x for download. The installation steps are still similar with those described by @GPrathap. But if you want to replace the old cuDNN version with the newer one, you need to remove it first prior to the installation.
To recap:
Step 0. Verify that you already have installed CUDA toolkit. Proceed with CUDA toolkit installation if you haven't.
Step 1. Go to NVIDIA developer portal https://developer.nvidia.com/cudnn and download cuDNN.
Step 2. If you have previously installed cuDNN, remove it
sudo dpkg -r <old-cudnn-runtime>.deb
sudo dpkg -r <old-cudnn-dev>.deb
Step 3. Install the cuDNN library (runtime, dev, doc) using dpkg
sudo dpkg -i <new-cudnn-runtime>.deb
sudo dpkg -i <new-cudnn-dev>.deb
sudo ldconfig
Step 4. If you want to find where the library was installed you can update the locate index and then find the library location.
sudo updatedb
locate libcudnn
If you are specifically installing cuDNN 7.x against CUDA toolkit 9.1, this article provides more elaboration that can be of some help: http://tech.amikelive.com/node-679/quick-tip-installing-cuda-deep-neural-network-7-cudnn-7-x-library-for-cuda-toolkit-9-1-on-ubuntu-16-04/
answered Mar 30 '18 at 3:02
MikeMike
8111
8111
Thanks @Mike, do you know what the difference is between using the deb files and the ordinary .tar file? which one is recommended and why? (By the way I myself used to install CUDA using the runfile and also use the .tar package for cuDNN in ubuntu)
– Breeze
Apr 6 '18 at 19:21
According to the relevant installation documents from Nvidia, what you say about having to remove the old versions is not correct:cuDNN v7 can coexist with previous versions of cuDNN, such as v5 or v6.
– n1k31t4
Apr 30 '18 at 23:13
add a comment |
Thanks @Mike, do you know what the difference is between using the deb files and the ordinary .tar file? which one is recommended and why? (By the way I myself used to install CUDA using the runfile and also use the .tar package for cuDNN in ubuntu)
– Breeze
Apr 6 '18 at 19:21
According to the relevant installation documents from Nvidia, what you say about having to remove the old versions is not correct:cuDNN v7 can coexist with previous versions of cuDNN, such as v5 or v6.
– n1k31t4
Apr 30 '18 at 23:13
Thanks @Mike, do you know what the difference is between using the deb files and the ordinary .tar file? which one is recommended and why? (By the way I myself used to install CUDA using the runfile and also use the .tar package for cuDNN in ubuntu)
– Breeze
Apr 6 '18 at 19:21
Thanks @Mike, do you know what the difference is between using the deb files and the ordinary .tar file? which one is recommended and why? (By the way I myself used to install CUDA using the runfile and also use the .tar package for cuDNN in ubuntu)
– Breeze
Apr 6 '18 at 19:21
According to the relevant installation documents from Nvidia, what you say about having to remove the old versions is not correct:
cuDNN v7 can coexist with previous versions of cuDNN, such as v5 or v6.
– n1k31t4
Apr 30 '18 at 23:13
According to the relevant installation documents from Nvidia, what you say about having to remove the old versions is not correct:
cuDNN v7 can coexist with previous versions of cuDNN, such as v5 or v6.
– n1k31t4
Apr 30 '18 at 23:13
add a comment |
Also, you can download the deb packages for Debian based distributions.
From the NVIDIA web page, for the developer profile are available the next files :
- 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 !
6
Please note that as of now (July 2016) cuDNN v5.1 won't work with TensorFlow unless you compiled it from source, see tensorflow.org/versions/r0.9/get_started/os_setup.html
– mastazi
Jul 12 '16 at 4:48
add a comment |
Also, you can download the deb packages for Debian based distributions.
From the NVIDIA web page, for the developer profile are available the next files :
- 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 !
6
Please note that as of now (July 2016) cuDNN v5.1 won't work with TensorFlow unless you compiled it from source, see tensorflow.org/versions/r0.9/get_started/os_setup.html
– mastazi
Jul 12 '16 at 4:48
add a comment |
Also, you can download the deb packages for Debian based distributions.
From the NVIDIA web page, for the developer profile are available the next files :
- 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 !
Also, you can download the deb packages for Debian based distributions.
From the NVIDIA web page, for the developer profile are available the next files :
- 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
LAraqueLAraque
311
311
6
Please note that as of now (July 2016) cuDNN v5.1 won't work with TensorFlow unless you compiled it from source, see tensorflow.org/versions/r0.9/get_started/os_setup.html
– mastazi
Jul 12 '16 at 4:48
add a comment |
6
Please note that as of now (July 2016) cuDNN v5.1 won't work with TensorFlow unless you compiled it from source, see tensorflow.org/versions/r0.9/get_started/os_setup.html
– mastazi
Jul 12 '16 at 4:48
6
6
Please note that as of now (July 2016) cuDNN v5.1 won't work with TensorFlow unless you compiled it from source, see tensorflow.org/versions/r0.9/get_started/os_setup.html
– mastazi
Jul 12 '16 at 4:48
Please note that as of now (July 2016) cuDNN v5.1 won't work with TensorFlow unless you compiled it from source, see tensorflow.org/versions/r0.9/get_started/os_setup.html
– mastazi
Jul 12 '16 at 4:48
add a comment |
Adding an important detail to the still valid answers by @Martin Thoma and @Íhor Mé:
After copying the libcudnn files to the cuda directories, you must update your .bashrc file:
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"
export CUDA_HOME=/usr/local/cuda
You must then add the include directory to any config file that uses it.
Caffe e.g. has a config file which you must edit before compiling with make. For this, edit caffe/Makefile.config to add the paths to these config variables(add whitespace between paths):
INCLUDE_DIRS: /usr/local/caffe/cuda/include/
LIBRARY_DIRS: /usr/local/cuda/lib64/
For every current terminal window you want these changes to be effective, don't forget to execute the file once!
. ~/.bashrc
add a comment |
Adding an important detail to the still valid answers by @Martin Thoma and @Íhor Mé:
After copying the libcudnn files to the cuda directories, you must update your .bashrc file:
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"
export CUDA_HOME=/usr/local/cuda
You must then add the include directory to any config file that uses it.
Caffe e.g. has a config file which you must edit before compiling with make. For this, edit caffe/Makefile.config to add the paths to these config variables(add whitespace between paths):
INCLUDE_DIRS: /usr/local/caffe/cuda/include/
LIBRARY_DIRS: /usr/local/cuda/lib64/
For every current terminal window you want these changes to be effective, don't forget to execute the file once!
. ~/.bashrc
add a comment |
Adding an important detail to the still valid answers by @Martin Thoma and @Íhor Mé:
After copying the libcudnn files to the cuda directories, you must update your .bashrc file:
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"
export CUDA_HOME=/usr/local/cuda
You must then add the include directory to any config file that uses it.
Caffe e.g. has a config file which you must edit before compiling with make. For this, edit caffe/Makefile.config to add the paths to these config variables(add whitespace between paths):
INCLUDE_DIRS: /usr/local/caffe/cuda/include/
LIBRARY_DIRS: /usr/local/cuda/lib64/
For every current terminal window you want these changes to be effective, don't forget to execute the file once!
. ~/.bashrc
Adding an important detail to the still valid answers by @Martin Thoma and @Íhor Mé:
After copying the libcudnn files to the cuda directories, you must update your .bashrc file:
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"
export CUDA_HOME=/usr/local/cuda
You must then add the include directory to any config file that uses it.
Caffe e.g. has a config file which you must edit before compiling with make. For this, edit caffe/Makefile.config to add the paths to these config variables(add whitespace between paths):
INCLUDE_DIRS: /usr/local/caffe/cuda/include/
LIBRARY_DIRS: /usr/local/cuda/lib64/
For every current terminal window you want these changes to be effective, don't forget to execute the file once!
. ~/.bashrc
answered Apr 5 '18 at 5:57
Agile BeanAgile Bean
1414
1414
add a comment |
add a comment |
the answer is correct but for cuDNN 5.1 some names have been changed. So if you use this version after extracting the cuDNN file you will find two folder: lib and include. change the name of *.h file 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 Caffe!
Please edit your answer and add the reference, 'the instruction above'.
– sudodus
Jan 12 '17 at 18:42
add a comment |
the answer is correct but for cuDNN 5.1 some names have been changed. So if you use this version after extracting the cuDNN file you will find two folder: lib and include. change the name of *.h file 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 Caffe!
Please edit your answer and add the reference, 'the instruction above'.
– sudodus
Jan 12 '17 at 18:42
add a comment |
the answer is correct but for cuDNN 5.1 some names have been changed. So if you use this version after extracting the cuDNN file you will find two folder: lib and include. change the name of *.h file 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 Caffe!
the answer is correct but for cuDNN 5.1 some names have been changed. So if you use this version after extracting the cuDNN file you will find two folder: lib and include. change the name of *.h file 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 Caffe!
edited Apr 13 '17 at 12:24
Community♦
1
1
answered Jan 12 '17 at 18:03
abolfazl taghribiabolfazl taghribi
12
12
Please edit your answer and add the reference, 'the instruction above'.
– sudodus
Jan 12 '17 at 18:42
add a comment |
Please edit your answer and add the reference, 'the instruction above'.
– sudodus
Jan 12 '17 at 18:42
Please edit your answer and add the reference, 'the instruction above'.
– sudodus
Jan 12 '17 at 18:42
Please edit your answer and add the reference, 'the instruction above'.
– sudodus
Jan 12 '17 at 18:42
add a comment |
In 16.04 if you are installing CUDA directly from Nvidia's website and you are also building Tensorflow from source then you can specificy the directory you want to indicate as being Cudnn. By default it is :
/usr/include/x86_64-linux-gnu
When you are building Tensorflow it will ask you which version you want to indicate you are using for Cudnn. Then after that it will ask where is it located. Just indicate the directory above and it will work fine. It should create a wheel file at that point and you can install it with pip.
add a comment |
In 16.04 if you are installing CUDA directly from Nvidia's website and you are also building Tensorflow from source then you can specificy the directory you want to indicate as being Cudnn. By default it is :
/usr/include/x86_64-linux-gnu
When you are building Tensorflow it will ask you which version you want to indicate you are using for Cudnn. Then after that it will ask where is it located. Just indicate the directory above and it will work fine. It should create a wheel file at that point and you can install it with pip.
add a comment |
In 16.04 if you are installing CUDA directly from Nvidia's website and you are also building Tensorflow from source then you can specificy the directory you want to indicate as being Cudnn. By default it is :
/usr/include/x86_64-linux-gnu
When you are building Tensorflow it will ask you which version you want to indicate you are using for Cudnn. Then after that it will ask where is it located. Just indicate the directory above and it will work fine. It should create a wheel file at that point and you can install it with pip.
In 16.04 if you are installing CUDA directly from Nvidia's website and you are also building Tensorflow from source then you can specificy the directory you want to indicate as being Cudnn. By default it is :
/usr/include/x86_64-linux-gnu
When you are building Tensorflow it will ask you which version you want to indicate you are using for Cudnn. Then after that it will ask where is it located. Just indicate the directory above and it will work fine. It should create a wheel file at that point and you can install it with pip.
edited Feb 15 '18 at 0:47
answered Feb 15 '18 at 0:21
GoddardGoddard
3,44722143
3,44722143
add a comment |
add a comment |
protected by Community♦ Jun 28 '17 at 6:47
Thank you for your interest in this question.
Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?
4
Warning: if you're trying to run tensorflow and need cudnn, make sure to install 5.1 and not 6.0 for now.
– wordsforthewise
Apr 18 '17 at 5:50
@wordsforthewise CuDNN 6.0 is now supported (for TF 1.4 at least).
– ComputerScientist
Nov 26 '17 at 21:56