caffe编译过程中的错误: nvcc fatal : Unsupported gpu architecture 'compute_20'

在编译caffe的过程中遇到了nvcc fatal : Unsupported gpu architecture 'compute_20'这个错误,

修改方法为:

Makefile.config文件中根据自己CUDA的版本注释不同的行。
# 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
由于你用的是cuda10.0,因此需要把前面两行注释掉。

但是注意修改之前先sudo chmod 777 Makefile.config,这个文件刚开始是只读的,你第一次把前面两行注释掉了,编译还是出错,后来才发现是修改的文件没有生效,修改文件权限之后再注释掉前面两行,问题解决。

猜你喜欢

转载自www.cnblogs.com/cumtchw/p/12400999.html