How to check if CUDA and cuDNN are correctly installed and working in conjunction?

I’ve installed cuda-toolkit-11-2 Runtime Library by following instructions from the official website here, with a slight change in the last step. Instead of sudo apt-get install cuda I did sudo apt-get install cuda-toolkit-11-2. I’m using Linux Mint 20.1.

After that I installed cuDNN, or I should say copied and pasted the files from the tar archive to cuda folder on my system as directed here.

But I’m unable to verify this test as I did not get the cudnn from a deb file.

My concern is how to check if cudnn is correctly configured with cuda toolkit.

I have tried solution here but cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2 gives no output. Even whereis cudnn.h gives just cudnn: and nothing else.

However,

function lib_installed() { /sbin/ldconfig -N -v $(sed 's/:/ /' <<< $LD_LIBRARY_PATH) 2>/dev/null | grep $1; }
function check() { lib_installed $1 && echo "$1 is installed" || echo "ERROR: $1 is NOT installed"; }
check libcudnn 

this thing gives output that libcudnn is installed. I’m really not sure if everything is in place and correct or not.

Any help would be appreciated. Thanks in advance.

1 Like