OpenCV build with CUDA backend on Windows 10 error

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

And this is my bat file:

configure_and_build_opencv.bat

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.

--
-- 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!

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

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