Using custom CuDNN paths for non-root accesses

Is there any possibility to use custom paths for CuDNN files instead of moving them to CUDA_ROOT? Currently, I have written

export LD_LIBRARY_PATH=/opt/cuda-11.2/lib64:$HOME/cudnn/lib64:$LD_LIBRARY_PATH
export CFLAGS="-I$HOME/cudnn/include"

in .bashrc but I am not sure if that is correct, because the Pytorch says it has been compiled without CuDNN. Any comment for that?


Have you tried exporting the installation path ?