Information About Installing OpenCV and CUDA

Asked 1 years ago, Updated 1 years ago, 102 views

We are currently trying to build an environment for GPU programming using OpenCV.
However, there are some problems and the installation (strictly lib, dll creation) will fail. If you know the cause, please let me know.

  • hardware
    • Core i7-4770
    • GeForce GTX660
  • software
    • Windows 10 (Windows SDK already installed)
    • CUDA Toolkit 9.0
    • Visual Studio 2017
  • Core i7-4770
  • GeForce GTX660
  • Windows 10 (Windows SDK already installed)
  • CUDA Toolkit 9.0
  • Visual Studio 2017

When you open OpenCV.sln in Visual Studio and build the INSTALL project, the following message appears.

...
2>CMake Error at cuda_compile_generated_gpu_mat.cu.obj.cmake: 206 (message):
2>Error generating
2>F: /opencv-3.4.0/build/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/Debug/cuda_compile_generated_gpu_mat.cu.obj
2>
2>
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.target(171,5): error MSB6006: "cmd.exe" ended with code 1.
2>Project "opencv_core.vcxproj" build terminated -- Failed.
...
10>CMake Error at cuda_compile_generated_column_filter.16sc1.cu.obj.cmake: 206 (message):
15>CMake does not need to re-run cause F: /opencv-3.4.0/build/modules/phase_unwrapping/CMakeFiles/generate.stamp is up-to-date.
10>Error generating
10>F: /opencv-3.4.0/build/modules/cudafilters/CMakeFiles/cuda_compile.dir/src/cuda/Debug/cuda_compile_generated_column_filter.16sc1.cu.obj
10>
10>
10>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.target(171,5): error MSB6006: "cmd.exe" ended with code 1.
16>Building Custom Rule F: /opencv-3.4.0/opencv_contrib-3.4.0/modules/fuzy/CMakeLists.txt
10>Project "opencv_cudafilters.vcxproj" build terminated -- Failed.
...

visual-studio opencv cuda

2022-09-30 17:36

2 Answers

I have encountered the same phenomenon using an old CMake (v3.9).Using the latest CMake v3.10.2 at the time of answering questions has improved the problem.


2022-09-30 17:36

CUDA 9.1 cannot be compiled with the latest VisualStudio 2017.It's up to 15.4, so let's check the VisualStudio 2017 version.
The 15.45 installer may no longer be available for download.
VisualStudio 2015 is compatible, so if you can't find the installer for 14.45, please give up and use VisualStudio 2015.
The reason for the compilation error is that the comments in the header file contain characters that cannot be displayed in CP932, so you can delete the comments, save them again in Unicode, or compile them in English.


2022-09-30 17:36

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.