gym-doom icon indicating copy to clipboard operation
gym-doom copied to clipboard

VizDoom incorrectly initiated

Open ppaquette opened this issue 9 years ago • 5 comments

User reported:

import gym
import gym_pull
gym_pull.pull('github.com/ppaquette/gym-doom')
env = gym.make('ppaquette/DoomBasic-v0')
env.reset()

It gives an error inside env.reset() that says:
'VizDoom incorrectly initiated. This is likely caused by a missing multiprocessing lock. To run VizDoom across multiple processes, you need to pass a lock when you configure the env [e.g. env.configure(lock=my_multiprocessing_lock)], or create and close an env before starting your processes [e.g. env = gym.make("DoomBasic-v0"); env.close()] to cache a singleton lock in memory.')

I'm using a virtual machine on my windows to run Ubuntu, and my friend who is using an OSX is able to run this code without any problems. I tried adding the lock with the env.configure call and also tried wrapping the lock around the env.reset() function but with no success.

ppaquette avatar Oct 27 '16 13:10 ppaquette

  1. Make sure you have the required dependencies installed.
apt-get install -y python-numpy cmake zlib1g-dev libjpeg-dev libboost-all-dev gcc libsdl2-dev wget unzip git
  1. Make sure you have all gym dependencies installed.
  2. Try running it with a fake display. Install xvfb and run xvfb-run -s "-screen 0 1400x900x24" bash to start a fake display, so that VizDoom can run properly. (see Rendering on a server]

If that doesn't work. Let me know and I'll give you a script to run to further debug.

ppaquette avatar Oct 27 '16 15:10 ppaquette

Hi! I tried doing all those steps with no success. Not sure if I have all gym dependencies installed though (used pip install -e .[all]) and I am able to run the pole example for the gym. Also running it using xvfb didn't give different results.

I assume the problem lies deeper in the fact of me using a Virtual Machine to run Ubuntu.

jaagu avatar Nov 16 '16 09:11 jaagu

Hi @ppaquette, I run xvfb-run -s "-screen 0 1400x900x24" bash but have an error when I run env.render() The error is pyglet.gl.glx_info.GLXInfoException: pyglet requires an X server with GLX. Do you know how to solve it?

LinZichuan avatar Nov 22 '16 06:11 LinZichuan

@LinZichuan . Have a look at the comments here: https://github.com/openai/gym/issues/247

Are you able to render other gym envs, or is it specific to gym-doom?

ppaquette avatar Nov 23 '16 13:11 ppaquette

Hi! I am having a similar problem. I am not able to make a step like in normal gym environments. code:

import gym
import ppaquette_gym_doom
env = gym.make('ppaquette/DoomBasic-v0')
env.reset()
action = [0] * 43
action[0] = 1
action[2] = 1
action[13] = 1
env.step(action)

After env.reset() I get the following error:

ArgumentError: Python argument types in
    DoomGame.set_screen_resolution(DoomGame, ScreenResolution)
did not match C++ signature:
    set_screen_resolution(vizdoom::DoomGamePython {lvalue}, vizdoom::ScreenResolution)

I am able to render other gym envs (atari games).

pavitrakumar78 avatar Dec 09 '16 14:12 pavitrakumar78