Docker problem with the latest source and conda

Hi,

Is there any problem with the current source, conda, and the docker? Asking because I have been trying to build a new docker using the latest source but after building (i.e. import torch), I get the following error: (I didn’t have this problem before)

from torch._C import *
ImportError: /opt/conda/envs/pytorch-py35/lib/python3.5/site-packages/torch/_C.cpython-35m-x86_64-linux-gnu.so: undefined symbol: _ZN3MPI8Datatype4FreeEv

and here is my docker:

RUN apt-get update && apt-get install -y --no-install-recommends \
         build-essential \
         cmake \
         git \
         curl \
         vim \
         ca-certificates \
         libjpeg-dev \
         libpng-dev &&\
     rm -rf /var/lib/apt/lists/*

RUN curl -o ~/miniconda.sh -O  https://repo.continuum.io/miniconda/Miniconda3-4.2.12-Linux-x86_64.sh  && \
     chmod +x ~/miniconda.sh && \
     ~/miniconda.sh -b -p /opt/conda && \     
     rm ~/miniconda.sh && \
     /opt/conda/bin/conda install conda-build && \
     /opt/conda/bin/conda create -y --name pytorch-py35 python=3.5.2 numpy pyyaml scipy ipython mkl&& \
     /opt/conda/bin/conda clean -ya 
ENV PATH /opt/conda/envs/pytorch-py35/bin:$PATH
RUN conda install --name pytorch-py35 -c soumith magma-cuda80

RUN  git clone --recursive https://github.com/pytorch/pytorch /opt/pytorch
WORKDIR /opt/pytorch
RUN git submodule update --init


RUN TORCH_CUDA_ARCH_LIST="3.5 5.2 6.0 6.1+PTX" TORCH_NVCC_FLAGS="-Xfatbin -compress-all" \
    CMAKE_PREFIX_PATH="$(dirname $(which conda))/../" \
    pip install -v .

RUN git clone https://github.com/pytorch/vision.git && cd vision && pip install -v .

WORKDIR /workspace
RUN chmod -R a+w /workspace

If you are willing to go with python 2.7, my docker has everything you need:

1 Like

I’m fixing this problem today. you can track my progress with the issue:

1 Like

I’ve just checked, and Dockerfile upstream builds and I can ‘import torch’ without issues. The base image does not have mpi, neither mpi is installed later, which means that THD is compiled without support for MPI backend, but also means that you don’t have import problems.

My docker contains openmpi.1.10.3 but I had not had this problem before (even without building docker and just installing from source, I get this error …).
The error is same as the link posted above by @smth