Hello all!
I am attempting to compile OpenCV with CUDA and CuDNN for a research project I’m working on. Technical details:
OpenCV 4.2
CUDA 11.6
CuDNN 8
Ubuntu 18.04
GeForce RTX 2060 Graphics Card
Here’s the situation:
I’ve successfully installed CUDA and CuDNN on my computer, and can locate both using “whereis”. Navigating to my OpenCV build folder, I attempt to compile it with cmake via the command:
cmake -D CMAKE_BUILD_TYPE=RELEASE
-D CMAKE_INSTALL_PREFIX=/usr/local
-D INSTALL_PYTHON_EXAMPLES=OFF
-D INSTALL_C_EXAMPLES=OFF
-D OPENCV_ENABLE_NONFREE=ON
-D WITH_CUDA=ON
-D WITH_CUDNN=ON
-D OPENCV_DNN_CUDA=ON
-D CUDNN_LIBRARY=/usr/lib/x86_64-linux-gnu/
-D CUDNN_INCLUDE_DIR=/usr/include/
-D ENABLE_FAST_MATH=1
-D CUDA_FAST_MATH=1
-D CUDA_ARCH_BIN=7.5
-D WITH_CUBLAS=1
-D OPENCV_EXTRA_MODULES_PATH=~/opencv/opencv_contrib/modules/
-D HAVE_opencv_python3=ON
-D PYTHON_EXECUTABLE=~/.virtualenvs/opencv_cuda/bin/python
-D BUILD_EXAMPLES=OFF …
When I do this, OpenCV compiles and recognizes CUDA, but try as I might I can’t get it to recognize CuDNN:
Any suggestions as to what I’m doing wrong?