22

In conda the latest version of conda is:

cudnn                     7.3.1                cuda10.0_0    anaconda

But i need 7.4.2 for tensorflow-gpu.1.13 How install cuDNN==7.4.2 in conda?

Andriy Rizhiy
  • 233
  • 1
  • 2
  • 7

6 Answers6

18
  1. conda update --force conda
  2. conda update conda
  3. conda install -c anaconda cudnn
  4. conda list cudnn
继越王
  • 181
  • 1
  • 3
8

You can install with conda-forge

conda install -c conda-forge cudnn

https://anaconda.org/conda-forge/cudnn

It is more up to date than anaconda channel - for example as of today, latest version of cudnn on anaconda is still 7.6.5, but on conda-forge v8.2.0.53. Same applies to cudatoolkit package.

Dmitry Maslov
  • 91
  • 2
  • 6
4
  1. You need to uninstall cudnn: conda uninstall cudnn.

  2. Uninstall any tensorflow dependencies: "conda uninstall tensorflow"

  3. Install tensorflow using pip: "pip install tensorflow"

  4. Install CuDNN and Cuda ToolKit following the instructions in here: https://www.tensorflow.org/install/gpu#linux_setup

  5. Use PyCharm or Spyder to run Scripts using tensorflow

  • After uninstalling, I was able to get it the relavent cuda version by just `conda install tensorflow-gpu` – Ben Jun 23 '19 at 11:43
4

The best use is to install both cuda-toolkit and CuDNN using conda environment for the best compatibility. But in some cases people might need the latest version. Moreover sometimes cuda packages are updated in different schedules such as the time being this answer is provided, conda provides cudatoolkit-11.0 but cant provide CuDNN-8.0 at the same time. which happened in my case. There is a workaround for this problem.

install conda-toolkit using conda enviroment and download the latest matching CuDNN version from Nvidia CuDNN page for installed cuda-toolkit. Use tar and unzip the packages and copy the CuDNN files to your anaconda environment.

sudo cp cuda/include/cudnn*.h   /anaconda3/envs/<your environment here>/include
sudo cp cuda/lib64/libcudnn*    /anaconda3/envs/<your environment here>/lib
sudo chmod a+r /usr/local/cuda/include/cudnn*.h    /anaconda3/envs/<your environment here>/lib/libcudnn*

In the given snipped "cuda" path represent the unzipped CuDNN folder. This workaround is tested with tensorflow-2.4 & cudatoolkit-11.0 & CuDNN 8.0.4

Ulgen
  • 126
  • 1
  • 2
  • 6
1

This is how i installed cudnn.

1. You can download cudnn tar file of a version which you want from NVIDIA and extract it. Then, you can see "cuda" folder including cudnn files.

2. Copy and paste the cudnn files to conda envs lib and include folder:

sudo cp cuda/include/cudnn*.h anaconda3/envs/"your_env_name"/include
sudo cp cuda/lib64/libcudnn* anaconda3/envs/"your_env_name"/lib

anaconda3 is your anaconda installation folder.

In my case, it worked.

Crispy13
  • 230
  • 1
  • 3
  • 16
0

This was not possible to do it with conda at the time the question was made. That is way it was suggested to try this. However, now it is possible. Follow the other answers

alibaba
  • 75
  • 4