ubuntu16.04下CUDA9.1+OPENCV3.1安裝記錄

lljj_hust發表於2017-12-18

之前總是分開裝CUDA和nvidia驅動,時常導致各種bug,於是這次一怒之下使用cuda官網的deb方式安裝,同時裝好cuda和nvidia驅動,但是cuda裝的卻是最新版本9.1,還沒裝opencv之前就想到一定會出現各種bug……

 一開始選擇的是opencv2.4.13,結果cmake報錯:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_nppi_LIBRARY (ADVANCED)
linked by target "opencv_cudev" in directory D:/Cproject/opencv/opencv/sources/modules/cudev
linked by target "opencv_cudev" in directory D:/Cproject/opencv/opencv/sources/modules/cudev
linked by target "opencv_test_cudev" in directory D:/Cproject/opencv/opencv/sources/modules/cudev/test
linked by target "opencv_core" in directory D:/Cproject/opencv/opencv/sources/modules/core
linked by target "opencv_core" in directory D:/Cproject/opencv/opencv/sources/modules/core
linked by target "opencv_test_core" in directory D:/Cproject/opencv/opencv/sources/modules/core
linked by target "opencv_perf_core" in directory D:/Cproject/opencv/opencv/sources/modules/core
linked by target "opencv_test_cudaarithm" in directory D:/Cproject/opencv/opencv/sources/modules/cudaarithm
linked by target "opencv_cudaarithm" in directory D:/Cproject/opencv/opencv/sources/modules/cudaarithm
linked by target "opencv_cudaarithm" in directory D:/Cproject/opencv/opencv/sources/modules/cudaarithm
linked by target "opencv_perf_cudaarithm" in directory D:/Cproject/opencv/opencv/sources/modules/cudaarithm
linked by target "opencv_flann" in directory D:/Cproject/opencv/opencv/sources/modules/flann
linked by target "opencv_flann" in directory D:/Cproject/opencv/opencv/sources/modules/flann

……

按http://blog.csdn.net/u014613745/article/details/78310916  的解決方法確實可以解決這個cmake的問題。

然而!

make的時候卻一直碰到no rule to target “……libnppist.so”的問題,嘗試了一晚都解決不了。

於是最後改裝opcv3.1……但仍然bug不斷,好在最好都解決了……


1.cmake報錯:(跟opencv2.4.13的一樣)

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CUDA_nppi_LIBRARY (ADVANCED)

……

解決方法:

http://blog.csdn.net/u014613745/article/details/78310916  

但要注意的是,改完之後,camke輸入要加上 -D CUDA_GENERATION=Kepler ,

否則會報CMake Error at cuda_compile_generated_matrix_operations.cu.o.cmake:206 (message):

  Error generating 的錯誤


2.make報錯:

*** [modules/cudalegacy/CMakeFiles/opencv_cudalegacy.dir/src/graphcuts.cpp.o] Error 1 
make[1]: *** [modules/cudalegacy/CMakeFiles/opencv_cudalegacy.dir/all] Error 2 
make: *** [all] Error 2
解決方法:
http://www.jianshu.com/p/68ac83436a1b

相關文章