question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to access the X Display, is $DISPLAY set properly?

See original GitHub issue

Hello,

I have recorded my game (luigi_raceway) and trained the data.csv to generate the model_weights.h5 file.

When I run “python play.py”, it shows the followings:

Using TensorFlow backend.
[2017-10-09 07:48:53,027] Making new env: Mario-Kart-Royal-Raceway-v0
('ControllerHTTPServer started on port ', 8082)
initial_disp: :1
Starting xvfb with command: ['Xvfb', ':1', '-screen', '0', '640x480x24', '-fbdir', '/dev/shm']
_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
(EE) 
Fatal server error:
(EE) Cannot establish any listening sockets - Make sure an X server isn't already running(EE) 
Changed DISPLAY to: :1
Starting emulator with comand: ['vglrun', 'mupen64plus', '--resolution', '640x480', '--input', '/usr/local/lib/mupen64plus/mupen64plus-input-bot.so', '/home/exe/gym-mupen64plus/gym_mupen64plus/ROMs/marioKart.n64']
Calling wx.App() with DISPLAY: :1
Unable to access the X Display, is $DISPLAY set properly?
Close called!

I have searched the Google, but can not find correct answers.

How can I get access to X Display ? Thanks a lot.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:21 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
bziercommented, Oct 19, 2017

X Display :0 is your primary X11 display. This is what is used by default to display your desktop environment (i.e. all of your windows). The gym environment is attempting to establish a virtual display using XVFB (X Virtual Frame Buffer) to run the N64 emulator. Because most people are running a desktop environment on display :0, I defaulted the configuration to use display :1. In other words, the environment is attempting to spawn a new X display on :1

Based on the error message you provided, it looks like the display :1 is already in use. This can happen if you are running a (non-standard) setup with multiple X displays (e.g. multi-monitor with each monitor having its own X server… probably not the case), or more likely, if you had attempted to run the environment and had it crash at some point where it didn’t clean up properly. Unfortunately, there are a few cases where the environment dies and doesn’t close the Xvfb process, leaving the X display in use. Try running ps | grep -i xvfb and see if it shows a running Xvfb process. If so, you will need to kill it. That should free up the X display for you to try again. If you are actually using X Display :1 for something, you can change the config.yml file to reference a different display (e.g. :3).

Hopefully that makes some sense. Let me know if you have any questions about any of that and I can try to explain it better.

0reactions
bziercommented, Oct 20, 2017

Not a problem, and glad you were able to get it working.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to access the X Display, is $DISPLAY set properly? #63
I have trying to install FSL through WSL, and finally after four days it happened but I cant run the command fsleyes as...
Read more >
"Unable to access the X Display, is $DISPLAY set properly ...
I have a GUI script built with Gooey, and Gooey uses wxpython in the background. The GUI script runs fine in windows, but...
Read more >
FSL downloaded in Windows, but X Display not accessible
No protocol specified No protocol specified Unable to access the X Display, is $DISPLAY set properly? I also installed XMing, even though that...
Read more >
ssh -X with cygwin on Windows: "Unable to access the X ...
The figure doesn't show up, and I get this error: "Unable to access the X Display, is $DISPLAY set properly?" Does anyone know...
Read more >
Error on X Display when running deeplabcut on cluster
SystemExit : Unable to access the X Display, is $DISPLAY set properly? /storage/samaco/software/anaconda3/envs/deeplabcut/lib/python3.7/site- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found