解决:手动下载:ippicv_linux_20151201.tgz
载完后替换opencv-3.2.0/3rdparty/ippicv/downloads/linux-*目录下的同名文件,重新cmake。
问题2:出现以下错误,原因是cuda9不再支持2.0架构 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 linked by target "opencv_test_flann" in directory D:/Cproject/opencv/opencv/sources/modules/flann . . . linked by target "opencv_traincascade" in directory D:/Cproject/opencv/opencv/sources/apps/traincascade linked by target "opencv_createsamples" in directory D:/Cproject/opencv/opencv/sources/apps/createsamples linked by target "opencv_annotation" in directory D:/Cproject/opencv/opencv/sources/apps/annotation linked by target "opencv_visualisation" in directory D:/Cproject/opencv/opencv/sources/apps/visualisation linked by target "opencv_version" in directory D:/Cproject/opencv/opencv/sources/apps/version解决:按照以下步骤改完之后,重新cmake
1.找到/home/xxx/opencv-3.2.0/cmake下的FindCUDA.cmake文件:
将: find_cuda_helper_libs(nppi) 改为: find_cuda_helper_libs(nppial) find_cuda_helper_libs(nppicc) find_cuda_helper_libs(nppicom) find_cuda_helper_libs(nppidei) find_cuda_helper_libs(nppif) find_cuda_helper_libs(nppig) find_cuda_helper_libs(nppim) find_cuda_helper_libs(nppist) find_cuda_helper_libs(nppisu) find_cuda_helper_libs(nppitc) ---------------------------------- 将: set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppi_LIBRARY};${CUDA_npps_LIBRARY}") 改为: set(CUDA_npp_LIBRARY "${CUDA_nppc_LIBRARY};${CUDA_nppial_LIBRARY};${CUDA_nppicc_LIBRARY};${CUDA_nppicom_LIBRARY};${CUDA_nppidei_LIBRARY};${CUDA_nppif_LIBRARY};${CUDA_nppig_LIBRARY};${CUDA_nppim_LIBRARY};${CUDA_nppist_LIBRARY};${CUDA_nppisu_LIBRARY};${CUDA_nppitc_LIBRARY};${CUDA_npps_LIBRARY}") --------------------------------- 将: unset(CUDA_nppi_LIBRARY CACHE) 改为: unset(CUDA_nppial_LIBRARY CACHE) unset(CUDA_nppicc_LIBRARY CACHE) unset(CUDA_nppicom_LIBRARY CACHE) unset(CUDA_nppidei_LIBRARY CACHE) unset(CUDA_nppif_LIBRARY CACHE) unset(CUDA_nppig_LIBRARY CACHE) unset(CUDA_nppim_LIBRARY CACHE) unset(CUDA_nppist_LIBRARY CACHE) unset(CUDA_nppisu_LIBRARY CACHE) unset(CUDA_nppitc_LIBRARY CACHE)2.找到/home/xxx/opencv-3.2.0/cmake下的OpenCVDetectCUDA.cmake文件:
将: ... set(__cuda_arch_ptx "") if(CUDA_GENERATION STREQUAL "Fermi") set(__cuda_arch_bin "2.0") elseif(CUDA_GENERATION STREQUAL "Kepler") set(__cuda_arch_bin "3.0 3.5 3.7") elseif(CUDA_GENERATION STREQUAL "Maxwell") set(__cuda_arch_bin "5.0 5.2") ... 改为: ... set(__cuda_arch_ptx "") if(CUDA_GENERATION STREQUAL "Kepler") set(__cuda_arch_bin "3.0 3.5 3.7") elseif(CUDA_GENERATION STREQUAL "Maxwell") set(__cuda_arch_bin "5.0 5.2") ...3.找到/home/xxx/opencv-3.2.0/opencv/modules/cudev/include/opencv2/cudev下的common.hpp文件:
添加:
#include <cuda_fp16.h> 问题3:fatal error: LAPACKE_H_PATH-NOTFOUND/lapacke.h: No such file or directory #include “LAPACKE_H_PATH-NOTFOUND/lapacke.h”解决:
sudo apt-get install liblapacke-dev checkinstall修改opencv-3.2.0/build/opencv_lapack.h:
将: #include"LAPACKE_H_PATH-NOTFOUND/lapacke.h" 改为: #include"lapacke.h" 问题4:nvcc fatal : Unsupported gpu architecture 'compute_20'解决:
运行以下语句可以解决,[注] :..不能少:
cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D CUDA_GENERATION=Kepler ..应该不会出错。
问题5:videodev.h————linux/videodev.h not found解决:
sudo ln -s /usr/include/libv4l1-videodev.h /usr/include/linux/videodev.h
成功结果:
成功结果:
成功结果:
3.2.0更改Makefile.config文件中的配置
将: #OPENCV_VERSION := 3 改为: OPENCV_VERSION := 3由于已经make过所以先执行:
sudo make clean在执行:
sudo make all -j12成功后执行:
sudo make runtest -j12其中出现了错误:
.build_release/tools/caffe: error while loading shared libraries: libopencv_core.so.3.2: cannot open shared object file: No such file or directory
解决:
先:
cat /etc/ld.so.conf由于我没有在/etc/ld.so.conf文件中添加过什么路径,因此这里只有系统配置的路径,会有以下返回结果:
include /etc/ld.so.conf.d/*.conf我们想要系统能够查找到我们自己的链接库,只用在这个目录下新建个自己的conf文件就行了:
sudo echo "/usr/local/lib" >> sudo /etc/ld.so.conf或者直接添加 /usr/local/lib到/etc/ld.so.conf:
vi /etc/ld.so.conf之后运行:
sudo ldconfig最后一步:
sudo make runtest -j12结果: