NVCC fatal:unsupported GPU Architecture ' compute_11 '

Source: Internet
Author: User
Tags unsupported win32 nvcc

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.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.