Where is cudnn.h please?

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


is this the same file or something else?

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

  • Pick the version that you would like depending on what version you have installed
    Local Installer for Ubuntu20.04 x86_64 (Deb)
    Local Installer for Linux x86_64 (Tar)
  • This one you can install anywhere
    tar -xf cudnn-linux-x86_64-
    It will extract in a local directory with :

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-
    [sudo] password for mark:
    Selecting previously unselected package cudnn-local-repo-ubuntu2004-
    (Reading database … 463170 files and directories currently installed.)
    Preparing to unpack cudnn-local-repo-ubuntu2004- …
    Unpacking cudnn-local-repo-ubuntu2004- (1.0-1) …
    Setting up cudnn-local-repo-ubuntu2004- (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-

  3. Follow the instruction and install this local repo for this cudnn:
    $ sudo apt-key add /var/cudnn-local-repo-ubuntu2004-
    $ sudo apt-get update
    $ sudo apt install libcudnn8 libcudnn8-dev

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


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

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 amd64 [installed]
NVIDIA CUDA Deep Neural Network library (install script)

$ sudo apt install nvidia-cudnn
It installs the header file in:

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