OpenCV Building with CUDA CUDNN - No CUDNN

I am currently working with NVIDIA Xavier 8GB. NVIDIA does not present latest compiled OpenCV version. Thus I need to compile OpenCV with CUDNN flag.

Tried to build both OpenCV 4.2.0 and 4.5.0 but 4.2 does not support CUDNN and 4.5.0 does not see CUDNN dependencies. Also tried cmake with gui and still same result.

Also specified CUDNN path with flags below (not worked):

-DCUDNN_LIBRARY="$(pwd)/../../usr/local/cuda/lib64/" \
-DCUDNN_INCLUDE_DIR="$(pwd)/../../usr/local/cuda/include/cudnn.h" \

Outputs are below;

You can see CMake command below;

            -D WITH_CUDA=ON \
            -D CUDA_ARCH_PTX="" \
            -D CUDA_ARCH_BIN="5.3,6.2,7.2" \
            -D WITH_CUBLAS=ON \
            -D WITH_CUDNN=ON \	
            -D WITH_LIBV4L=ON \
            -D ENABLE_FAST_MATH=ON \
            -D CUDA_FAST_MATH=ON \
            -D OPENCV_DNN_CUDA=ON \
            -D ENABLE_NEON=ON \
            -D WITH_QT=OFF \
            -D WITH_OPENMP=ON \
            -D WITH_OPENGL=ON \
            -D WITH_FFMPEG=ON \
            -D WITH_GSTREAMER=ON \
            -D WITH_TBB=ON \
            -D BUILD_TBB=ON \
            -D BUILD_TESTS=OFF \
            -D BUILD_opencv_python3=ON \
            -D BUILD_opencv_python2=OFF \
            -D BUILD_opencv_java=OFF \
            -D WITH_GTK=ON \
            -D BUILD_TESTS=OFF \
            -D BUILD_PERF_TESTS=OFF \
            -D BUILD_EXAMPLES=OFF \
            -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-4.5.0/modules ..

Other Specifications;

  • NVIDIA Xavier 8GB
  • Ubuntu 18.04 - Official NVIDIA Image
  • OpenCV 4.2.0 and 4.5.0

Also, How we can use JetPack to upgrade CUDNN? Downloaded from official nvidia jetpack but there is only AMD64 version which is Xavier ARM64 causes the failed dpkg installation.

Thanks for all support.

What Jetpack/cuDNN version is running?

-- Could NOT find CUDNN: Found unsuitable version "..", but required is at least "7.5"

and you can find cuDNN library at /nvidia/sdkm_downloads/ of host PC.
(after installation your Jetson Xavier with SDK manager)

We have CUDNN 8.0.0 according to command below;

cat /usr/local/cuda/include/cudnn.h 




Could you try this script: (1.9 KB)

$ sudo chmod +x
$ ./ 

We can compile OpenCV-4.5.0 with cuDNN on JetPack4.5.1+Xavier 8GB.

Thanks for the script but result is still same. Automatic off (No CUDNN) while compile of OpenCV.


Which JetPack version do you use?
In general, cmake will get the cuDNN version in /usr/include/aarch64-linux-gnu/cudnn_version_v8.h.


For JetPack version, is there any where to learn it. I get a result there is no way to learn it as mentioned on How to check the JetPack Version

Also, i flashed JetPack 4.5.1 in Xavier by using the software in Nvidia website.

The CuDNN version is 8.0.0 by get to following



Are you using docker to build ?
If so , you need to specify NVIDA runtime to build.


So please update the -DCUDNN_LIBRARY and -DCUDNN_INCLUDE_DIR to the corresponding path.
cuDNN doesn’t integrated into CUDA folder anymore.


No, it’s not

That is good to hear but how we can find the corresponding path?