Hi, I am a beginner in OpenCV. I’m trying to add CUDA support to my OpenCV build following the tutorial given in this video:
The vid is a bit outdated, but I managed to build a library that “looks” alright with the following config:
Cmake 4.3.2 on Win 11
OpenCV 4.13.0
CUDA 12.8 (arch bin 8.9)
cuDNN 4.21.0
VS 17 2022
I prefer to use older versions since they are generally more stable and smaller.
The problem comes when I try to use the library. When I use the old cmakelist.txt from the non-cuda OpenCV build I have and change things up, the cmake configuration keeps throwing
CMake Error at E:/opencvCUDA/build/x64/vc17/lib/OpenCVConfig.cmake:86 (find_package):
By not providing “FindCUDA.cmake” in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by “CUDA”, but
CMake did not find one.
Could not find a package configuration file provided by “CUDA” (requested
version 12.8) with any of the following names:
CUDA.cps
cuda.cps
CUDAConfig.cmake
cuda-config.cmake
Add the installation prefix of “CUDA” to CMAKE_PREFIX_PATH or set
“CUDA_DIR” to a directory containing one of the above files. If “CUDA”
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
E:/opencvCUDA/build/x64/vc17/lib/OpenCVConfig.cmake:108 (find_host_package)
E:/opencvCUDA/build/OpenCVConfig.cmake:192 (include)
CMakeLists.txt:12 (find_package)
I tried figuring it out on my own and know it’s a legacy error since they removed find_package(CUDA) and replaced with enable_language(CUDA), but I’m not getting anywhere. Any help?