Opencv编译出现compute_11 not support解决方法

版权声明:转载请联系博主 https://blog.csdn.net/zxtalentwolf/article/details/80396987
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!

猜你喜欢

转载自blog.csdn.net/zxtalentwolf/article/details/80396987
今日推荐