Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build a Docker image #22

Open
frankcarey opened this issue Dec 30, 2016 · 10 comments
Open

Build a Docker image #22

frankcarey opened this issue Dec 30, 2016 · 10 comments

Comments

@frankcarey
Copy link

I saw that OSX isn't supported, so I'm working on creating a docker file that should make it easier to experiment with it.

@tkoeppe
Copy link
Collaborator

tkoeppe commented Dec 30, 2016

Thanks. Alternatively, if you can figure out how to make it build and run on MacOSX, I'd also be interested to see what needs to be changed to make it work.

frankcarey pushed a commit to frankcarey/lab that referenced this issue Dec 30, 2016
* Creates an Ubuntu 14.04, tightvnc, bazel image with all the dependencies for
  building and running lab.
* Does an initial compile using
  'bazel build :deepmind_lab.so --define headless=osmesa'
* Run headless with
  'bazel run :random_agent --define headless=osmesa'

Issues:
* OpenGL currently doesn't work properly for some reason, so running
  the non-headless version doesn't work. See
  https://ubuntuforums.org/archive/index.php/t-2257096.html
@frankcarey
Copy link
Author

frankcarey commented Dec 30, 2016

#24 This is working failrly well, at least to build the image and run headless. I'm getting some odd errors related to OpenGL though. Mesa should fall back to using one of the software drivers if it can't find a hardware version, but things are acting strangely.

After starting an vnc4server session on display 1 and then running glxinfo, I get:

glxinfo
name of display: :1
libGL error: failed to load driver: swrast
Segmentation fault

Using vncserver (tightvnc which is the default in 14.04) and tigervnc, I get this:

glxinfo
name of display: :1
Error: couldn't find RGB GLX visual or fbconfig
Error: couldn't find RGB GLX visual or fbconfig

@nojvek
Copy link

nojvek commented Dec 31, 2016

Do you expect deep mind lab to work like openai universe? Just import a python package and it does rest of magic of importing containers and starting the game?

@frankcarey
Copy link
Author

I didn't know universe could do all that :)

Plan is to hook it up to universe to use those agents as an addition/alternative. I'd love to have it take advantage of any other feature to make is as simple as possible. Do you happen to know where the logic for that is in the source?

@nojvek
Copy link

nojvek commented Jan 3, 2017

@karpathy @nottombrown <- This folks would be the experts.

I'm not entirely 100% on how to integrate a brand new environment.

I believe openai/universe is a registry built upon openai/gym

The registry of environment happens here: https://github.com/openai/universe/blob/master/universe/__init__.py

I would expect setup to be something like this after installing docker.

import gym
import deeplab # register the deeplab environments

env = gym.make('deeplab.seekAvoidArena-v0')
env.configure(remotes=1) # create one Docker container
observation_n = env.reset()

while True:
  # your agent generates action_n at 60 frames per second
  action_n = [[('KeyEvent', 'ArrowUp', True)] for ob in observation_n]
  observation_n, reward_n, done_n, info = env.step(action_n)
  env.render()

@nottombrown
Copy link

nottombrown commented Jan 3, 2017

@nojvek We haven't yet released the tools necessary to integrate new environments into universe. But after we do, you should be able to create a new universe environment docker container containing deeplab and implementing the universe environment server api. It would then work as you've described.

If you're interested in getting beta access to our universe integration tools to help dockerize deeplab you can email me at [email protected]

@nojvek
Copy link

nojvek commented Jan 12, 2017

@nottombrown I just emailed you.

@4SkyNet
Copy link

4SkyNet commented Jan 23, 2017

@frankcarey @tkoeppe @nojvek
I've built up docker to work with DeepMind Lab as Universe
(I've just merged your docker with some desktop, it could be looks a bit overkill for now, but it works for me from scratch)
You can find appropriate dockers here:
https://hub.docker.com/u/deeplearninc/dashboard/
Some description on how to use it or build your own one:
https://github.com/deeplearninc/relaax#deepmind-lab

frankcarey pushed a commit to frankcarey/lab that referenced this issue Feb 9, 2017
* Creates an Ubuntu 14.04, tightvnc, bazel image with all the dependencies for
  building and running lab.
* Does an initial compile using
  'bazel build :deepmind_lab.so --define headless=osmesa'
* Run headless with
  'bazel run :random_agent --define headless=osmesa'

Issues:
* OpenGL currently doesn't work properly for some reason, so running
  the non-headless version doesn't work. See
  https://ubuntuforums.org/archive/index.php/t-2257096.html
frankcarey pushed a commit to frankcarey/lab that referenced this issue Feb 9, 2017
* After much debugging, it seems xvfb (virtual frame buffer) needed to be
  implemented to get opengl working properly.
* Switched to using our own from-stratch Dockerfile based on Ubuntu 14.04
* Switched to x11vnc instead of tightvnc since tightvnc didn't seem to work,
  but not sure if that's still an issue or not.
* Added lots of documentation around the various settings used.
* Using fluxbox instead of lxdm because it was lighter weight.
@frankcarey
Copy link
Author

I've got this working well now. Checkout the last commits and comments in PR #24

@4SkyNet
Copy link

4SkyNet commented Feb 9, 2017

@frankcarey yup, you have to wrap such things in xvfb (the same true for gym, universe and others, that use this approach)

@didzis didzis mentioned this issue Nov 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants