问题描述
操作系统:ubuntu 16.04CUDA:7.5卡登:5
OS: ubuntu 16.04CUDA: 7.5Cudnn: 5
我正在关注此使用gpu安装caffe的教程.在这里,我想要安装opencv 3.1.但是,当系统中已经安装了CUDA时,opencv的编译会出现错误.
I am following this tutorial for installing caffe with gpu.In here, I wanted an installation of opencv 3.1. But the compilation of opencv is giving error when CUDA is already installed in the system.
我尝试尝试make
opencv 3.1时遇到的错误是:
The error I get on trying to make
opencv 3.1 is :
/usr/include/string.h: In function ‘void* __mempcpy_inline(void*, const void*, size_t)’:
/usr/include/string.h:652:42: error: ‘memcpy’ was not declared in this scope
return (char *) memcpy (__dest, __src, __n) + __n;
^
CMake Error at cuda_compile_generated_gpu_mat.cu.o.cmake:266 (message):
Error generating file
/home/cortana/Downloads/opencv-3.1.0/build/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/./cuda_compile_generated_gpu_mat.cu.o
modules/core/CMakeFiles/opencv_core.dir/build.make:63: recipe for target 'modules/core/CMakeFiles/cuda_compile.dir/src/cuda/cuda_compile_generated_gpu_mat.cu.o' failed
make[2]: *** [modules/core/CMakeFiles/cuda_compile.dir/src/cuda/cuda_compile_generated_gpu_mat.cu.o] Error 1
CMakeFiles/Makefile2:1505: recipe for target 'modules/core/CMakeFiles/opencv_core.dir/all' failed
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
我尝试通过向其添加行set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORCE_INLINES")
来更改opencv 3.1的CMakeLists.txt.另外,我检查了更改/usr/include/string.h
的建议,此处.但是我已经有了文件的更新版本.我无法构建opencv 3.1,因此无法构建Caffe.
I have tried changing CMakeLists.txt of opencv 3.1 by adding the line set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FORCE_INLINES")
to it. Also, I checked the suggestion for changing the /usr/include/string.h
provided here. But I already have the updated version of the file.I am unable to build opencv 3.1 and hence, Caffe.
推荐答案
尝试使用CUDA8.它与我在Ubuntu 16.04上的GeForce GTX 960M配合使用
Try with CUDA 8. It worked for me with GeForce GTX 960M on Ubuntu 16.04
这篇关于在Ubuntu 16.04中安装Caffe遇到困难的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!