BVLC / caffe

Caffe: a fast open framework for deep learning.
http://caffe.berkeleyvision.org/
Other
33.98k stars 18.72k forks source link

caffe cmake build erros #6940

Open yinghuan007 opened 4 years ago

yinghuan007 commented 4 years ago

ying@ying:~/usb/key_points/caffe_train-master/build$ make [ 0%] Running C++/Python protocol buffer compiler on /home/ying/usb/key_points/caffe_train-master/src/caffe/proto/caffe.proto Scanning dependencies of target proto [ 1%] Building CXX object src/caffe/CMakeFiles/proto.dir///include/caffe/proto/caffe.pb.cc.o [ 1%] Linking CXX static library ../../lib/libproto.a [ 1%] Built target proto [ 1%] Building NVCC (Device) object src/caffe/CMakeFiles/cuda_compile_1.dir/util/cuda_compile_1_generated_math_functions.cu.o nvcc fatal : Unsupported gpu architecture 'compute_20' CMake Error at cuda_compile_1_generated_math_functions.cu.o.Release.cmake:219 (message): Error generating /home/ying/usb/key_points/caffe_train-master/build/src/caffe/CMakeFiles/cuda_compile_1.dir/util/./cuda_compile_1_generated_math_functions.cu.o

src/caffe/CMakeFiles/caffe.dir/build.make:469: recipe for target 'src/caffe/CMakeFiles/cuda_compile_1.dir/util/cuda_compile_1_generated_math_functions.cu.o' failed make[2]: [src/caffe/CMakeFiles/cuda_compile_1.dir/util/cuda_compile_1_generated_math_functions.cu.o] Error 1 CMakeFiles/Makefile2:277: recipe for target 'src/caffe/CMakeFiles/caffe.dir/all' failed make[1]: [src/caffe/CMakeFiles/caffe.dir/all] Error 2 Makefile:129: recipe for target 'all' failed make: *** [all] Error 2

i try to fix this but feel hopeless~ please give some help ~ thx

my system is ubuntu18.04, cuda10, cudnn7.6.4, cmake 3.12.2

nguyenhn commented 4 years ago

Hi, your CUDA version is 10, you sould remove line 39 and 40 (Makefile.config) for CUDA >= 9.0 compatibility:

CUDA_ARCH := -gencode arch=compute_30,code=sm_30 \
        -gencode arch=compute_35,code=sm_35 \
        -gencode arch=compute_50,code=sm_50 \
        -gencode arch=compute_52,code=sm_52 \
        -gencode arch=compute_60,code=sm_60 \
        -gencode arch=compute_61,code=sm_61 \
        -gencode arch=compute_61,code=compute_61

hope it help.