file missing after installing cuDNN successfully and being present


I’m trying to install cuDNN on my Ubuntu 22.10 machine, I’ve followed the instructions here on how to install it using the package manager.

The installation has worked fine and I was able to compile the mnistCUDNN example like in step 1.4.

But unfortunately when I run the compiled mnistCUDNN binary I get the following error:

Could not load library Error: cannot open shared object file: No such file or directory

My LD_LIBRARY_PATH env variable is set to the following path /usr/local/cuda-12.0/lib64

When I check that directory there is a file called as well
as the following versions of

so there is a version 12 file but no like in the error message.

Also running sudo apt list | grep libcudnn8 gives me the following output:

libcudnn8-dev/unbekannt,now amd64  [installiert]
libcudnn8-samples/unbekannt,now amd64  [installiert]
libcudnn8/unbekannt,now amd64  [installiert]

Now I’m wondering why that file is missing or why it can’t work with the existing

nvidia-smi works fine too and tells me that I have cuda version 12 running.

I don’t know why but I got to fix this by copying the contents of the cuDNN tar file like described here in section 1.3.1, on top of the package manager installation. After doing this everything works.

$ sudo cp cudnn-*-archive/include/cudnn*.h /usr/local/cuda-12.0/include 
$ sudo cp -P cudnn-*-archive/lib/libcudnn* /usr/local/cuda-12.0/lib64 
$ sudo chmod a+r /usr/local/cuda-12.0/include/cudnn*.h /usr/local/cuda-12.0/lib64/libcudnn*

Make sure to check if the the directory of your cuda installation differs.

The tar file is available for download here.

On a side note: Even after copying there’s no file so maybe the build distributed with apt has a bug?