OpenCV 4.2.0 does not seem to work with CUDNN 8.0

I’m using an Nvidia Xavier NX wihich came with CUDNN 8.0 preinstalled. I would like to use the net.setPreferableBackend function to accelerate opencv running a dnn, but 4.2.0 does not detect CUDNN on my machine when I cmake opencv. Do I need a newer version? Or is something else wrong? (4.5.1 did not seem to work with ROS, so I would like to avoid it for now)

Which version of CUDA are you building against? cuDNN 8.0 is supported by CUDA 10.2 and 11.0 only although I would assume if its pre-installed then the correct version of CUDA would also be present? I would see this for cmake switches which may help you to find cudnn.

In my experience on ubuntu if its installed cmake will find it, what are your cmake commands and output and are you using the same commands as you did on 4.5.1?

Thanks for the response. I have installed OCV 4.4.0 now which seems to be working smoothly and seems to work with ROS noetic

cuDNN 8 changed header files and binaries names which broke CMake scripts. OpenCV 4.4.0 and above support cuDNN 8.

1 Like

Yeah OCV 4.4.0 seems to be working well. Thanks