# OpenCV build with CUDA backend on Windows 10 error

**URL:** <https://forum.opencv.org/t/opencv-build-with-cuda-backend-on-windows-10-error/12049>\
**Category:** Uncategorized\
**Tags:** build, cuda\
**Created:** [February 19, 2023, 7:32pm UTC](https://forum.opencv.org/t/opencv-build-with-cuda-backend-on-windows-10-error/12049 "2023-02-19T19:32:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Verneinender\_Luz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/verneinender_luz/32/7215_2.png) [@Verneinender\_Luz](https://forum.opencv.org/u/Verneinender_Luz)\
**Post date:** [February 19, 2023, 7:32pm UTC](https://forum.opencv.org/t/opencv-build-with-cuda-backend-on-windows-10-error/12049/1 "2023-02-19T19:32:44Z")

</div>

Hi everyone,

in the last few days, I have been trying to build OpenCV with CUDA and CUDNN. But I have met some errors that I cannot handle.  
Here is the build information:  
System: Windows 10, anaconda 3,  
OpenCV 4.6.0 with OpenCV contrib-4.6.0,  
Microsoft Visual Studio 2022,  
CUDA v11.8,  
CUDNN v8.6.0.

I follow the tutorial: [Anaconda3 — OpenCV with CUDA GPU support for Windows 10](https://jordanbenge.medium.com/anaconda3-opencv-with-cuda-gpu-support-for-windows-10-e038569e228)

And this is my bat file:

**configure\_and\_build\_opencv.bat**

```auto
ECHO -- Starting OpenCV Configuration --
ECHO ---- Opening Visual Studio builder ----
call "F:/MSVC 2022/VC/Auxiliary/Build/vcvars64.bat"
ECHO ---- Setting up environment variables ----
call set_env_paths.bat
ECHO ---- Running CMake Commands ----
call "F:/CMake/bin/cmake.exe" -B"%openCvBuild%/" -H"%openCvSource%/" -G"%generator%" -DCMAKE_BUILD_TYPE=%buildType% -DOPENCV_EXTRA_MODULES_PATH="%openCVExtraModules%/" ^
-DINSTALL_TESTS=ON -DINSTALL_C_EXAMPLES=ON -DBUILD_EXAMPLES=ON ^
-DBUILD_opencv_world=ON ^
-DWITH_CUDA=ON -DCUDA_TOOLKIT_ROOT_DIR="%toolkitRoot%" -DCUDA_FAST_MATH=ON -DWITH_CUBLAS=ON -DCUDA_ARCH_BIN=8.6 -DWITH_NVCUVID=ON ^
-DWITH_OPENGL=ON -DENABLE_FAST_MATH=ON ^
-DWITH_MFX=ON ^
-DBUILD_opencv_python3=ON -DPYTHON3_INCLUDE_DIR=%pathToAnaconda%/include -DPYTHON3_LIBRARY=%pathToAnaconda%/libs/python%pyVer%.lib -DPYTHON3_EXECUTABLE=%pathToAnaconda%/python.exe -DPYTHON3_NUMPY_INCLUDE_DIRS=%pathToAnaconda%/lib/site-packages/numpy/core/include -DPYTHON3_PACKAGES_PATH=%pathToAnaconda%/Lib/site-packages/ -DOPENCV_SKIP_PYTHON_LOADER=ON
ECHO -- OpenCV Configuration has finished, proceeding to build phase --
call "F:\CMake\bin\cmake.exe" --build %openCvBuild% --target install
:End
PAUSE

```

Here is the configurating and building log.

```auto
--
-- Configuring done (37.4s)
-- Generating done (14.6s)

[472/3621] Building NVCC (Device) object modules/world/CMa...arithm/src/cuda/cuda_compile_1_generated_minmax_mat.cu.obj
FAILED: modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_minmax_mat.cu.obj F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_minmax_mat.cu.obj
cmd.exe /C "cd /D F:\opencv\opencv-4.6.0\build\modules\world\CMakeFiles\cuda_compile_1.dir\ __\__ \ __\opencv_contrib-4.6.0\modules\cudaarithm\src\cuda && F:\CMake\bin\cmake.exe -E make_directory F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/. && F:\CMake\bin\cmake.exe -D verbose:BOOL=OFF -D build_configuration:STRING=Release -D generated_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_minmax_mat.cu.obj -D generated_cubin_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_minmax_mat.cu.obj.cubin.txt -P F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_minmax_mat.cu.obj.Release.cmake"
CMake Error at cuda_compile_1_generated_minmax_mat.cu.obj.Release.cmake:220 (message):
  Error generating
  F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_minmax_mat.cu.obj

[473/3621] Building NVCC (Device) object modules/world/CMa...s/cudaarithm/src/cuda/cuda_compile_1_generated_math.cu.obj
FAILED: modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_math.cu.obj F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_math.cu.obj
cmd.exe /C "cd /D F:\opencv\opencv-4.6.0\build\modules\world\CMakeFiles\cuda_compile_1.dir\ __\__ \ __\opencv_contrib-4.6.0\modules\cudaarithm\src\cuda && F:\CMake\bin\cmake.exe -E make_directory F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/. && F:\CMake\bin\cmake.exe -D verbose:BOOL=OFF -D build_configuration:STRING=Release -D generated_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_math.cu.obj -D generated_cubin_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_math.cu.obj.cubin.txt -P F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_math.cu.obj.Release.cmake"
CMake Error at cuda_compile_1_generated_math.cu.obj.Release.cmake:220 (message):
  Error generating
  F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_math.cu.obj

[474/3621] Building NVCC (Device) object modules/world/CMa...arithm/src/cuda/cuda_compile_1_generated_sub_scalar.cu.obj
FAILED: modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_sub_scalar.cu.obj F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_sub_scalar.cu.obj
cmd.exe /C "cd /D F:\opencv\opencv-4.6.0\build\modules\world\CMakeFiles\cuda_compile_1.dir\ __\__ \ __\opencv_contrib-4.6.0\modules\cudaarithm\src\cuda && F:\CMake\bin\cmake.exe -E make_directory F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/. && F:\CMake\bin\cmake.exe -D verbose:BOOL=OFF -D build_configuration:STRING=Release -D generated_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_sub_scalar.cu.obj -D generated_cubin_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_sub_scalar.cu.obj.cubin.txt -P F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_sub_scalar.cu.obj.Release.cmake"
CMake Error at cuda_compile_1_generated_sub_scalar.cu.obj.Release.cmake:220 (message):
  Error generating
  F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_sub_scalar.cu.obj

[475/3621] Building NVCC (Device) object modules/world/CMa...udaarithm/src/cuda/cuda_compile_1_generated_mul_mat.cu.obj
FAILED: modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_mul_mat.cu.obj F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_mul_mat.cu.obj
cmd.exe /C "cd /D F:\opencv\opencv-4.6.0\build\modules\world\CMakeFiles\cuda_compile_1.dir\ __\__ \ __\opencv_contrib-4.6.0\modules\cudaarithm\src\cuda && F:\CMake\bin\cmake.exe -E make_directory F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/. && F:\CMake\bin\cmake.exe -D verbose:BOOL=OFF -D build_configuration:STRING=Release -D generated_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_mul_mat.cu.obj -D generated_cubin_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_mul_mat.cu.obj.cubin.txt -P F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_mul_mat.cu.obj.Release.cmake"
CMake Error at cuda_compile_1_generated_mul_mat.cu.obj.Release.cmake:220 (message):
  Error generating
  F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_mul_mat.cu.obj

[476/3621] Building NVCC (Device) object modules/world/CMa...cudaarithm/src/cuda/cuda_compile_1_generated_minmax.cu.obj
FAILED: modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_minmax.cu.obj F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_minmax.cu.obj
cmd.exe /C "cd /D F:\opencv\opencv-4.6.0\build\modules\world\CMakeFiles\cuda_compile_1.dir\ __\__ \ __\opencv_contrib-4.6.0\modules\cudaarithm\src\cuda && F:\CMake\bin\cmake.exe -E make_directory F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/. && F:\CMake\bin\cmake.exe -D verbose:BOOL=OFF -D build_configuration:STRING=Release -D generated_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_minmax.cu.obj -D generated_cubin_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_minmax.cu.obj.cubin.txt -P F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_minmax.cu.obj.Release.cmake"
CMake Error at cuda_compile_1_generated_minmax.cu.obj.Release.cmake:220 (message):
  Error generating
  F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_minmax.cu.obj

[477/3621] Building NVCC (Device) object modules/world/CMa...aarithm/src/cuda/cuda_compile_1_generated_minmaxloc.cu.obj
FAILED: modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_minmaxloc.cu.obj F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_minmaxloc.cu.obj
cmd.exe /C "cd /D F:\opencv\opencv-4.6.0\build\modules\world\CMakeFiles\cuda_compile_1.dir\ __\__ \ __\opencv_contrib-4.6.0\modules\cudaarithm\src\cuda && F:\CMake\bin\cmake.exe -E make_directory F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/. && F:\CMake\bin\cmake.exe -D verbose:BOOL=OFF -D build_configuration:STRING=Release -D generated_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_minmaxloc.cu.obj -D generated_cubin_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_minmaxloc.cu.obj.cubin.txt -P F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_minmaxloc.cu.obj.Release.cmake"
CMake Error at cuda_compile_1_generated_minmaxloc.cu.obj.Release.cmake:220 (message):
  Error generating
  F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_minmaxloc.cu.obj

[478/3621] Building NVCC (Device) object modules/world/CMa...aarithm/src/cuda/cuda_compile_1_generated_normalize.cu.obj
FAILED: modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_normalize.cu.obj F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_normalize.cu.obj
cmd.exe /C "cd /D F:\opencv\opencv-4.6.0\build\modules\world\CMakeFiles\cuda_compile_1.dir\ __\__ \ __\opencv_contrib-4.6.0\modules\cudaarithm\src\cuda && F:\CMake\bin\cmake.exe -E make_directory F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/. && F:\CMake\bin\cmake.exe -D verbose:BOOL=OFF -D build_configuration:STRING=Release -D generated_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_normalize.cu.obj -D generated_cubin_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_normalize.cu.obj.cubin.txt -P F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_normalize.cu.obj.Release.cmake"
CMake Error at cuda_compile_1_generated_normalize.cu.obj.Release.cmake:220 (message):
  Error generating
  F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_normalize.cu.obj

[479/3621] Building NVCC (Device) object modules/world/CMa...thm/src/cuda/cuda_compile_1_generated_mul_spectrums.cu.obj
FAILED: modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_mul_spectrums.cu.obj F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_mul_spectrums.cu.obj
cmd.exe /C "cd /D F:\opencv\opencv-4.6.0\build\modules\world\CMakeFiles\cuda_compile_1.dir\ __\__ \ __\opencv_contrib-4.6.0\modules\cudaarithm\src\cuda && F:\CMake\bin\cmake.exe -E make_directory F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/. && F:\CMake\bin\cmake.exe -D verbose:BOOL=OFF -D build_configuration:STRING=Release -D generated_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_mul_spectrums.cu.obj -D generated_cubin_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_mul_spectrums.cu.obj.cubin.txt -P F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_mul_spectrums.cu.obj.Release.cmake"
CMake Error at cuda_compile_1_generated_mul_spectrums.cu.obj.Release.cmake:220 (message):
  Error generating
  F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_mul_spectrums.cu.obj

[480/3621] Building NVCC (Device) object modules/world/CMa...cudaarithm/src/cuda/cuda_compile_1_generated_reduce.cu.obj
FAILED: modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_reduce.cu.obj F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_reduce.cu.obj
cmd.exe /C "cd /D F:\opencv\opencv-4.6.0\build\modules\world\CMakeFiles\cuda_compile_1.dir\ __\__ \ __\opencv_contrib-4.6.0\modules\cudaarithm\src\cuda && F:\CMake\bin\cmake.exe -E make_directory F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/. && F:\CMake\bin\cmake.exe -D verbose:BOOL=OFF -D build_configuration:STRING=Release -D generated_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_reduce.cu.obj -D generated_cubin_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_reduce.cu.obj.cubin.txt -P F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_reduce.cu.obj.Release.cmake"
CMake Error at cuda_compile_1_generated_reduce.cu.obj.Release.cmake:220 (message):
  Error generating
  F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_reduce.cu.obj

[481/3621] Building NVCC (Device) object modules/world/CMa...rithm/src/cuda/cuda_compile_1_generated_split_merge.cu.obj
FAILED: modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_split_merge.cu.obj F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_split_merge.cu.obj
cmd.exe /C "cd /D F:\opencv\opencv-4.6.0\build\modules\world\CMakeFiles\cuda_compile_1.dir\ __\__ \ __\opencv_contrib-4.6.0\modules\cudaarithm\src\cuda && F:\CMake\bin\cmake.exe -E make_directory F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/. && F:\CMake\bin\cmake.exe -D verbose:BOOL=OFF -D build_configuration:STRING=Release -D generated_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_split_merge.cu.obj -D generated_cubin_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_split_merge.cu.obj.cubin.txt -P F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_split_merge.cu.obj.Release.cmake"
CMake Error at cuda_compile_1_generated_split_merge.cu.obj.Release.cmake:220 (message):
  Error generating
  F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_split_merge.cu.obj

[482/3621] Building NVCC (Device) object modules/world/CMa...udaarithm/src/cuda/cuda_compile_1_generated_sub_mat.cu.obj
FAILED: modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_sub_mat.cu.obj F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_sub_mat.cu.obj
cmd.exe /C "cd /D F:\opencv\opencv-4.6.0\build\modules\world\CMakeFiles\cuda_compile_1.dir\ __\__ \ __\opencv_contrib-4.6.0\modules\cudaarithm\src\cuda && F:\CMake\bin\cmake.exe -E make_directory F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/. && F:\CMake\bin\cmake.exe -D verbose:BOOL=OFF -D build_configuration:STRING=Release -D generated_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_sub_mat.cu.obj -D generated_cubin_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_sub_mat.cu.obj.cubin.txt -P F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_sub_mat.cu.obj.Release.cmake"
CMake Error at cuda_compile_1_generated_sub_mat.cu.obj.Release.cmake:220 (message):
  Error generating
  F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_sub_mat.cu.obj

[483/3621] Building NVCC (Device) object modules/world/CMa...aarithm/src/cuda/cuda_compile_1_generated_threshold.cu.obj
FAILED: modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_threshold.cu.obj F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_threshold.cu.obj
cmd.exe /C "cd /D F:\opencv\opencv-4.6.0\build\modules\world\CMakeFiles\cuda_compile_1.dir\ __\__ \ __\opencv_contrib-4.6.0\modules\cudaarithm\src\cuda && F:\CMake\bin\cmake.exe -E make_directory F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/. && F:\CMake\bin\cmake.exe -D verbose:BOOL=OFF -D build_configuration:STRING=Release -D generated_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_threshold.cu.obj -D generated_cubin_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_threshold.cu.obj.cubin.txt -P F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_threshold.cu.obj.Release.cmake"
CMake Error at cuda_compile_1_generated_threshold.cu.obj.Release.cmake:220 (message):
  Error generating
  F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_threshold.cu.obj

[484/3621] Building NVCC (Device) object modules/world/CMa...arithm/src/cuda/cuda_compile_1_generated_polar_cart.cu.obj
FAILED: modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_polar_cart.cu.obj F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_polar_cart.cu.obj
cmd.exe /C "cd /D F:\opencv\opencv-4.6.0\build\modules\world\CMakeFiles\cuda_compile_1.dir\ __\__ \ __\opencv_contrib-4.6.0\modules\cudaarithm\src\cuda && F:\CMake\bin\cmake.exe -E make_directory F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/. && F:\CMake\bin\cmake.exe -D verbose:BOOL=OFF -D build_configuration:STRING=Release -D generated_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_polar_cart.cu.obj -D generated_cubin_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_polar_cart.cu.obj.cubin.txt -P F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_polar_cart.cu.obj.Release.cmake"
CMake Error at cuda_compile_1_generated_polar_cart.cu.obj.Release.cmake:220 (message):
  Error generating
  F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_polar_cart.cu.obj

[485/3621] Building NVCC (Device) object modules/world/CMa...arithm/src/cuda/cuda_compile_1_generated_mul_scalar.cu.obj
FAILED: modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_mul_scalar.cu.obj F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_mul_scalar.cu.obj
cmd.exe /C "cd /D F:\opencv\opencv-4.6.0\build\modules\world\CMakeFiles\cuda_compile_1.dir\ __\__ \ __\opencv_contrib-4.6.0\modules\cudaarithm\src\cuda && F:\CMake\bin\cmake.exe -E make_directory F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/. && F:\CMake\bin\cmake.exe -D verbose:BOOL=OFF -D build_configuration:STRING=Release -D generated_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_mul_scalar.cu.obj -D generated_cubin_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_mul_scalar.cu.obj.cubin.txt -P F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_mul_scalar.cu.obj.Release.cmake"
CMake Error at cuda_compile_1_generated_mul_scalar.cu.obj.Release.cmake:220 (message):
  Error generating
  F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_mul_scalar.cu.obj

[486/3621] Building NVCC (Device) object modules/world/CMa...es/cudaarithm/src/cuda/cuda_compile_1_generated_sum.cu.obj
FAILED: modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_sum.cu.obj F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_sum.cu.obj
cmd.exe /C "cd /D F:\opencv\opencv-4.6.0\build\modules\world\CMakeFiles\cuda_compile_1.dir\ __\__ \ __\opencv_contrib-4.6.0\modules\cudaarithm\src\cuda && F:\CMake\bin\cmake.exe -E make_directory F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/. && F:\CMake\bin\cmake.exe -D verbose:BOOL=OFF -D build_configuration:STRING=Release -D generated_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_sum.cu.obj -D generated_cubin_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_sum.cu.obj.cubin.txt -P F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_sum.cu.obj.Release.cmake"
CMake Error at cuda_compile_1_generated_sum.cu.obj.Release.cmake:220 (message):
  Error generating
  F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_sum.cu.obj

[487/3621] Building NVCC (Device) object modules/world/CMa...s/cudaarithm/src/cuda/cuda_compile_1_generated_norm.cu.obj
FAILED: modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_norm.cu.obj F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_norm.cu.obj
cmd.exe /C "cd /D F:\opencv\opencv-4.6.0\build\modules\world\CMakeFiles\cuda_compile_1.dir\ __\__ \ __\opencv_contrib-4.6.0\modules\cudaarithm\src\cuda && F:\CMake\bin\cmake.exe -E make_directory F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/. && F:\CMake\bin\cmake.exe -D verbose:BOOL=OFF -D build_configuration:STRING=Release -D generated_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_norm.cu.obj -D generated_cubin_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_norm.cu.obj.cubin.txt -P F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/cuda_compile_1_generated_norm.cu.obj.Release.cmake"
CMake Error at cuda_compile_1_generated_norm.cu.obj.Release.cmake:220 (message):
  Error generating
  F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudaarithm/src/cuda/./cuda_compile_1_generated_norm.cu.obj

[488/3621] Building NVCC (Device) object modules/world/CMa...c/cuda/cuda_compile_1_generated_column_filter.16sc3.cu.obj
FAILED: modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudafilters/src/cuda/cuda_compile_1_generated_column_filter.16sc3.cu.obj F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudafilters/src/cuda/cuda_compile_1_generated_column_filter.16sc3.cu.obj
cmd.exe /C "cd /D F:\opencv\opencv-4.6.0\build\modules\world\CMakeFiles\cuda_compile_1.dir\ __\__ \ __\opencv_contrib-4.6.0\modules\cudafilters\src\cuda && F:\CMake\bin\cmake.exe -E make_directory F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudafilters/src/cuda/. && F:\CMake\bin\cmake.exe -D verbose:BOOL=OFF -D build_configuration:STRING=Release -D generated_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ / __/opencv_contrib-4.6.0/modules/cudafilters/src/cuda/./cuda_compile_1_generated_column_filter.16sc3.cu.obj -D generated_cubin_file:STRING=F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/__ / __/__ /opencv_contrib-4.6.0/modules/cudafilters/src/cuda/./cuda_compile_1_generated_column_filter.16sc3.cu.obj.cubin.txt -P F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudafilters/src/cuda/cuda_compile_1_generated_column_filter.16sc3.cu.obj.Release.cmake"
CMake Error at cuda_compile_1_generated_column_filter.16sc3.cu.obj.Release.cmake:220 (message):
  Error generating
  F:/opencv/opencv-4.6.0/build/modules/world/CMakeFiles/cuda_compile_1.dir/ __/__ /__/opencv_contrib-4.6.0/modules/cudafilters/src/cuda/./cuda_compile_1_generated_column_filter.16sc3.cu.obj

ninja: build stopped: subcommand failed.

```

Could anyone help me?  
Thank you!

---

<div class="post-metadata">

**Author:** ![cudawarped](https://avatars.discourse-cdn.com/v4/letter/c/9dc877/32.png) [@cudawarped](https://forum.opencv.org/u/cudawarped)\
**Post date:** [February 20, 2023, 9:39am UTC](https://forum.opencv.org/t/opencv-build-with-cuda-backend-on-windows-10-error/12049/2 "2023-02-20T09:39:02Z")

</div>

I may be missing something but I can’t see any information to indicate why its failing apart from “Error generating”?

You could try following the guide that one is based on

> **[Accelerate OpenCV 4.5.0 on Windows – build with CUDA and python bindings -...](https://jamesbowley.co.uk/accelerate-opencv-4-5-0-on-windows-build-with-cuda-and-python-bindings/)**
>
> Because the pre-built Windows libraries available for OpenCV 4.5.0 do not include the CUDA modules, or support for the Nvidia Video Codec SDK, Nvidia cuDNN, Intel Media SDK or Intel’s Math Kernel Libraries (MKL) or Intel Threaded Building Blocks...

Or try this pre-built python wheel for OpenCV with CUDA.

> **[Release 4.6.0.20221107 · cudawarped/opencv-python-cuda-wheels](https://github.com/cudawarped/opencv-python-cuda-wheels/releases/tag/4.6.0.20221107)**
>
> Winows OpenCV python wheel built against CUDA 11.8 Nvidia Video Codec SDK 11.1 and cuDNN 8.6.0.
> Suitable for all devices of compute capability \>= 3.5 with binary compatible code for devices of comp...
