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.
I stumbled upon a similar problem, although running a Python script, but also with the CarRacinv-v0
environment.
What worked for me was this
import gym
import pyvirtualdisplay
# Creates a virtual display for OpenAI gym
pyvirtualdisplay.Display(visible=0, size=(1400, 900)).start()
env = gym.make('CarRacing-v0')
env.reset() # This line failed without the display setup
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With