Ubuntu 安装openCV2.4.9 和cuda时 错误及对应解决方案

错误1:

issue:

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

 

solution:

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


错误2:

在build之前,替换“NCVPixelOperations.hpp”文件!否则会编译出错!!!

NCVPixelOperations.hpp所在目录:/Home/opencv-2.4.9/modules/gpu/src/nvidia/core

正确的NCVPixelOperations.hpp下载地址:http://download.csdn.net/download/znculee/9294885


错误3:

/data/opencv-2.4.11/modules/gpu/src/graphcuts.cpp:120:54: error: ‘NppiGraphcutState’ has not been declared  
。。。

修改/data/opencv-2.4.11/modules/gpu/src/graphcuts.cpp

#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)   

→#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER) || (CUDART_VERSION >= 8000) 

重新编译即可。



你可能感兴趣的:(openCV基本操作)