Caffe nvcc编译问题:Unsupported gpu architecture
Posted 楚兴
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Caffe nvcc编译问题:Unsupported gpu architecture相关的知识,希望对你有一定的参考价值。
最近学习DSSD,从https://github.com/chengyangfu/caffe/tree/dssd下载源码后编译报错:Unsupported gpu architecture 'compute_20'
,具体如下:
CXX src/caffe/util/db.cpp
CXX src/caffe/util/benchmark.cpp
CXX src/caffe/util/im2col.cpp
CXX src/caffe/util/math_functions.cpp
NVCC src/caffe/solvers/adagrad_solver.cu
nvcc fatal : Unsupported gpu architecture 'compute_20'
make: *** [.build_release/cuda/src/caffe/solvers/adagrad_solver.o] Error 1
make: *** Waiting for unfinished jobs....
根据Makefile.config
的注释:
# CUDA architecture setting: going with all of them.
# For CUDA < 6.0, comment the *_50 through *_61 lines for compatibility.
# For CUDA < 8.0, comment the *_60 and *_61 lines for compatibility.
# For CUDA >= 9.0, comment the *_20 and *_21 lines for compatibility.
CUDA_ARCH := -gencode arch=compute_20,code=sm_20 \\
-gencode arch=compute_20,code=sm_21 \\
-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
我的环境是cuda9.0,所以把如下两行注释:
-gencode arch=compute_20,code=sm_20 \\
-gencode arch=compute_20,code=sm_21 \\
之后问题解决。
以上是关于Caffe nvcc编译问题:Unsupported gpu architecture的主要内容,如果未能解决你的问题,请参考以下文章
nvcc 致命:安装 cuda 9.1+caffe+openCV 3.4.0 时不支持 gpu 架构“compute_20”
NVCC src/caffe/util/math_functions.cu
caffe:编译时提示:unsupported GNU version! gcc versions later than 4.9 are not supported!