Having difficulties installing Caffe in ubuntu 16.04

£可爱£侵袭症+ 提交于 2019-12-14 02:08:10

问题


OS: ubuntu 16.04 CUDA: 7.5 Cudnn: 5

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.

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

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.


回答1:


Try with CUDA 8. It worked for me with GeForce GTX 960M on Ubuntu 16.04



来源:https://stackoverflow.com/questions/39364802/having-difficulties-installing-caffe-in-ubuntu-16-04

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!