Unsupported gpu architecture 'compute_11'解决方法

本文记录了解决在Ubuntu 14.04环境下,使用CUDA 7.0进行OpenCV编译过程中遇到的GPU架构不支持问题。通过设置正确的CUDA_GENERATION参数,成功解决了编译错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

环境背景:

由于项目需要,在ubuntu service 14.04 下搭建 OpenCL +OpenCV 环境, 前期安装了 CUDA7.0 ,GPU为 NVIDIA TITAN 。

问题描述:
按照网上教程安装OpenCV ,在make 时出现错误,错误提示如下:错误提示

  1. nvcc fatal   : Unsupported gpu architecture 'compute_11'  
  2. CMake Error at cuda_compile_generated_matrix_operations.cu.o.cmake:206 (message):  
  3.   Error generating  
  4. /home/smie/Documents/opencv2.4.11/build/modules/core/CMakeFiles/cuda_compile.dir/__/dynamicuda/src/cuda/./cuda_compile_gene  
  5.   
  6. rated_matrix_operations.cu.o  
  7. make[2]: ***  
  8. [modules/core/CMakeFiles/cuda_compile.dir/__/dynamicuda/src/cuda/./cuda_compile_generated_matrix_operations.cu.o] Error 1  
  9. make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs....  

解决方法:
百度无果,求助万能谷歌。有高人回答如下:

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 ..

然后,这个问题就奇迹般的解决了。
总结:

  1. cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D CUDA_GENERATION=Kepler -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON   
  2. -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=OFF -D WITH_OPENGL=ON -D BUILD_TIFF=ON ..  

This let me install opencv-2.4.9.

另外一种解决方案:

Another option. Ubuntu 14.04, GTX Titan X, opencv-2.4.10

cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_TIFF=ON -D BUILD_EXAMPLES=ON -D CUDA_GENERATION=Auto -D BUILD_NEW_PYTHON_SUPPORT=ON ..

I also applied the patch:
https://github.com/Itseez/opencv/pull/3886/files
but I’m not sure whether it ended up being needed. I had tried with and without >CUDA_GENERATION=Maxwell but Maxwell isn’t detected. I did not try >CUDA_GENERATION=Auto prior to the patch, that’s why I don’t know for sure.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值