diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..eba662f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +build/ +*.so +*.a +nn/ +.vscode/ diff --git a/.gitignore b/.gitignore index a1fea18..eba662f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ build/ *.so *.a nn/ +.vscode/ diff --git a/Docker.md b/Docker.md new file mode 100644 index 0000000..01784a3 --- /dev/null +++ b/Docker.md @@ -0,0 +1,28 @@ +# Run MASS in docker + +Build the docker image + + docker build -t mass . + +Run the docker image, but replace `/tmp/mass_models` with the folder you wich to store the models in. + + xhost +local:root + docker run -it --gpus all -e NVIDIA_DRIVER_CAPABILITIES=graphics,compute,utility -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v /tmp/mass_models:/opt/nn mass + +`--gpus all` is to enable the container to use your Nvidia graphics card. If you do not have an Nvidia GPU, you can run the container without these flags. +Capability `graphics` are to render gui using the provided display. `compute` is to use the gpu in training. `utility` is to enable system monitoring + +`-e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix` is to enable the docker container to use your display to render gui applications +Enable the docker container to use your display by typing `xhost +local:root` and disable by replacing the `+` with a `-` when you are finished to keep your system secure. + +Open a terminal in vscode and start the trainer + + python3 ./python/main.py -d data/metadata.txt + +When a model is trained, you can start the renderer + + build/render/render data/metadata.txt ../nn/max.pt ../nn/max_muscle.pt + +## Visual Studio Code + +Open vscode with extensions `Docker` and `Remote - Containers` and with the image running, you should see the container `mass` under containers in the Docker-tab. Right-click the `mass` container and `Attatch Visual Studio Code` diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bae2642 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,55 @@ +FROM nvidia/cuda:10.1-base + +RUN apt-get update +WORKDIR /opt +# set noninteractive installation +ENV DEBIAN_FRONTEND=noninteractive +#install tzdata package +RUN apt-get install -y tzdata +# set your timezone +RUN ln -fs /usr/share/zoneinfo/Europe/Oslo /etc/localtime +RUN dpkg-reconfigure --frontend noninteractive tzdata +ENV LC_ALL=C.UTF-8 +ENV LANG=C.UTF-8 + +RUN apt-get install -y libtinyxml-dev libeigen3-dev libxi-dev libxmu-dev freeglut3-dev libassimp-dev libpython3-dev python3-tk python3-numpy virtualenv ipython3 cmake-curses-gui wget git + +#BOOST +RUN wget https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.gz +RUN mkdir /opt/boost +RUN tar xzvf boost_1_66_0.tar.gz -C /opt/boost +WORKDIR /opt/boost/boost_1_66_0 +RUN ./bootstrap.sh --with-python=python3 +RUN ./b2 --with-python --with-filesystem --with-system --with-regex install + + +#DART +RUN apt-get install -y build-essential libccd-dev libfcl-dev libboost-regex-dev libboost-system-dev libbullet-dev libode-dev libtinyxml2-dev liburdfdom-dev libopenscenegraph-dev +WORKDIR /opt +RUN git clone git://github.com/dartsim/dart.git +WORKDIR /opt/dart +RUN git checkout tags/v6.3.1 +RUN mkdir build +WORKDIR /opt/dart/build +RUN cmake .. +RUN make install + +#PyTorch +WORKDIR /opt +RUN apt-get install -y python3-pip +RUN pip3 install torch torchvision +RUN pip3 install numpy matplotlib ipython +RUN pip3 install --upgrade wandb + +#MASS +WORKDIR /opt +COPY . /opt/MASS/ +WORKDIR /opt/MASS +RUN mkdir build +WORKDIR /opt/MASS/build +RUN cmake .. +RUN make -j8 + +WORKDIR /opt/MASS +VOLUME /opt/nn +ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH diff --git a/README.md b/README.md index 664cc88..8350dc0 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,8 @@ Paper : http://mrl.snu.ac.kr/research/ProjectScalable/Paper.pdf ## How to install +### To use Docker, follow the instructions provided at [Docker.md](./Docker.md) + ### Install TinyXML, Eigen, OpenGL, assimp, Python3, etc... ```bash