4

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.

1 Answers1

5

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
Dharman
  • 30,962
  • 25
  • 85
  • 135
ponadto
  • 702
  • 7
  • 17