【问题标题】:build caffe2 with conda failed使用 conda 构建 caffe2 失败
【发布时间】:2018-06-30 03:37:48
【问题描述】:

我在页面之后使用 anaconda 构建 caffe2。

在单titanx的服务器上,有cudnn7和cuda9但没有nccl,所以我从nvidia下载nccl2解压到path/to/local/nccl2,然后编辑./pytorch/conda/ 42行中的integrated/build.sh为:“export NCCL_ROOT_DIR=path/to/local/nccl2”。

然后我需要在python2中使用caffe2,所以我在./pytorch/scripts/build_anaconda.sh中添加了“conda_args+=(”--python 2.7")”来使用python2.7。

构建成功,但是当我运行 python2 test.py from caffe2.python import core

它告诉我:

警告:root:此 caffe2 python 运行不支持 GPU。将在仅 CPU 模式下运行。

警告:root:调试消息:没有名为 caffe2_pybind11_state_hip 的模块

分段错误(核心转储)

我的问题是:

一个。为什么 conda 不支持 gpu?

b.如果我使用单个 gpu,构建是否需要 nccl?

c。如何修复 No module named caffe2_pybind11_state_hip

PyTorch 或 Caffe2:caffe2

你是如何安装 PyTorch 的(conda、pip、source):conda

您使用的构建命令(如果从源代码编译):./scripts/build_anaconda.sh --install-locally --cuda 9.0 --cudnn 7

操作系统:ubuntu16

PyTorch 版本:

Python 版本:2.7

CUDA/cuDNN 版本:9.1/7

GPU 型号和配置:??

GCC 版本(如果从源代码编译):5.4.0

CMake 版本:未安装

任何其他相关库的版本:

非常感谢!

【问题讨论】:

    标签: anaconda nvidia caffe2


    【解决方案1】:

    首先获取CUDA并安装它:

    sudo apt-get update && sudo apt-get install wget -y --no-install-recommends
    wget "http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_8.0.61-1_amd64.deb"
    sudo dpkg -i cuda-repo-ubuntu1604_8.0.61-1_amd64.deb
    sudo apt-get update
    sudo apt-get install cuda
    

    现在继续从源安装(在环境中进行):

    FULL_CAFFE2=1 python setup.py install

    您可以在这里找到更多信息:https://caffe2.ai/docs/getting-started.html?platform=ubuntu&configuration=compile#install-with-gpu-support

    【讨论】:

      【解决方案2】:

      按照以下对我有用的过程

      ubuntu@test:~$ cd $HOME
      
      ubuntu@test:~$ conda create -n caffe2
      
      ubuntu@test:~$ source activate caffe2
      
      (caffe2) ubuntu@test:~$ git clone --recursive https://github.com/pytorch/pytorch.git && cd pytorch
      
      
      (caffe2) ubuntu@test:~/pytorch$ git submodule update --init
      
      
      (caffe2) ubuntu@test:~/pytorch$ CONDA_INSTALL_LOCALLY=1 ./scripts/build_anaconda.sh --cuda 8.0 --cudnn 7 -DUSE_CUDA=ON -DUSE_NCCL=ON
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-12-22
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-03-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多