VS2019 OpenCV 4.4 CUDA10.0 Compilation Pit

The pits encountered when compiling OpenCV 4.4 + CUDA10.0 with WIN10 VS2019

The general steps are not written in many details on the Internet, mainly to write down a few pits encountered.

.CUDA_ARCH_BIN

Be sure to fill in and modify the value of CUDA_ARCH_BIN (graphics card computing power *10), otherwise it will run into errors after successful compilation.
Insert picture description here
The following is the calculation table provided by the official website, a part of which is cut off, you can check the official website without a suitable graphics card.

https://developer.nvidia.com/zh-cn/cuda-gpus

Insert picture description here

2. Correspondence between VS and CUDA

There are some restrictions on the VS version in the CUDA source code, just like the VS2019 CUAD 10.0 I used is not supported by default.

Configuration file path:

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0\include\crt\host_config.h

Line 141 in the code limits the version number of the _MSC_VER compiler.
Insert picture description here
Insert picture description here
My VS2019 version of the _MSC_VER compiler version number exceeds the CUDA configuration file code, and errors will occur during the compilation process. At present, you can modify the 1920 value in the CUDA configuration file to compile normally.
Insert picture description here

Guess you like

Origin blog.csdn.net/djj199301111/article/details/109719864