I have been trying to build Opencv 4.9.0 with cuda 12.3. I am using GPU RTX 4060. I am using cmake GUI. Have tried all the required flags. Still the build is not proper and not able to access CUDA. Can anybody also mention the compatible Microsoft Visual Studio also.
Which version of Visual Studio are you using? The latest should work.
What errors (not warnings) are you seeing? Can you post the text of the errors.
Can you post the text of your CMake configuration output? See âExample of CMake Configuration Outputâ for an example
General configuration for OpenCV 4.9.0 =====================================
Version control: unknown
Extra modules:
Location (extra): C:/Ombrulla/General/GPU_OpenCv/opencv_contrib-4.9.0/modules
Version control (extra): unknown
Platform:
Timestamp: 2024-03-13T07:14:12Z
Host: Windows 10.0.22631 AMD64
CMake: 3.28.3
CMake generator: Visual Studio 17 2022
CMake build tool: C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/amd64/MSBuild.exe
MSVC: 1939
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.39.33519/bin/Hostx64/x64/cl.exe (ver 19.39.33522.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.39.33519/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: YES
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.3/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 xfeatures2d ximgproc xobjdetect xphoto
Disabled: world
Disabled by dependency: -
Unavailable: alphamat cannops cvv freetype hdf java julia matlab ovis python2 sfm viz
Applications: tests perf_tests apps
Documentation: NO
Non-free algorithms: NO
Windows RT support: NO
GUI: WIN32UI
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:/Ombrulla/General/GPU_OpenCv/build/3rdparty/ippicv/ippicv_win/icv
Intel IPP IW: sources (2021.11.0)
at: C:/Ombrulla/General/GPU_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.3, CUFFT CUBLAS NVCUVID NVCUVENC FAST_MATH)
NVIDIA GPU arch: 89
NVIDIA PTX archs:
cuDNN: YES (ver 8.9.7)
OpenCL: YES (NVD3D11)
Include path: C:/Ombrulla/General/GPU_OpenCv/opencv-4.9.0/3rdparty/include/opencl/1.2
Link libraries: Dynamic load
Python 3:
Interpreter: C:/Users/OMBRULLA/AppData/Local/Programs/Python/Python311/python.exe (ver 3.11.4)
Libraries: C:/Users/OMBRULLA/AppData/Local/Programs/Python/Python311/libs/python311.lib (ver 3.11.4)
numpy: C:/Users/OMBRULLA/AppData/Local/Programs/Python/Python311/Lib/site-packages/numpy/core/include (ver 1.26.4)
install path: C:/Users/OMBRULLA/AppData/Local/Programs/Python/Python311/Lib/site-packages/cv2/python-3.11
Python (for build): C:/Users/OMBRULLA/AppData/Local/Programs/Python/Python311/python.exe
Java:
ant: NO
Java: NO
JNI: NO
Java wrappers: NO
Java tests: NO
Install to: C:/Ombrulla/General/GPU_OpenCv/build/install
-----------------------------------------------------------------
Configuring done (33.2s)
zlib.vcxproj -> C:\Ombrulla\General\GPU_OpenCv\build\3rdparty\lib\Debug\zlibd.lib
Processing OpenCL kernels (core)
Building NVCC (Device) object modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/Debug/cuda_compile_1_generated_gpu_
mat.cu.obj
nvcc fatal : Could not set up the environment for Microsoft Visual Studio using 'C:/Program Files/Microsoft Visual
Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/../../../../../../../VC/Auxiliary/Build/vcvars64.bat'
CMake Error at cuda_compile_1_generated_gpu_mat.cu.obj.Debug.cmake:220 (message):
Error generating
C:/Ombrulla/General/GPU_OpenCv/build/modules/core/CMakeFiles/cuda_compile_1.dir/src/cuda/Debug/cuda_compile_1_gener
ated_gpu_mat.cu.obj
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): e
rror MSB8066: Custom build for 'C:\Ombrulla\General\GPU_OpenCv\build\CMakeFiles\53c26fc6905121da1759ad6c0141ca49\opencl
_kernels_core.cpp.rule;C:\Ombrulla\General\GPU_OpenCv\opencv-4.9.0\modules\core\src\cuda\gpu_mat.cu;C:\Ombrulla\General
\GPU_OpenCv\opencv-4.9.0\modules\core\src\cuda\gpu_mat_nd.cu' exited with code 1. [C:\Ombrulla\General\GPU_OpenCv\build
\modules\core\opencv_core.vcxproj]
I would check your environmental variables, see
Additionally make sure you are using the latest commit from the 4.x branch for both the main and contrib repositories. If not you will get the following error
opencv_world_SSE4_2.vcxproj -> C:\Ombrulla\General\GPU_OpenCv\build\modules\world\opencv_world_SSE4_2.dir\Release\opencv_world_SSE4_2.lib
Processing OpenCL kernels (core)
Building NVCC (Device) object modules/world/CMakeFiles/cuda_compile_1.dir/__/core/src/cuda/Release/cuda_compile_1_generated_gpu_mat.cu.obj
nvcc fatal : Could not set up the environment for Microsoft Visual Studio using 'C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools
/MSVC/14.29.30133/bin/Hostx64/x64/../../../../../../../VC/Auxiliary/Build/vcvars64.bat'
CMake Error at cuda_compile_1_generated_gpu_mat.cu.obj.Release.cmake:220 (message):
Error generating
C:/Ombrulla/General/GPU_OpenCv/build/modules/world/CMakeFiles/cuda_compile_1.dir/__/core/src/cuda/Release/cuda_compile_1_generated_gpu_mat.cu.obj
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241,5): error MSB8066: Custom build for
'C:\Ombrulla\General\GPU_OpenCv\build\CMakeFiles\c271695b1da06c75206df5b7699065e2\opencl_kernels_core.cpp.rule;C:\Ombrulla\General\GPU_OpenCv\opencv-4.9.0
\modules\core\src\cuda\gpu_mat.cu;C:\Ombrulla\General\GPU_OpenCv\opencv-4.9.0\modules\core\src\cuda\gpu_mat_nd.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_con
trib-4.9.0\modules\cudaarithm\src\cuda\absdiff_mat.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaarithm\src\cuda\absdiff_scalar.cu;C:\
Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaarithm\src\cuda\add_mat.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaari
thm\src\cuda\add_scalar.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaarithm\src\cuda\add_weighted.cu;C:\Ombrulla\General\GPU_OpenCv\o
pencv_contrib-4.9.0\modules\cudaarithm\src\cuda\bitwise_mat.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaarithm\src\cuda\bitwise_scal
ar.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaarithm\src\cuda\cmp_mat.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\module
s\cudaarithm\src\cuda\cmp_scalar.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaarithm\src\cuda\copy_make_border.cu;C:\Ombrulla\General
\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaarithm\src\cuda\countnonzero.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaarithm\src\cud
a\div_mat.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaarithm\src\cuda\div_scalar.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.
9.0\modules\cudaarithm\src\cuda\in_range.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaarithm\src\cuda\integral.cu;C:\Ombrulla\General
\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaarithm\src\cuda\lut.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaarithm\src\cuda\math.cu
;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaarithm\src\cuda\minmax.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cuda
arithm\src\cuda\minmax_mat.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaarithm\src\cuda\minmaxloc.cu;C:\Ombrulla\General\GPU_OpenCv\o
pencv_contrib-4.9.0\modules\cudaarithm\src\cuda\mul_mat.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaarithm\src\cuda\mul_scalar.cu;C:
\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaarithm\src\cuda\mul_spectrums.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\
cudaarithm\src\cuda\norm.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaarithm\src\cuda\normalize.cu;C:\Ombrulla\General\GPU_OpenCv\ope
ncv_contrib-4.9.0\modules\cudaarithm\src\cuda\polar_cart.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaarithm\src\cuda\reduce.cu;C:\Om
brulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaarithm\src\cuda\split_merge.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaa
rithm\src\cuda\sub_mat.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaarithm\src\cuda\sub_scalar.cu;C:\Ombrulla\General\GPU_OpenCv\open
cv_contrib-4.9.0\modules\cudaarithm\src\cuda\sum.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaarithm\src\cuda\threshold.cu;C:\Ombrull
a\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaarithm\src\cuda\transpose.cu;C:\Ombrulla\General\GPU_OpenCv\build\CMakeFiles\c271695b1da06c75206df5b7
699065e2\opencl_kernels_imgproc.cpp.rule;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudafilters\src\cuda\column_filter.16sc1.cu;C:\Ombrull
a\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudafilters\src\cuda\column_filter.16sc3.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\c
udafilters\src\cuda\column_filter.16sc4.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudafilters\src\cuda\column_filter.16uc1.cu;C:\Ombru
lla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudafilters\src\cuda\column_filter.16uc3.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules
\cudafilters\src\cuda\column_filter.16uc4.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudafilters\src\cuda\column_filter.32fc1.cu;C:\Omb
rulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudafilters\src\cuda\column_filter.32fc3.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modul
es\cudafilters\src\cuda\column_filter.32fc4.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudafilters\src\cuda\column_filter.32sc1.cu;C:\O
mbrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudafilters\src\cuda\column_filter.32sc3.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\mod
ules\cudafilters\src\cuda\column_filter.32sc4.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudafilters\src\cuda\column_filter.8uc1.cu;C:\
Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudafilters\src\cuda\column_filter.8uc3.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\mod
ules\cudafilters\src\cuda\column_filter.8uc4.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudafilters\src\cuda\filter2d.cu;C:\Ombrulla\Ge
neral\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudafilters\src\cuda\median_filter.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudafilters
\src\cuda\row_filter.16sc1.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudafilters\src\cuda\row_filter.16sc3.cu;C:\Ombrulla\General\GPU_
OpenCv\opencv_contrib-4.9.0\modules\cudafilters\src\cuda\row_filter.16sc4.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudafilters\src\cu
da\row_filter.16uc1.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudafilters\src\cuda\row_filter.16uc3.cu;C:\Ombrulla\General\GPU_OpenCv\
opencv_contrib-4.9.0\modules\cudafilters\src\cuda\row_filter.16uc4.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudafilters\src\cuda\row_
filter.32fc1.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudafilters\src\cuda\row_filter.32fc3.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_
contrib-4.9.0\modules\cudafilters\src\cuda\row_filter.32fc4.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudafilters\src\cuda\row_filter.
32sc1.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudafilters\src\cuda\row_filter.32sc3.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib
-4.9.0\modules\cudafilters\src\cuda\row_filter.32sc4.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudafilters\src\cuda\row_filter.8uc1.cu
;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudafilters\src\cuda\row_filter.8uc3.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\mo
dules\cudafilters\src\cuda\row_filter.8uc4.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaimgproc\src\cuda\bilateral_filter.cu;C:\Ombru
lla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaimgproc\src\cuda\blend.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaimgproc\s
rc\cuda\build_point_list.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaimgproc\src\cuda\canny.cu;C:\Ombrulla\General\GPU_OpenCv\opencv
_contrib-4.9.0\modules\cudaimgproc\src\cuda\clahe.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaimgproc\src\cuda\color.cu;C:\Ombrulla\
General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaimgproc\src\cuda\connectedcomponents.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cud
aimgproc\src\cuda\corners.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaimgproc\src\cuda\debayer.cu;C:\Ombrulla\General\GPU_OpenCv\ope
ncv_contrib-4.9.0\modules\cudaimgproc\src\cuda\generalized_hough.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaimgproc\src\cuda\gftt.c
u;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaimgproc\src\cuda\hist.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cuda
imgproc\src\cuda\hough_circles.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaimgproc\src\cuda\hough_lines.cu;C:\Ombrulla\General\GPU_O
penCv\opencv_contrib-4.9.0\modules\cudaimgproc\src\cuda\hough_segments.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaimgproc\src\cuda\
match_template.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaimgproc\src\cuda\mean_shift.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_cont
rib-4.9.0\modules\cudaimgproc\src\cuda\moments.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudawarping\src\cuda\pyr_down.cu;C:\Ombrulla\
General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudawarping\src\cuda\pyr_up.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudawarping\src\
cuda\remap.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudawarping\src\cuda\resize.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.
0\modules\cudawarping\src\cuda\warp.cu;C:\Ombrulla\General\GPU_OpenCv\build\CMakeFiles\c271695b1da06c75206df5b7699065e2\opencl_kernels_dnn.cpp.rule;C:\Ombr
ulla\General\GPU_OpenCv\opencv-4.9.0\modules\dnn\src\cuda\activation_eltwise.cu;C:\Ombrulla\General\GPU_OpenCv\opencv-4.9.0\modules\dnn\src\cuda\activation
s.cu;C:\Ombrulla\General\GPU_OpenCv\opencv-4.9.0\modules\dnn\src\cuda\bias_activation.cu;C:\Ombrulla\General\GPU_OpenCv\opencv-4.9.0\modules\dnn\src\cuda\b
ias_activation_eltwise.cu;C:\Ombrulla\General\GPU_OpenCv\opencv-4.9.0\modules\dnn\src\cuda\bias_eltwise_activation.cu;C:\Ombrulla\General\GPU_OpenCv\opencv
-4.9.0\modules\dnn\src\cuda\concat.cu;C:\Ombrulla\General\GPU_OpenCv\opencv-4.9.0\modules\dnn\src\cuda\crop_and_resize.cu;C:\Ombrulla\General\GPU_OpenCv\op
encv-4.9.0\modules\dnn\src\cuda\detection_output.cu;C:\Ombrulla\General\GPU_OpenCv\opencv-4.9.0\modules\dnn\src\cuda\eltwise_activation.cu;C:\Ombrulla\Gene
ral\GPU_OpenCv\opencv-4.9.0\modules\dnn\src\cuda\eltwise_ops.cu;C:\Ombrulla\General\GPU_OpenCv\opencv-4.9.0\modules\dnn\src\cuda\fill_copy.cu;C:\Ombrulla\G
eneral\GPU_OpenCv\opencv-4.9.0\modules\dnn\src\cuda\fp_conversion.cu;C:\Ombrulla\General\GPU_OpenCv\opencv-4.9.0\modules\dnn\src\cuda\grid_nms.cu;C:\Ombrul
la\General\GPU_OpenCv\opencv-4.9.0\modules\dnn\src\cuda\max_unpooling.cu;C:\Ombrulla\General\GPU_OpenCv\opencv-4.9.0\modules\dnn\src\cuda\mvn.cu;C:\Ombrull
a\General\GPU_OpenCv\opencv-4.9.0\modules\dnn\src\cuda\normalize.cu;C:\Ombrulla\General\GPU_OpenCv\opencv-4.9.0\modules\dnn\src\cuda\padding.cu;C:\Ombrulla
\General\GPU_OpenCv\opencv-4.9.0\modules\dnn\src\cuda\permute.cu;C:\Ombrulla\General\GPU_OpenCv\opencv-4.9.0\modules\dnn\src\cuda\prior_box.cu;C:\Ombrulla\
General\GPU_OpenCv\opencv-4.9.0\modules\dnn\src\cuda\region.cu;C:\Ombrulla\General\GPU_OpenCv\opencv-4.9.0\modules\dnn\src\cuda\resize.cu;C:\Ombrulla\Gener
al\GPU_OpenCv\opencv-4.9.0\modules\dnn\src\cuda\roi_pooling.cu;C:\Ombrulla\General\GPU_OpenCv\opencv-4.9.0\modules\dnn\src\cuda\scale_shift.cu;C:\Ombrulla\
General\GPU_OpenCv\opencv-4.9.0\modules\dnn\src\cuda\shortcut.cu;C:\Ombrulla\General\GPU_OpenCv\opencv-4.9.0\modules\dnn\src\cuda\slice.cu;C:\Ombrulla\Gene
ral\GPU_OpenCv\build\CMakeFiles\c271695b1da06c75206df5b7699065e2\opencl_kernels_features2d.cpp.rule;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\mod
ules\hfs\src\cuda\gslic_seg_engine_gpu.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\hfs\src\cuda\magnitude.cu;C:\Ombrulla\General\GPU_Ope
nCv\build\CMakeFiles\c271695b1da06c75206df5b7699065e2\opencl_kernels_photo.cpp.rule;C:\Ombrulla\General\GPU_OpenCv\opencv-4.9.0\modules\photo\src\cuda\nlm.
cu;C:\Ombrulla\General\GPU_OpenCv\build\CMakeFiles\c271695b1da06c75206df5b7699065e2\opencl_kernels_calib3d.cpp.rule;C:\Ombrulla\General\GPU_OpenCv\opencv_c
ontrib-4.9.0\modules\cudacodec\src\cuda\nv12_to_rgb.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudacodec\src\cuda\rgb_to_yv12.cu;C:\Omb
rulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudafeatures2d\src\cuda\bf_knnmatch.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cu
dafeatures2d\src\cuda\bf_match.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudafeatures2d\src\cuda\bf_radius_match.cu;C:\Ombrulla\Genera
l\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudafeatures2d\src\cuda\fast.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudafeatures2d\src\cu
da\orb.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudastereo\src\cuda\disparity_bilateral_filter.cu;C:\Ombrulla\General\GPU_OpenCv\open
cv_contrib-4.9.0\modules\cudastereo\src\cuda\stereobm.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudastereo\src\cuda\stereobp.cu;C:\Omb
rulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudastereo\src\cuda\stereocsbp.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaste
reo\src\cuda\stereosgm.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudastereo\src\cuda\util.cu;C:\Ombrulla\General\GPU_OpenCv\build\CMak
eFiles\c271695b1da06c75206df5b7699065e2\opencl_kernels_objdetect.cpp.rule;C:\Ombrulla\General\GPU_OpenCv\build\CMakeFiles\c271695b1da06c75206df5b7699065e2\
opencl_kernels_rgbd.cpp.rule;C:\Ombrulla\General\GPU_OpenCv\build\CMakeFiles\c271695b1da06c75206df5b7699065e2\opencl_kernels_video.cpp.rule;C:\Ombrulla\Gen
eral\GPU_OpenCv\build\CMakeFiles\c271695b1da06c75206df5b7699065e2\opencl_kernels_xfeatures2d.cpp.rule;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\m
odules\xfeatures2d\src\cuda\surf.cu;C:\Ombrulla\General\GPU_OpenCv\build\CMakeFiles\c271695b1da06c75206df5b7699065e2\opencl_kernels_ximgproc.cpp.rule;C:\Om
brulla\General\GPU_OpenCv\build\CMakeFiles\c271695b1da06c75206df5b7699065e2\opencl_kernels_bioinspired.cpp.rule;C:\Ombrulla\General\GPU_OpenCv\opencv_contr
ib-4.9.0\modules\cudabgsegm\src\cuda\mog.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudabgsegm\src\cuda\mog2.cu;C:\Ombrulla\General\GPU
_OpenCv\opencv_contrib-4.9.0\modules\cudalegacy\src\cuda\NCV.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudalegacy\src\cuda\NCVBroxOpti
calFlow.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudalegacy\src\cuda\NCVHaarObjectDetection.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_
contrib-4.9.0\modules\cudalegacy\src\cuda\NCVPyramid.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudalegacy\src\cuda\NPP_staging.cu;C:\O
mbrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudalegacy\src\cuda\bm.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudalegacy\sr
c\cuda\bm_fast.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudalegacy\src\cuda\calib3d.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-
4.9.0\modules\cudalegacy\src\cuda\ccomponetns.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudalegacy\src\cuda\fgd.cu;C:\Ombrulla\General
\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudalegacy\src\cuda\gmg.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudalegacy\src\cuda\needle_
map.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaobjdetect\src\cuda\hog.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\module
s\cudaobjdetect\src\cuda\lbp.cu;C:\Ombrulla\General\GPU_OpenCv\build\CMakeFiles\c271695b1da06c75206df5b7699065e2\opencl_kernels_optflow.cpp.rule;C:\Ombrull
a\General\GPU_OpenCv\build\CMakeFiles\c271695b1da06c75206df5b7699065e2\opencl_kernels_stitching.cpp.rule;C:\Ombrulla\General\GPU_OpenCv\opencv-4.9.0\module
s\stitching\src\cuda\build_warp_maps.cu;C:\Ombrulla\General\GPU_OpenCv\opencv-4.9.0\modules\stitching\src\cuda\multiband_blend.cu;C:\Ombrulla\General\GPU_O
penCv\build\CMakeFiles\c271695b1da06c75206df5b7699065e2\opencl_kernels_tracking.cpp.rule;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaop
tflow\src\cuda\farneback.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaoptflow\src\cuda\nvidiaOpticalFlow.cu;C:\Ombrulla\General\GPU_O
penCv\opencv_contrib-4.9.0\modules\cudaoptflow\src\cuda\pyrlk.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\cudaoptflow\src\cuda\tvl1flow.
cu;C:\Ombrulla\General\GPU_OpenCv\build\CMakeFiles\c271695b1da06c75206df5b7699065e2\opencl_kernels_superres.cpp.rule;C:\Ombrulla\General\GPU_OpenCv\opencv_
contrib-4.9.0\modules\superres\src\cuda\btv_l1_gpu.cu;C:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0\modules\videostab\src\cuda\global_motion.cu' exit
ed with code 1. [C:\Ombrulla\General\GPU_OpenCv\build\modules\world\opencv_world.vcxproj]
This is the error that comes now and i am getting this for both Visual Studio 16 2019 and 17 2022
The error is the same it looks like you have something wrong with your environmental variables, see the stack overflow post I linked to.
If I add a " to my path, e.g.
set path=""";%path%
then I get the same error.
Note: If you donât pass -DCUDA_ARCH_BIN=8.9 you will get this error during the configuration stage.
Will be very helpfull if you can suggest the steps when building use Cmake GUI because when i am running using Cmd the cude itself is not detected.
set CMAKE_BUILD_PARALLEL_LEVEL=8
âC:\Program Files\CMake\bin\cmake.exeâ -H"C:\Ombrulla\General\GPU_OpenCv\opencv-4.9.0" -DOPENCV_EXTRA_MODULES_PATH=âC:\Ombrulla\General\GPU_OpenCv\opencv_contrib-4.9.0â -B"C:\Ombrulla\General\GPU_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 -DCUDA_ARCH_BIN=8.9 -DCUDA_TOOLKIT_ROOT_DIR=âC:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.3â -DBUILD_opencv_python3=ON -DPYTHON3_INCLUDE_DIR=âC:/Users/OMBRULLA/AppData/Local/Programs/Python/Python311/includeâ -DPYTHON3_LIBRARY=âC:/Users/OMBRULLA/AppData/Local/Programs/Python/Python311/Libâ -DPYTHON3_EXECUTABLE=âC:/Users/OMBRULLA/AppData/Local/Programs/Python/Python311/python.exeâ -DPYTHON3_NUMPY_INCLUDE_DIRS=âC:/Users/OMBRULLA/AppData/Local/Programs/Python/Python311/Lib/site-packages/numpy/core/includeâ -DPYTHON3_PACKAGES_PATH=âC:/Users/OMBRULLA/AppData/Local/Programs/Python/Python311/Lib/site-packages/â
Did you fix a problem with your environmental variables?
I would not advise using the GUI.
What errors do you get when you use the command line which indicate CUDA is not found?
Syntax error in cmake code at
C:/Ombrulla/General/GPU_OpenCv/opencv-4.9.0/cmake/OpenCVUtils.cmake:1491
when parsing string
PRIVATE;C:\Users\OMBRULLA\AppData\Local\Programs\Python\Python311\libs\python311.lib
Invalid character escape â\Uâ.
Call Stack (most recent call first):
cmake/OpenCVUtils.cmake:1521 (__ocv_push_target_link_libraries)
modules/python/common.cmake:64 (ocv_target_link_libraries)
modules/python/python3/CMakeLists.txt:20 (include)
â Found CUDAToolkit: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.3/include (found version â12.3.103â)
CMake Warning at cmake/OpenCVFindLibsPerf.cmake:49 (message):
OpenCV is not able to find/configure CUDA SDK (required by WITH_CUDA).
CUDA support will be disabled in OpenCV build.
To eliminate this warning remove WITH_CUDA=ON CMake configuration option.
Call Stack (most recent call first):
CMakeLists.txt:812 (include)
â CUDA: Not detected, when using stand alone installations with the Visual Studio generator the path to the CUDA toolkit should be manually specified with -Tcuda=. e.g. -Tcuda=âC:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/vXX.Xâ
is BLAS and LAPACK needed
Using your command line arguments I do not get your first error have you resolved the problem with your environmental variables?
I suspect you still have a problem because CMake/Visual Studio is unable to resolve the location of the CUDA toolkit which is specified by the CUDA_PATH_V12_3 environmental variable. If it is equal to C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.3 you most likely still have an issue with your envrironmanetal variables.
You can try to force the location with
-T cuda="C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.3"
as suggested by the error but I think you will get problems when you try to build.