Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install latest cuDNN to conda?

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?

like image 279
Andriy Rizhiy Avatar asked Mar 20 '19 08:03

Andriy Rizhiy


People also ask

How do you upgrade cuDNN in anaconda?

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.

How do I update cuDNN library?

Upgrading cuDNN. Navigate to the directory containing cuDNN and delete the old cuDNN bin , lib , and header files. Remove the path to the directory containing cuDNN from the $(PATH) environment variable. Reinstall a newer cuDNN version by following the steps in Installing on Windows.

How do I download and install cuDNN?

STEP 2) Download and setup CUDNN. Go to https://developer.nvidia.com/cudnn to download the latest version of CUDNN for the latest CUDA toolkit version OR go to https://developer.nvidia.com/rdp/cudnn-archive to download a previous version of CUDNN that is compatible with your CUDA toolkit.


4 Answers

  1. conda update --force conda
  2. conda update conda
  3. conda install -c anaconda cudnn
  4. conda list cudnn
like image 109
继越王 Avatar answered Oct 17 '22 14:10

继越王


  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

like image 25
Jonathan Domínguez Avatar answered Oct 17 '22 12:10

Jonathan Domínguez


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.

like image 5
Dmitry Maslov Avatar answered Oct 17 '22 12:10

Dmitry Maslov


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

like image 4
Ulgen Avatar answered Oct 17 '22 12:10

Ulgen