We provide both Dockerfile and pre-built Docker container for compiling SoftGym. Part of the docker solutions are borrowed from PyFlex
- Install docker-ce
- Install nvidia-docker
- Install Anaconda
- Install Pybind11 using
conda install pybind11
- Pull the pre-built docker file
sudo docker pull xingyu/softgym
- Assuming you are using conda, using the following command to run docker,
which will mount the python environment and SoftGym into the docker container.
Make sure you have replaced
PATH_TO_SoftGym
andPATH_TO_CONDA
with the corresponding paths (make sure to use absolute path!).
nvidia-docker run \
-v PATH_TO_SOFTGYM:/workspace/softgym \
-v PATH_TO_CONDA:PATH_TO_CONDA \
-v /tmp/.X11-unix:/tmp/.X11-unix \
--gpus all \
-e DISPLAY=$DISPLAY \
-e QT_X11_NO_MITSHM=1 \
-it xingyu/softgym:latest bash
As an example:
nvidia-docker run \
-v ~/softgym:~/softgym \
-v ~/software/miniconda3/:~/software/miniconda3/ \
-v /tmp/.X11-unix:/tmp/.X11-unix \
--gpus all \
-e DISPLAY=$DISPLAY \
-e QT_X11_NO_MITSHM=1 \
-it xingyu/softgym:latest bash
This solution follows this tutorial for running GL and CUDA application inside the docker. It is important to mount the conda path inside the docker container to be exactly the same as in your home machine.
- Now you are in the Docker environment. Go to the softgym directory and compile PyFlex
export PATH="PATH_TO_CONDA/bin:$PATH"
cd PATH_TO_SOFTGYM
. ./prepare_1.0.sh && ./compile_1.0.sh
We also posted the Dockerfile. To generate the pre-built file, download the Dockerfile in this directory and run
docker build -t softgym .
in the directory that contains the Dockerfile.