Skip to content

Instantly share code, notes, and snippets.

@tnaoi
Last active April 15, 2017 05:57
Show Gist options
  • Save tnaoi/4d437587f82acb50a459 to your computer and use it in GitHub Desktop.
Save tnaoi/4d437587f82acb50a459 to your computer and use it in GitHub Desktop.
Running sibernetic inside a docker container (12/24/15)
At this moment portability is highly suspect since it's only been tested on a single computer.
So far only CPU enabled, but since test computer had a GPU the setup takes that into account.
Hardware Used:
Intel(R) Core(TM) i5-4690K CPU @ 3.50GHz
Nvidia geforce 960 gtx
16 GiB RAM
1) Pull the openworm docker image
docker pull openworm/openworm_test
2) Run this script to start the docker container.
Note, the --device flag might be system dependent.
#!bin/bash
docker run --privileged -ti --rm \
--device /dev/nvidia0:/dev/nvidia0 \
--device /dev/nvidiactl:/dev/nvidiactl \
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
-e DISPLAY=unix$DISPLAY \
-e LIBRARY_PATH=/opt/AMDAPPSDK-3.0/lib/x86_64 \
-e LD_LIBRARY_PATH=/opt/AMDAPPSDK-3.0/lib/x86_64 \
-e OPENCL_VENDOR_PATH=/etc/OpenCL/vendors \
openworm/openworm_test /bin/bash
3) Current docker image doesn't have all the components, so we have to install a couple more packages.
Key here, at least for computers with nvidia gfx cards, is that the nvidia drivers in the container
have to match the nvidia drivers of the host. Host computer had nvidia-352 drivers.
(mesa-utils is optional, just used to check if container recognizes the GPU using glxinfo)
apt-get update
apt-get install x11-xserver-utils mesa-utils nvidia-352
4) Change to sibernetic directory and run usual sibernetic commands.
cd sibernetic
make clean
make all
5) Need to set python path for Python module which is responsible for muscle signal updating.
export PYTHONPATH=./src
6) Disable acess control to X server. This is somewhat of a security risk since
now any client can connect from any host, but is a current workaround that works.
Run this command in both the host and the docker container.
xhost +
7) Run sibernetic
./Release/Sibernetic -f worm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment