1. 程式人生 > >Opencv編譯出現compute_11 not support解決方法

Opencv編譯出現compute_11 not support解決方法

nvcc fatal   : Unsupported gpu architecture 'compute_11'
CMake Error at cuda_compile_generated_matrix_operations.cu.o.cmake:206 (message):
  Error generating
/home/smie/Documents/opencv2.4.11/build/modules/core/CMakeFiles/cuda_compile.dir/__/dynamicuda/src/cuda/./cuda_compile_gene

rated_matrix_operations.cu.o

make[2
]: *** [modules/core/CMakeFiles/cuda_compile.dir/__/dynamicuda/src/cuda/./cuda_compile_generated_matrix_operations.cu.o] Error 1 make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs....

首先,這裡要說明一下錯誤是compute_11,不是compute_ll,或者l1,1l之類的,其次網上搜索的解決方法都不靠譜,他們沒有找到問題的本因,如這位大佬的

blog的解決方法:

When using cmake to do configurations, set the option CUDA_GENERATION to specific your GPU architecture. I ran across the same error and tried this to work out the problem.
this worked for me and shows a possible value for CUDA_GENERATION:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D CUDA_GENERATION=Kepler ..

這不是神奇不神奇的問題,因為我根本沒法神奇的解決這個問題好不好,無奈,仔細想一想問題的原因:不支援compute_11。。。不支援。。

ccmake .. 

看一下具體引數的設定,通過指令/cuda定位到cuda設定部分有個引數CUDA_ARCH_BIN,這裡從1.1開始到3.5,我把數字1.1刪除,錯誤變成了compute_12不支援,看起啦問題在這裡,因為我的CUDA_ARCH_PTX是3.0,所以我把3.0一下全部刪除,問題解決,over!