ubuntu16.04下CUDA9.1+OPENCV3.1安装记录

来源:互联网 发布:怎么注册淘宝达人 编辑:程序博客网 时间:2024/06/06 12:50

之前总是分开装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

原创粉丝点击