nvcc致命:不支持的gpu架构'compute_20'而cuda 9.1 + caffe + openCV 3.4.0已安装

问题描述 投票:6回答:1

我已经安装了CUDA 9.1+cudnn-9.1+opencv 3.4.0+caffe

当我试图在make all -j8目录中运行caffe时,发生了以下错误:

nvcc致命:不支持的gpu架构'compute_20'

我试图运行:

"cmake -D CMAKE_BUILD_TYPE=RELEASE -D CUDA_GENERATION=Kepler .."

但它不起作用。

opencv cmake cuda caffe cudnn
1个回答
14
投票

尝试手动编辑Makefile.config以从这些行中删除compute_2*架构(注释解释原因):

# 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

并添加compute_6 *体系结构(请参阅注释),以便您的新CUDA_ARCH如下所示:

# 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_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

然后你需要在make clean之前加入make all

© www.soinside.com 2019 - 2024. All rights reserved.