Where is cudnn.h please? - Technical Help - DeepTalk - Deep Learning Community

Where is cudnn.h please?

post by Gus.AI on Apr 19, 2022

I can’t find cudnn.h file? upon searching system wide I found the file use_cudnn.h under:

/usr/local/lib/python3.8/dist-packages/tensorflow/include/tensorflow/core/util/

is this the same file or something else?


post by markd on Apr 24, 2022

cudnn.h is a C header file. You should not need this with python.

I will see if Lambda stack can add it in the future.

Currently Lambda Stack builds and compiles pytorch and tensorflow with CUDA and cudnn runtime libraries.

If you use Anaconda/miniconda that does install it with Anaconda.

Otherwise to get the C header files for cudnn you would need to install the CUDNN package from NVIDIA

which does require registering at NVIDIA. (Yes a bit of a pain).

Get cuDNN: cuDNN Archive | NVIDIA Developer

Local Installer for Ubuntu20.04 x86_64 (Deb)

or

Local Installer for Linux x86_64 (Tar)

tar -xf cudnn-linux-x86_64-8.3.3.40_cuda11.5-archive.tar.xz

It will extract in a local directory with :

cudnn-linux-x86_64-8.3.3.40_cuda11.5-archive/

NVIDIA installs in a the package in /usr/includ and libs in /usr/lib/…

It looks like they changed the format from previously so I just ran through it again.

  1. Download the file from the web.

  2. Install this version:

    $ sudo dpkg -i cudnn-local-repo-ubuntu2004-8.3.3.40_1.0-1_amd64.deb
    

[sudo] password for mark:

Selecting previously unselected package cudnn-local-repo-ubuntu2004-8.3.3.40.

(Reading database … 463170 files and directories currently installed.)

Preparing to unpack cudnn-local-repo-ubuntu2004-8.3.3.40_1.0-1_amd64.deb …

Unpacking cudnn-local-repo-ubuntu2004-8.3.3.40 (1.0-1) …

Setting up cudnn-local-repo-ubuntu2004-8.3.3.40 (1.0-1) …

The public CUDA GPG key does not appear to be installed.

To install the key, run this command:

sudo apt-key add /var/cudnn-local-repo-ubuntu2004-8.3.3.40/7fa2af80.pub
  1. Follow the instruction and install this local repo for this cudnn:

    $ sudo apt-key add /var/cudnn-local-repo-ubuntu2004-8.3.3.40/7fa2af80.pub
    OK
    $ sudo apt-get update
    $ sudo apt install libcudnn8 libcudnn8-dev
    

post by yanos on Jun 6, 2023

The Lambda Stack has the CUDNN library for Tensorflow and Pytorch software in the following directories:

/usr/lib/python3/dist-packages/torch/lib/libcudnn.so.8
/usr/lib/python3/dist-packages/tensorflow/libcudnn.so.8

There is no “cudnn.h” file by default with Lambda Stack if that is what you are looking for.


post by markd on Jun 13, 2023

Just a update. At least on Ubuntu 22.04 it looks like there is a ‘nvidia-cudnn’ which does include the C header files.

$ apt search nvidia-cudnn

nvidia-cudnn/jammy,now 8.2.4.15~cuda11.4 amd64 [installed]

NVIDIA CUDA Deep Neural Network library (install script)

$ sudo apt install nvidia-cudnn

It installs the header file in:

/usr/include/x86_64-linux-gnu/cudnn.h

But note this is also install the cudnn library and may conflict with the PyTorch/TensorFlow builds at times.