Compiling OpenCV with cudnn on Debian 12

That’s odd, the locations look correct. You shouldn’t even need to include WITH_CUDNN and OPENCV_CNN_CUDA for it to work. Just out of interest what happens if you don’t include those flags?