Open
Description
System Information
- Currently behaviour: when ENABLE_CUDA_FIRST_CLASS_LANGUAGE is OFF, the config requires to match the minor version. The cuda sdk actually have stable API for major version, we do not even need to depend on the minor version.
- when ENABLE_CUDA_FIRST_CLASS_LANGUAGE is ON, OpenCV_CUDA_VERSION even contain the patch version, which is totally wrong, because the patch version can change very fast, we definitely do not want to recompile the ocv again and again.
Detailed description
$ egrep 'set\(OpenCV_CUDA_VERSION' build/OpenCVConfig.cmake
set(OpenCV_CUDA_VERSION "12.3.107")
Steps to reproduce
cmake -B build -G Ninja \
-DWITH_IPP=OFF -DWITH_WEBP=OFF \
-DWITH_JASPER=OFF -DWITH_TIFF=OFF \
-DWITH_OPENJPEG=OFF -DWITH_OPENEXR=OFF \
-DENABLE_PIC=ON -DOPENCV_ENABLE_NONFREE=OFF \
-DWITH_CUDA=ON -DWITH_EIGEN=OFF \
-DWITH_GSTREAMER=OFF -DBUILD_opencv_python3=ON \
-DBUILD_opencv_python2=OFF -DWITH_1394=OFF \
-DWITH_PROTOBUF=OFF -DWITH_CAROTENE=OFF \
-DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF \
-DBUILD_opencv_apps=OFF -DBUILD_JAVA=OFF \
-DBUILD_opencv_dnn=OFF -DBUILD_opencv_gapi=OFF \
-DWITH_ADE=OFF \
-DOPENCV_EXTRA_MODULES_PATH="contrib/modules/cudev;contrib/modules/cudaarithm" \
-DOPENCV_CMAKE_CUDA_DEBUG=1 \
-DOPENCV_CUDA_DETECTION_NVCC_FLAGS=-allow-unsupported-compiler \
-DCUDA_NVCC_FLAGS=-allow-unsupported-compiler \
-DWITH_AVIF=OFF \
-DENABLE_CUDA_FIRST_CLASS_LANGUAGE=ON \
-DCMAKE_CUDA_ARCHITECTURES="61;75" \
-DBUILD_SHARED_LIBS=OFF
Issue submission checklist
- I report the issue, it's not a question
- I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
- I updated to the latest OpenCV version and the issue is still there
- There is reproducer code and related data files (videos, images, onnx, etc)