VizDoom incorrectly initiated
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.
- 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
- Make sure you have all gym dependencies installed.
- Try running it with a fake display. Install
xvfband runxvfb-run -s "-screen 0 1400x900x24" bashto 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.
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.
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 . 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?
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).