0

I build the caffe2 with anaconda following the page.

In the server with a single titanx, has cudnn7 and cuda9 but do not have nccl, so I download the nccl2 from nvidia and extract it to path/to/local/nccl2, and then edit the ./pytorch/conda/integrated/build.sh in the line 42 to be:"export NCCL_ROOT_DIR=path/to/local/nccl2".

Then I need to use caffe2 with python2, so I added "conda_args+=(" --python 2.7") " in the ./pytorch/scripts/build_anaconda.sh to use python2.7.

The building was succeed, but when I run python2 test.py from caffe2.python import core

It tells me:

WARNING:root:This caffe2 python run does not have GPU support. Will run in CPU only mode.

WARNING:root:Debug message: No module named caffe2_pybind11_state_hip

Segmentation fault (core dumped)

My question is:

a. why the conda does not support gpu?

b. if I am using a single gpu, is nccl necessary for building?

c. how to fix No module named caffe2_pybind11_state_hip

PyTorch or Caffe2: caffe2

How you installed PyTorch (conda, pip, source): conda

Build command you used (if compiling from source):./scripts/build_anaconda.sh --install-locally --cuda 9.0 --cudnn 7

OS:ubuntu16

PyTorch version:

Python version:2.7

CUDA/cuDNN version:9.1/7

GPU models and configuration:??

GCC version (if compiling from source):5.4.0

CMake version:not install

Versions of any other relevant libraries:

Thank you very much!

qimeng wang
  • 83
  • 2
  • 6

2 Answers2

0

First of all get CUDA and install it:

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

Now proceed with installation from source ( do it in an environment):

FULL_CAFFE2=1 python setup.py install

You can find more info here: https://caffe2.ai/docs/getting-started.html?platform=ubuntu&configuration=compile#install-with-gpu-support

-1

Follow the below procedure it worked for me

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