When compiling the source code with VS compilation OpenCV, the CMake-generated engineering file compiles, and the NVCC fatal:unsupported GPU architecture ' compute_11 ' problem occurs. The reason is that CUDA7.5 does not support older graphics versions, so 1.1,2.0,2.1, such as graphics options, are redundant.
Need to change the configuration of the CMake GUI for the project and remove support for Compute_11
1. Open Cmakelist.txt
CMake in the option to declare-D Cuda_generation=kepler
That is, add:
if (WIN32 and not MinGW)
add_definitions (-d_variadic_max=10)
endif (WIN32 and not MinGW)
#此处为添加代码
if (1 )
add_definitions (-d_cuda_generation=maxwell)
This phenomenon cannot be eliminated and the problem has not been resolved.
Reference: The history of the Tears of installation Caffe
CMake Command command installation, usage
CMake Common variable speed check manual
Possible compute_11 problems with Linux version compilation OpenCV
For Maxwell Support, refer to: vs13+win7+opencv2.4.13+cuda7.5 support
2.
Correction Method:
Put the CUDA column inside, cuda_arch_bin item inside, 3.0 front all remove, change to see below.
Before
1. First change the cuda_generation to auto
2. Open the Sources\cmake directory and edit opencvdetectcuda.cmake using a text editor
Find the following paragraph
if (not DEFINED __cuda_arch_bin)
if ("
__cuda_arch_bin 3.2")
Set (__cuda_arch_ptx "")
Else ()
if (${cuda_version} version_less "5.0")
set (__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1 (2.0) 3.0")
Else ()
Set (__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1 3.0 3.5")
endif ()
Set (__cuda_arch_ptx "3.0")
endif ()
endif ()
Remove the second 1.1 1.2 1.3 2.0 2.1 and amend it to
if (not DEFINED __cuda_arch_bin)
if ("
__cuda_arch_bin 3.2")
Set (__cuda_arch_ptx "")
Else ()
if (${cuda_version} version_less "5.0")
set (__cuda_arch_bin "1.1 1.2 1.3 2.0 2.1 (2.0) 3.0")
Else ()
set (__cuda_arch_bin "3.0 3.5")
endif ()
Set (__cuda_arch_ptx "3.0")
endif ()
endif ()
or directly modified to make it available for the GTX960 video card of 5.2,
Can remove the Cuda_arch_bin 1.1 1.2 1.3 2.0 2.1, and then solve the NVCC fatal:unsupported GPU architecture ' compute_11 ' problem.
If you can not remove by editing options, there should be other feasible way ...
You can compile the pass.