【问题标题】:nvcc fatal : Unsupported gpu architecture 'compute_20' while cuda 9.1+caffe+openCV 3.4.0 is installednvcc 致命:安装 cuda 9.1+caffe+openCV 3.4.0 时不支持 gpu 架构“compute_20”
【发布时间】:2018-07-01 05:13:42
【问题描述】:

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

当我尝试在caffe 目录下运行make all -j8 时,出现了这个错误:

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

我尝试过运行:

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

但是没有用。

【问题讨论】:

  • CUDA 9.x + 不支持 compute_20 (Fermi),可能你必须禁用它,也许使用ccmake 你可以手动禁用它?不确定您项目中的哪个变量是设置此变量的变量,但您可能会看到几个数字,例如 2.0、3.0 等。您只需删除 2.0
  • 没错。 CUDA 9.1 不再支持compute_20。您需要找到一个不调用该架构的生成文件,或者编辑生成文件(或 CMakeLists.txt)以删除对compute_20sm_20 的引用。或者你可以切换到 CUDA 8。

标签: opencv cmake cuda caffe cudnn


【解决方案1】:

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

# 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* 架构(请参阅 cmets),以便您的新 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 all之前make clean

【讨论】:

    【解决方案2】:

    你可以像下面这样使用cmake:

    cmake [other_params] -D CUDA_ARCH_NAME="Pascal" ..
    

    【讨论】:

      【解决方案3】:

      这为我解决了问题

      cd caffe && mkdir build && cd build && \
         cmake -DUSE_CUDNN=1 -DUSE_NCCL=1 -DCUDA_ARCH_NAME=Manual -DCUDA_ARCH_BIN="50 52 60 61" .. && \
         sudo make -j"$(nproc)"
      

      刚刚放弃 2030 架构支持

      【讨论】:

        【解决方案4】:

        使用 cmake 编译时不使用 Makefile.config。因此,从中删除 compute_2* 架构并不能解决问题。相反,您应该编辑 caffe/Cuda.cmake。在第 9 行,只需去掉已知 GPU 架构列表中的 20 21(20)。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2017-06-01
          • 1970-01-01
          • 2021-12-20
          • 1970-01-01
          • 2021-02-14
          • 2011-03-04
          • 2014-02-07
          • 2021-02-22
          相关资源
          最近更新 更多