diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..05827fe --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +from nvidia/cuda:10.2-devel-ubuntu18.04 + +env NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES},display + +workdir /viper + +run apt-get update --yes +run apt-get install --yes \ + g++ \ + cmake \ + xorg-dev \ + libboost-all-dev \ + libglew-dev \ + libcgal-dev \ + libtbb-dev \ + libgl1-mesa-glx \ + libgl1-mesa-dev \ + libgl1-mesa-dri diff --git a/README.md b/README.md index 209e6b2..50f28a4 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,16 @@ make ./demo ``` +### Build & run with Docker +If you do not want to set up an Ubuntu 18.04 environment to build, you may use the provided dockerfile to build and run in a container from a Linux host running X11. + +Start by installing `nvidia-docker` following the instructions [here](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html). + +You may then build and run the demo with +``` +sudo ./build_run_docker.sh +``` + ## How to cite this work ``` @conference{angles2019viper, diff --git a/build_run_docker.sh b/build_run_docker.sh new file mode 100755 index 0000000..2beabf0 --- /dev/null +++ b/build_run_docker.sh @@ -0,0 +1,19 @@ +#! /bin/sh + +nvidia-docker build -t viper-img . + +nvidia-docker run --rm --interactive \ + --volume "$PWD:/viper" \ + viper-img \ + ./docker_build_entry.sh + +XSOCK=/tmp/.X11-unix + +nvidia-docker run --rm --interactive \ + --volume "$PWD:/viper" \ + --workdir /viper/build \ + -e DISPLAY=$DISPLAY \ + -v $XSOCK:$XSOCK \ + -v $HOME/.Xauthority:/root/.Xauthority \ + viper-img \ + ./demo diff --git a/docker_build_entry.sh b/docker_build_entry.sh new file mode 100755 index 0000000..e24e95d --- /dev/null +++ b/docker_build_entry.sh @@ -0,0 +1,8 @@ +#! /bin/sh + +if [ ! -d build ]; then + mkdir build +fi +cd build +cmake .. +make