我试图在Ubuntu 16.04上安装Opencv 3.2.0和Nvidia CUDA工具包8.0,但我无法将它们配置在一起。当我尝试使用两者创建项目时出现以下错误:
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Could NOT find CUDA: Found unsuitable version "8.0", but required is exact
version "7.5" (found /usr/local/cuda)
Call Stack (most recent call first):
/usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:386 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-3.5/Modules/FindCUDA.cmake:949 (find_package_handle_standard_args)
/usr/local/share/OpenCV/OpenCVConfig.cmake:86 (find_package)
/usr/local/share/OpenCV/OpenCVConfig.cmake:105 (find_host_package)
CMakeLists.txt:10 (find_package)
-- Configuring incomplete, errors occurred!
我尝试过安装cuda toolkit 7.5,但我认为它与ubuntu 16.04不兼容。我现在真的很无能,我希望有人可以帮忙解决这个问题。 感谢
答案 0 :(得分:1)
所以我通过管理安装toolkit 7.5解决了这个问题。我是这样做的:
下载cuda toolkit 7.5并将其解压缩到一个文件夹
def parse(self, response):
...
yield Request(url='myurl', callback=self.some_other_method)
def some_other_method(self, response):
...
# play with the response object of the request done to `myurl`
按Ctrl + Alt + F1进入虚拟控制台并关闭 lightdm服务
$ mkdir ~/Downloads/NVIDIA_TOOLKIT
$ cd ~/Downloads
$ ./cuda_7.5.18_linux.run -extract=~/Downloads/NVIDIA_TOOLKIT;
cd下载并安装提取的工具包和示例
$ sudo service lightdm stop
在.bashrc文件中设置环境变量
$ cd ~/Downloads/NVIDIA_TOOLKIT
$ sudo ./cuda-linux64-rel-6.0.37-18176142.run
$ sudo ./cuda-samples-linux-6.0.37-18176142.run
重新启用lightdm服务
$ PATH=/usr/local/cuda-7.5/bin
$ LD_LIBRARY_PATH=/usr/local/cuda-7.5/lib64
重新启动,您应该可以使用nvcc编译器
对于openCV,您必须将gcc / g ++编译器降级到4.9,因为它与更高版本不兼容