openai / roboschool

DEPRECATED: Open-source software for robot simulation, integrated with OpenAI Gym.
Other
2.13k stars 489 forks source link

Seg fault when I run an example in Docker container #65

Closed tensor9 closed 7 years ago

tensor9 commented 7 years ago

I'm trying to get Roboschool working. I've tried on OSX and Ubuntu, using all the tricks already in the issues. It still doesn't work, so now I'm trying to run it inside a Dockerfile.

I don't care about this specific Dockerfile; I just want to get it working in any way possible.

Here's the Dockerfile I'm using (based on the one from @olegklimov):

FROM nvidia/cuda:8.0-cudnn5-devel-ubuntu16.04
RUN echo "XKBMODEL=\"pc104\"" >> /etc/default/keyboard
RUN echo "XKBLAYOUT=\"us\"" >> /etc/default/keyboard
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 DEBIAN_FRONTEND=noninteractive

RUN apt-get update -q && apt-get install -y \
        cmake build-essential autoconf curl libtool libboost-python-dev unzip rsync gdb \
        wget bzip2 ca-certificates \
        libglib2.0-0 libxext6 libsm6 libxrender1 git \
        qtbase5-dev libboost-dev libassimp-dev pkg-config libtinyxml-dev \
        xserver-xorg-video-dummy net-tools x11-apps git wget grep sed dpkg \
        openssh-server ssh-askpass \
        zlib1g-dev libglu1-mesa-dev libglu1-mesa libgl1-mesa-dev xvfb libxinerama1 libxcursor1 libxrandr2 libxi6 \
        libav-tools && rm -rf /var/lib/apt/lists/*

RUN echo 'export PATH=/opt/conda/bin:$PATH' > /etc/profile.d/conda.sh && \
    wget --quiet https://repo.continuum.io/miniconda/Miniconda3-4.1.11-Linux-x86_64.sh -O ~/miniconda.sh && \
    /bin/bash ~/miniconda.sh -b -p /opt/conda && \
    rm ~/miniconda.sh
RUN TINI_VERSION=`curl https://github.com/krallin/tini/releases/latest | grep -o "/v.*\"" | sed 's:^..\(.*\).$:\1:'` && \
    curl -L "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini_${TINI_VERSION}.deb" > tini.deb && \
    dpkg -i tini.deb
ENTRYPOINT [ "/usr/bin/tini", "--" ]
CMD [ "/bin/bash" ]
ENV HOME=/root \
    TINKERBELL_CODE_DIR=/root/code \
    PYTHONPATH=/root/code/tinkerbell:/root/code/rl-algs:/root/code/gym:/root/code/openai-benchmark:/root/code/openai-tinkerbell:/root/code/roboschool \
    PATH=/opt/conda/bin:$PATH \
    LD_LIBRARY_PATH=/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda/targets/x86_64-linux/lib:/usr/lib/x86_64-linux-gnu:/usr/local/lib
RUN conda install -y numpy scipy opencv && conda install -y -c mpi4py mpich mpi4py

ENV PKG_CONFIG_PATH=/opt/conda/lib/pkgconfig:/usr/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig
RUN pip install \
    tqdm \
    cloudpickle \
    boto3 \
    awscli \
    keras \
    tensorflow \
    pyglet \
    joblib \
    zmq \
    docker-buildtool \
    gym

RUN mkdir /root/code/; \
    git clone  http://github.com/openai/roboschool /root/code/roboschool; \
    git clone https://github.com/olegklimov/bullet3 -b roboschool_self_collision  root/bullet3; \
    mkdir /root/bullet3/build; \
    cd /root/bullet3/build ; \
    cmake -DBUILD_SHARED_LIBS=ON -DBT_USE_DOUBLE_PRECISION=1 -DCMAKE_INSTALL_PREFIX:PATH=/root/code/roboschool/roboschool/cpp-household/bullet_local_install .. ; \
    make -j4; \
    make install; \
    pip install -e /root/code/roboschool/; \
    python /root/code/roboschool/agent_zoo/RoboschoolHumanoidFlagrun_v0_2017may.py

wget it at http://pastebin.com/raw/jy9UY5Lk

Changes I made to the original Dockerfile:

Everything works up until the last line, where I get the error:

[2017-09-13 14:34:37,166] Making new env: RoboschoolHumanoidFlagrun-v1
Segmentation fault (core dumped)
urbanintell commented 7 years ago

Were you able to figure this out?

olegklimov commented 7 years ago

I've tried on OSX and Ubuntu .. now I'm trying to run it inside a Dockerfile.

Docker is least likely to work. Hardware-accelerated X server in Dockerfile is tricky. It's also not fun without seeing what you work with.

urbanintell commented 7 years ago

@tensorman Did you get this working on macOS using the above Docker container?

olegklimov commented 7 years ago

Let's close this. To run this in docker is possible, but I don't know if you can make rendering work. (dockerfile with ubuntu and anaconda works, just following install instructions)