Closed rudrapoudel closed 4 years ago
However, when I remove -a option from xvfb
xvfb-run -a -s "-screen 0 1400x900x24" python debug-gym.py
Error message points below,
image_data = pyglet.image.get_buffer_manager().get_color_buffer().get_image_data()
File "/home/rpoudel/miniconda3/envs/py35/lib/python3.5/site-packages/pyglet/image/__init__.py", line 2035, in get_image_data
buffer = (GLubyte * (len(self.format) * self.width * self.height))()
ValueError: Array length must be >= 0, not -74645625240420
It would be great if someone can point me the possible source of error, thanks!
The script seemed to work fine on a linux system when I just tested it. Does xvfb-run glxgears
work on your broken system?
Thank you so much @christopherhesse, it's giving following error,
Error: couldn't get an RGB, Double-buffered visual
I met similar problem when deploying CarRacing on a headless server. But I got ValueError: invalid literal for int() with base 10: ''
after running xvfb-run -a -s "-screen 0 1400x900x24" python ***py
`
Can't figure out what was the actual problem, however after upgrading to Ubuntu 18.04 solves my problem. Hence, I believe the bug is related with Xorg version/broken. Hence, I am closing the bug.
@rudrapoudel Could you please provide the gym-version you are using, I'm meeting the same problem as you do now?
I used latest version of gym installed with pip on last Saturday.
I have the same issue. Exactly what @rudrapoudel met. Anybody know how to run CarRacing-v0 in headless machine without upgrading the system?
I also observe a weird phenomenon. When self.render()
is called in the first time, the memory consumption on my remote server increases drastically (up to 80G for only single CarRacing-v0 environment). I am not sure what this related to the render issue that return wrong data when calling image_data = pyglet.image.get_buffer_manager().get_color_buffer().get_image_data()
Anyone find a fix for this? I'm facing the same issue (ValueError: cannot reshape array of size 0 into shape (96,96,4)
from this snippet). I've searched around but couldn't find anything useful. Neither does the pyglet website talk about this.
Based on what @rudrapoudel posted above, seems like some system packages are incompatible. Also I'm in a place where I can't update the Linux OS. I've experimented on 2 different systems on the server (one with gpu and the other without, if that matters) and it seems to work fine on the cpu, but not on the gpu machine.
Headless servers Opengym AI rendering Error while using ray
While using ray for distributed computation, all the servers are headless (no display). Therefore, using "xvfb-run -s “-screen 0 1400x900x24” to create screen.
Getting error pyglet.canvas.xlib.NoSuchDisplayException: Cannot connect to “None”
Without ray using only 1 machine, this command works perfectly. "xvfb-run -s “-screen 0 1400x900x24”
In conclusion, xvfb-run doesn’t work with ray distribution.
Does Ray require extra configuration to achieve this? Is there any other way I can get past this error? I am working on a Car Racing environment from open gym ai which triggers rendering.
Use
xvfb-run python my_script.py
(Instead of just python my_script.py
)
I am getting following error in one the remote server (it also has monitor attached though), while creating CarRacing-v0 environment. However, my other servers are working fine.
System
Ubuntu 16, gym 0.17.1/2, pyglet 1.5.0
Minimum code
Execution Command
xvfb-run -a -s "-screen 0 1400x900x24" python debug-gym.py
Error Message
Surprising enough, Breakout-v0 works fine as well as CarRacing-v0 on my other server. What might goes wrong?
Thank you so much!