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/libcudnn.so" \
-DCUDNN_INCLUDE_DIR="$(pwd)/../../usr/local/cuda/include/cudnn.h" \

Outputs are below;

You can see CMake command below;

    cmake -D CMAKE_BUILD_TYPE=RELEASE \
            -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_ENABLE_NONFREE=ON \
            -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 

Output;

CUDNN_MAJOR 8
CUDNN_MINOR 0
CUDNN_PATCHLEVEL 0

Hi,

Could you try this script: install_opencv4.5.0_Jetson.sh (1.9 KB)

$ sudo chmod +x install_opencv4.5.0_Jetson.sh
$ ./install_opencv4.5.0_Jetson.sh 

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

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

Hi,

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

Thanks.

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

‘/usr/include/aarch64-linux-gnu/cudnn_version_v8.h’

directory.

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

Hi,

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

Thanks.

No, it’s not

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

Hi,

It seems that you already find in in this comment:

For Jetson 4.5, include path is /usr/include/ and the library path is /usr/lib/aarch64-linux-gnu/.

Thanks.

Hi,

if the solution is still needed, try to include:

-D CUDNN_VERSION=‘8.0’

regards
Milan

Yes, solution still needed and thanks for suggestion. I will reply again after we tried CUDNN_VERSION flag. But it should automatically detect the version on system.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.