Unable to compile CUDA Version

Hello guys. I’m during 3 days trying to make opencv to work with CUDA.

I already have CUDA installed, cudnn etc.

What happens: After making all process described in some youtube videos, many and many times, with lots of versions of opencv, with visual studio 2019 and 2022, the last command which I should do is cmake --build “path” --target INSTALL --config Release.

In the example video, the code finishes as something as installing the library. Mine process finishes just with what I think is the end of compilation. So, when run conda, and import cv2: ModuleNotFoundError: No module named ‘cv2’

I have just one environiment. I’ve tryed to install manually, but it seems that some folders are missing in the build folder and it does not work. As I said, trying during three days to find a solution for this.

Second possibility: in this web page, Build OpenCV (including Python) with CUDA on Windows: Comprehensive Guide including Python Bindings, cuDNN, and Nvidia Video Codec SDK, I found what could be ready versions for cuda, for just download and install in my python (Releases · cudawarped/opencv-python-cuda-wheels · GitHub). NICE.

I have tryed so many versions of this repository and get this error:
FileNotFoundError: [Errno 2] No such file or directory: ‘C:\opencv-python-cuda-wheels-4.11.0.20250210\cv2\version.py’

File version.py, is not available.

Last chance: Trying to make all advices given in the first link (returning to the first link), about ninja compiler and other stuffs, but, did not get success yet.

Please, anyone can help me? can someone give a light? I’m close of give up.
Thanks.
BR.

Which versions of CUDA, OpenCV, cuDNN etc.? What does your CMake configuration output look like? Are you building from the command line, if so what are your CMake arguments?

Did OpenCV build correctly, have you tested it? See Verifying OpenCV is CUDA Accelerated.

When do you get this error, when installing with pip?

Have you tried using a fresh install of miniforge to eliminate existing python conflicts?

Hello.

My current Versions are:
Cuda:12.8
CuDNN: 9,7
Cmake 4.0.1
(considere here that, I have changed the version off all plataforms maybe 3 times, to reflect video example of youtube, downgrading my conda version also, replying all advices and no success)

I could not make it work from command line, unfortunettly (command did not work for me), but, regarding de video example here are the step by step, which is an easy way for me, and there are 3 examples of similar videos showing their success, but many people else in comments were no able to do this, as me.

1-Download opencv, and opencv_contrib (same version, in this case 4.9, for example) extract files to a folder, and make a build folder:
2- in Cmake, appoint the folders for opencv, and build, select Visual Studio 2022 (also already tested with 2019 and not success. Select X64 plataform.
3-Results of opencv:

I had to cut part of CMAKE’s log because ot limit of characters.

General configuration for OpenCV 4.9.0 =====================================
   Video I/O:
    DC1394:                      NO
    FFMPEG:                      YES (prebuilt binaries)
      avcodec:                   YES (58.134.100)
      avformat:                  YES (58.76.100)
      avutil:                    YES (56.70.100)
      swscale:                   YES (5.9.100)
      avresample:                YES (4.0.0)
    GStreamer:                   NO
    DirectShow:                  YES
    Media Foundation:            YES
      DXVA:                      YES

  Parallel framework:            Concurrency

  Trace:                         YES (with Intel ITT)

  Other third-party libraries:
    Intel IPP:                   2021.11.0 [2021.11.0]
           at:                   C:/opencv/build/3rdparty/ippicv/ippicv_win/icv
    Intel IPP IW:                sources (2021.11.0)
              at:                C:/opencv/build/3rdparty/ippicv/ippicv_win/iw
    Lapack:                      NO
    Eigen:                       NO
    Custom HAL:                  NO
    Protobuf:                    build (3.19.1)
    Flatbuffers:                 builtin/3rdparty (23.5.9)

  OpenCL:                        YES (NVD3D11)
    Include path:                C:/opencv/opencv-4.9.0/3rdparty/include/opencl/1.2
    Link libraries:              Dynamic load

  Python 3:
    Interpreter:                 C:/Users/SERVER/anaconda3/python.exe (ver 3.12.7)
    Libraries:                   C:/Users/SERVER/anaconda3/libs/python312.lib (ver 3.12.7)
    numpy:                       C:/Users/SERVER/anaconda3/Lib/site-packages/numpy/core/include (ver 1.26.4)
    install path:                C:/Users/SERVER/anaconda3/Lib/site-packages/cv2/python-3.12

  Python (for build):            C:/Users/SERVER/anaconda3/python.exe

  Install to:                    C:/opencv/build/install
-----------------------------------------------------------------

Configuring done (109.9s)

It seems to be everything ok.
4:Steps in cmake:
4.1: Enable WITH, WITH CUDA: CHECKED.
4.2: Enable ENABLE_FAST_MATH: CHECKED.
4.3: Enable: BUILD_opencv_world: CHECKED.
4.4: OPENCV_EXTRA_MODULOES_PATH (“C:/opencv/opencv_contrib-4.9.0/modules”): DONE.

5:Click configure. Results:

General configuration for OpenCV 4.9.0 =====================================
  Version control:               unknown

  Extra modules:
    Location (extra):            C:/opencv/opencv_contrib-4.9.0/modules
    Version control (extra):     unknown

  Platform:
    Timestamp:                   2025-04-25T15:12:06Z
    Host:                        Windows 10.0.19045 AMD64
    CMake:                       4.0.1
    CMake generator:             Visual Studio 17 2022
    CMake build tool:            C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/amd64/MSBuild.exe
    MSVC:                        1940
    Configuration:               Debug Release

  CPU/HW features:
    Baseline:                    SSE SSE2 SSE3
      requested:                 SSE3
    Dispatched code generation:  SSE4_1 SSE4_2 FP16 AVX AVX2 AVX512_SKX
      requested:                 SSE4_1 SSE4_2 AVX FP16 AVX2 AVX512_SKX
      SSE4_1 (18 files):         + SSSE3 SSE4_1
      SSE4_2 (2 files):          + SSSE3 SSE4_1 POPCNT SSE4_2
      FP16 (1 files):            + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 AVX
      AVX (9 files):             + SSSE3 SSE4_1 POPCNT SSE4_2 AVX
      AVX2 (38 files):           + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2
      AVX512_SKX (8 files):      + SSSE3 SSE4_1 POPCNT SSE4_2 FP16 FMA3 AVX AVX2 AVX_512F AVX512_COMMON AVX512_SKX

  C/C++:
    Built as dynamic libs?:      YES
    C++ standard:                11
    C++ Compiler:                C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe  (ver 19.40.33813.0)
    C++ flags (Release):         /DWIN32 /D_WINDOWS /W4 /GR  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi  /fp:fast     /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /wd4819 /MP  /O2 /Ob2 /DNDEBUG 
    C++ flags (Debug):           /DWIN32 /D_WINDOWS /W4 /GR  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi  /fp:fast     /EHa /wd4127 /wd4251 /wd4324 /wd4275 /wd4512 /wd4589 /wd4819 /MP  /Zi /Ob0 /Od /RTC1 
    C Compiler:                  C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe
    C flags (Release):           /DWIN32 /D_WINDOWS /W3  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi  /fp:fast     /MP   /O2 /Ob2 /DNDEBUG 
    C flags (Debug):             /DWIN32 /D_WINDOWS /W3  /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _SCL_SECURE_NO_WARNINGS /Gy /bigobj /Oi  /fp:fast     /MP /Zi /Ob0 /Od /RTC1 
    Linker flags (Release):      /machine:x64  /INCREMENTAL:NO 
    Linker flags (Debug):        /machine:x64  /debug /INCREMENTAL 
    ccache:                      NO
    Precompiled headers:         NO
    Extra dependencies:          cudart_static.lib nppc.lib nppial.lib nppicc.lib nppidei.lib nppif.lib nppig.lib nppim.lib nppist.lib nppisu.lib nppitc.lib npps.lib cublas.lib cudnn.lib cufft.lib -LIBPATH:C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.8/lib/x64
    3rdparty dependencies:

  OpenCV modules:
    To be built:                 aruco bgsegm bioinspired calib3d ccalib core cudaarithm cudabgsegm cudacodec cudafeatures2d cudafilters cudaimgproc cudalegacy cudaobjdetect cudaoptflow cudastereo cudawarping cudev datasets dnn dnn_objdetect dnn_superres dpm face features2d flann fuzzy gapi hfs highgui img_hash imgcodecs imgproc intensity_transform line_descriptor mcc ml objdetect optflow phase_unwrapping photo plot python3 quality rapid reg rgbd saliency shape stereo stitching structured_light superres surface_matching text tracking ts video videoio videostab wechat_qrcode world xfeatures2d ximgproc xobjdetect xphoto
    Disabled:                    -
    Disabled by dependency:      -
    Unavailable:                 alphamat cannops cvv freetype hdf java julia matlab ovis python2 python2 sfm viz
    Applications:                tests perf_tests apps
    Documentation:               NO
    Non-free algorithms:         NO

  Windows RT support:            NO

  GUI: 
    Win32 UI:                    YES
    VTK support:                 NO

  Media I/O: 
    ZLib:                        build (ver 1.3)
    JPEG:                        build-libjpeg-turbo (ver 2.1.3-62)
      SIMD Support Request:      YES
      SIMD Support:              NO
    WEBP:                        build (ver encoder: 0x020f)
    PNG:                         build (ver 1.6.37)
    TIFF:                        build (ver 42 - 4.2.0)
    JPEG 2000:                   build (ver 2.5.0)
    OpenEXR:                     build (ver 2.3.0)
    HDR:                         YES
    SUNRASTER:                   YES
    PXM:                         YES
    PFM:                         YES

  Video I/O:
    DC1394:                      NO
    FFMPEG:                      YES (prebuilt binaries)
      avcodec:                   YES (58.134.100)
      avformat:                  YES (58.76.100)
      avutil:                    YES (56.70.100)
      swscale:                   YES (5.9.100)
      avresample:                YES (4.0.0)
    GStreamer:                   NO
    DirectShow:                  YES
    Media Foundation:            YES
      DXVA:                      YES

  Parallel framework:            Concurrency

  Trace:                         YES (with Intel ITT)

  Other third-party libraries:
    Intel IPP:                   2021.11.0 [2021.11.0]
           at:                   C:/opencv/build/3rdparty/ippicv/ippicv_win/icv
    Intel IPP IW:                sources (2021.11.0)
              at:                C:/opencv/build/3rdparty/ippicv/ippicv_win/iw
    Lapack:                      NO
    Eigen:                       NO
    Custom HAL:                  NO
    Protobuf:                    build (3.19.1)
    Flatbuffers:                 builtin/3rdparty (23.5.9)

  NVIDIA CUDA:                   YES (ver 12.8, CUFFT CUBLAS)
    NVIDIA GPU arch:             50 52 60 61 70 75 80 86 89 90
    NVIDIA PTX archs:            90

  cuDNN:                         YES (ver 9.7.0)

  OpenCL:                        YES (NVD3D11)
    Include path:                C:/opencv/opencv-4.9.0/3rdparty/include/opencl/1.2
    Link libraries:              Dynamic load

  Python 3:
    Interpreter:                 C:/Users/SERVER/anaconda3/python.exe (ver 3.12.7)
    Libraries:                   C:/Users/SERVER/anaconda3/libs/python312.lib (ver 3.12.7)
    numpy:                       C:/Users/SERVER/anaconda3/Lib/site-packages/numpy/core/include (ver 1.26.4)
    install path:                C:/Users/SERVER/anaconda3/Lib/site-packages/cv2/python-3.12

  Python (for build):            C:/Users/SERVER/anaconda3/python.exe

  Install to:                    C:/opencv/build/install
-----------------------------------------------------------------

Configuring done (87.4s)

6: Enable CUDA_FAST_MATH: CHECKED.
7: CUDA_ARCH_BIN: 8.6
8: CMAKE_CONFIGURATION_TYPES: Release

Click Configure again, below the results:

  GUI: 
    Win32 UI:                    YES
    VTK support:                 NO

  Media I/O: 
    ZLib:                        build (ver 1.3)
    JPEG:                        build-libjpeg-turbo (ver 2.1.3-62)
      SIMD Support Request:      YES
      SIMD Support:              NO
    WEBP:                        build (ver encoder: 0x020f)
    PNG:                         build (ver 1.6.37)
    TIFF:                        build (ver 42 - 4.2.0)
    JPEG 2000:                   build (ver 2.5.0)
    OpenEXR:                     build (ver 2.3.0)
    HDR:                         YES
    SUNRASTER:                   YES
    PXM:                         YES
    PFM:                         YES

  Video I/O:
    DC1394:                      NO
    FFMPEG:                      YES (prebuilt binaries)
      avcodec:                   YES (58.134.100)
      avformat:                  YES (58.76.100)
      avutil:                    YES (56.70.100)
      swscale:                   YES (5.9.100)
      avresample:                YES (4.0.0)
    GStreamer:                   NO
    DirectShow:                  YES
    Media Foundation:            YES
      DXVA:                      YES

  Parallel framework:            Concurrency

  Trace:                         YES (with Intel ITT)

  Other third-party libraries:
    Intel IPP:                   2021.11.0 [2021.11.0]
           at:                   C:/opencv/build/3rdparty/ippicv/ippicv_win/icv
    Intel IPP IW:                sources (2021.11.0)
              at:                C:/opencv/build/3rdparty/ippicv/ippicv_win/iw
    Lapack:                      NO
    Eigen:                       NO
    Custom HAL:                  NO
    Protobuf:                    build (3.19.1)
    Flatbuffers:                 builtin/3rdparty (23.5.9)

  NVIDIA CUDA:                   YES (ver 12.8, CUFFT CUBLAS FAST_MATH)
    NVIDIA GPU arch:             86
    NVIDIA PTX archs:            90

  cuDNN:                         YES (ver 9.7.0)

  OpenCL:                        YES (NVD3D11)
    Include path:                C:/opencv/opencv-4.9.0/3rdparty/include/opencl/1.2
    Link libraries:              Dynamic load

  Python 3:
    Interpreter:                 C:/Users/SERVER/anaconda3/python.exe (ver 3.12.7)
    Libraries:                   C:/Users/SERVER/anaconda3/libs/python312.lib (ver 3.12.7)
    numpy:                       C:/Users/SERVER/anaconda3/Lib/site-packages/numpy/core/include (ver 1.26.4)
    install path:                C:/Users/SERVER/anaconda3/Lib/site-packages/cv2/python-3.12

  Python (for build):            C:/Users/SERVER/anaconda3/python.exe

  Install to:                    C:/opencv/build/install
-----------------------------------------------------------------

Configuring done (27.1s)

Click GENERATE, results below:

  GUI: 
    Win32 UI:                    YES
    VTK support:                 NO

  Media I/O: 
    ZLib:                        build (ver 1.3)
    JPEG:                        build-libjpeg-turbo (ver 2.1.3-62)
      SIMD Support Request:      YES
      SIMD Support:              NO
    WEBP:                        build (ver encoder: 0x020f)
    PNG:                         build (ver 1.6.37)
    TIFF:                        build (ver 42 - 4.2.0)
    JPEG 2000:                   build (ver 2.5.0)
    OpenEXR:                     build (ver 2.3.0)
    HDR:                         YES
    SUNRASTER:                   YES
    PXM:                         YES
    PFM:                         YES

  Video I/O:
    DC1394:                      NO
    FFMPEG:                      YES (prebuilt binaries)
      avcodec:                   YES (58.134.100)
      avformat:                  YES (58.76.100)
      avutil:                    YES (56.70.100)
      swscale:                   YES (5.9.100)
      avresample:                YES (4.0.0)
    GStreamer:                   NO
    DirectShow:                  YES
    Media Foundation:            YES
      DXVA:                      YES

  Parallel framework:            Concurrency

  Trace:                         YES (with Intel ITT)

  Other third-party libraries:
    Intel IPP:                   2021.11.0 [2021.11.0]
           at:                   C:/opencv/build/3rdparty/ippicv/ippicv_win/icv
    Intel IPP IW:                sources (2021.11.0)
              at:                C:/opencv/build/3rdparty/ippicv/ippicv_win/iw
    Lapack:                      NO
    Eigen:                       NO
    Custom HAL:                  NO
    Protobuf:                    build (3.19.1)
    Flatbuffers:                 builtin/3rdparty (23.5.9)

  NVIDIA CUDA:                   YES (ver 12.8, CUFFT CUBLAS FAST_MATH)
    NVIDIA GPU arch:             86
    NVIDIA PTX archs:            90

  cuDNN:                         YES (ver 9.7.0)

  OpenCL:                        YES (NVD3D11)
    Include path:                C:/opencv/opencv-4.9.0/3rdparty/include/opencl/1.2
    Link libraries:              Dynamic load

  Python 3:
    Interpreter:                 C:/Users/SERVER/anaconda3/python.exe (ver 3.12.7)
    Libraries:                   C:/Users/SERVER/anaconda3/libs/python312.lib (ver 3.12.7)
    numpy:                       C:/Users/SERVER/anaconda3/Lib/site-packages/numpy/core/include (ver 1.26.4)
    install path:                C:/Users/SERVER/anaconda3/Lib/site-packages/cv2/python-3.12

  Python (for build):            C:/Users/SERVER/anaconda3/python.exe

  Java:                          
    ant:                         NO
    Java:                        YES (ver 17.0.12)
    JNI:                         C:/Program Files/Java/jdk-17/include C:/Program Files/Java/jdk-17/include/win32 C:/Program Files/Java/jdk-17/include
    Java wrappers:               NO
    Java tests:                  NO

  Install to:                    C:/opencv/build/install
-----------------------------------------------------------------

Configuring done (27.1s)
Generating done (21.9s)

In Anaconda Promp, run the command: “cmake --build “C:/opencv/build” target INSTALL --config Release”
The prompt finishes this way:

When I look the video example, I saw in his terminal the lines: "Installing: ", as probably part of the command cmake --build install.

So, after of that, typing import cv2 in my conda env(I have just one env), I got the result:

import cv2
Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘cv2’

Tryed to install manually, I got the result:
C:\Users\SERVER>pip install “C:\opencv\build”
ERROR: Directory ‘C:\opencv\build’ is not installable. Neither ‘setup.py’ nor ‘pyproject.toml’ found.

As I said, I’ve tryed with a lots of versions of cuda, and opencv packages.

About the miniforge: I was trying to install directly on python, but with miniforge, got the same problem “FileNotFoundError: [Errno 2] No such file or directory: ‘C:\opencv-python-cuda-wheels-4.11.0.20250210\cv2\version.py’”:

Thanks for your kind support. It would be nice to me make this working and it has been a great challenge until now.

BR.

First ignore all the youtube video’s

Please elabourate?

4.9 won’t work with CUDA 12.8 are you sure you built OpenCV, see my earlier comment regarding testing. For 12.8 you need to use the latest commits from both branches. The python bindings won’t be installed if OpenCV didn’t build.

When did you receive this error?

1 Like

Hello again:

Let’s go: full day working on this. Took a new SSD, and made a fresh installation of windows (mine was win 10, I put win 11 now), setup is:

Win 11, full updated.
Python: 3.12.7
CUDA: 12.8
CuDNN: 9.8
Visual Studio: 2022
Open CV and contrib: 4.11
Cmake 4.0.1

I build the code: set CMAKE_BUILD_PARALLEL_LEVEL=4 "C:\Program Files\CMake\bin\cmake.exe" -H"C:\opencv\opencv-4.11.0" -DOPENCV_EXTRA_MODULES_PATH="C:\opencv\opencv_contrib-4.11.0\modules" -B"C:\opencv\build" -G"Visual Studio 17 2022" -DINSTALL_TESTS=ON -DINSTALL_C_EXAMPLES=ON -DBUILD_EXAMPLES=ON -DBUILD_opencv_world=ON -DENABLE_CUDA_FIRST_CLASS_LANGUAGE=ON -DWITH_CUDA=ON -DCUDA_GENERATION=Auto -DBUILD_opencv_python3=ON -DPYTHON3_INCLUDE_DIR=C:\Users\SERVER\anaconda3\include -DPYTHON3_LIBRARY=C:\Users\SERVER\anaconda3\libs\python312.lib -DPYTHON3_EXECUTABLE=C:\Users\SERVER\anaconda3\python.exe -DPYTHON3_NUMPY_INCLUDE_DIRS=C:\Users\SERVER\anaconda3\lib\site-packages\numpy\core\include -DPYTHON3_PACKAGES_PATH=C:\Users\SERVER\anaconda3\Lib\site-packages\

The process has started and finished with the following error:

  Syntax error in cmake code at

    C:/opencv/opencv-4.11.0/cmake/OpenCVUtils.cmake:1495

  when parsing string

    PRIVATE;C:\Users\SERVER\anaconda3\libs\python312.lib

  Invalid character escape '\U'.
Call Stack (most recent call first):
  cmake/OpenCVUtils.cmake:1525 (__ocv_push_target_link_libraries)
  modules/python/common.cmake:65 (ocv_target_link_libraries)
  modules/python/python3/CMakeLists.txt:11 (include)

-- Configuring incomplete, errors occurred!

The second option: changing the directory of python3, to miniforge3, as below:

set CMAKE_BUILD_PARALLEL_LEVEL=4
"C:\Program Files\CMake\bin\cmake.exe" -H"C:\opencv\opencv-4.11.0" -DOPENCV_EXTRA_MODULES_PATH="C:\opencv\opencv_contrib-4.11.0\modules" -B"C:\opencv\build" -G"Visual Studio 17 2022" -DINSTALL_TESTS=ON -DINSTALL_C_EXAMPLES=ON -DBUILD_EXAMPLES=ON -DBUILD_opencv_world=ON -DENABLE_CUDA_FIRST_CLASS_LANGUAGE=ON -DWITH_CUDA=ON -DCUDA_GENERATION=Auto -DBUILD_opencv_python3=ON -DPYTHON3_INCLUDE_DIR=C:\Users\SERVER\miniforge3\include -DPYTHON3_LIBRARY=C:\Users\SERVER\miniforge3\libs\python312.lib -DPYTHON3_EXECUTABLE=C:\Users\SERVER\miniforge3\python.exe -DPYTHON3_NUMPY_INCLUDE_DIRS=C:\Users\SERVER\miniforge3\lib\site-packages\numpy\core\include -DPYTHON3_PACKAGES_PATH=C:\Users\SERVER\miniforge3\Lib\site-packages\

I got the same result:

CMake Error at cmake/OpenCVUtils.cmake:1495 (target_link_libraries):
  Syntax error in cmake code at

    C:/opencv/opencv-4.11.0/cmake/OpenCVUtils.cmake:1495

  when parsing string

    PRIVATE;C:\Users\SERVER\miniforge3\libs\python312.lib

  Invalid character escape '\U'.
Call Stack (most recent call first):
  cmake/OpenCVUtils.cmake:1525 (__ocv_push_target_link_libraries)
  modules/python/common.cmake:65 (ocv_target_link_libraries)
  modules/python/python3/CMakeLists.txt:11 (include)

-- Configuring incomplete, errors occurred!

About the last question: open python cuda wheels, I downloaded the version 4.11.0.20250210, put in a folder, and the result is this:

I appreciate so much your support. It is very important to me, make this happen.
I’m open to go through the way you suggest.
Thanks and best regards.

I’m not sure exactly what you are doing but you need to download the wheel opencv_contrib_python_rolling-4.12.0.86-cp37-abi3-win_amd64.whl from

and then call pip install opencv_contrib_python_rolling-4.12.0.86-cp37-abi3-win_amd64.whl

You need to use forward slashes (/) in the python paths. Try the below after deleting your build directory

set CMAKE_BUILD_PARALLEL_LEVEL=4
"C:\Program Files\CMake\bin\cmake.exe" -H"C:\opencv\opencv-4.11.0" -DOPENCV_EXTRA_MODULES_PATH="C:\opencv\opencv_contrib-4.11.0\modules" -B"C:\opencv\build" -G"Visual Studio 17 2022" -DINSTALL_TESTS=ON -DINSTALL_C_EXAMPLES=ON -DBUILD_EXAMPLES=ON -DBUILD_opencv_world=ON -DENABLE_CUDA_FIRST_CLASS_LANGUAGE=ON -DWITH_CUDA=ON -DCUDA_GENERATION=Auto -DBUILD_opencv_python3=ON -DPYTHON3_INCLUDE_DIR=C:/Users/SERVER/miniforge3/include -DPYTHON3_LIBRARY=C:/Users/SERVER/miniforge3/libs/python312.lib -DPYTHON3_EXECUTABLE=C:/Users/SERVER/miniforge3/python.exe -DPYTHON3_NUMPY_INCLUDE_DIRS=C:/Users/SERVER/miniforge3/lib/site-packages/numpy/core/include -DPYTHON3_PACKAGES_PATH=C:/Users/SERVER/miniforge3/Lib/site-packages/

Note: You need to use the latest commits from both the 4.x branches (opencv and opencv_contrib) if you want to build against CUDA 12.8.

Hello James.

In fact, I’m a novice. More curioss than an expert on this subjetct, but trying to to things to work. I thank so much your support. 5 minuts after your answer, I already was here, trying to solve, considerations:

About Wheel: I was doing the wrong way, trying to install the files in the .zip contenct, not the .whl file, as you wrote. By this way, I could install the package easily: THANKS A LOT.

About the cmake code: Again, the novice. I saw the “/” and "". I though I should replace for the command pattern. Here the code worked. Very nice, thanks again.

However, about the BUILD, in visual studio, I have tryed twice and getting some errors in the end of process, as image below:

Question here: Is there any advantage for me using a compiled version against the WHL file? Performance is an important point for me. WHL would make my code more “slow”, than the my build version, or results are the same?

Is there an easy way to correct the build process, or should I forget this and work with the WHL solution?

Thanks, and again, Best regards.