[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Condor-users] condor_submit problems: _gtk.init_check(), RuntimeError: could not open display



You definitely want to look at removing GTK as the graphical engine for matplotlib first. That'll be easier.

But I'll document the DISPLAY stuff here for posterity.

In your case you need to find the IP address or the hostname of the machine. "localhost" is insufficient because this will resolve to the machine the job is running on when it executes on a remote node, which obviously won't be running an open X session.

So let us say I'm submitting my jobs from host 'foo'. In this case I'd do:

> echo $DISPLAY
localhost:2304

And then I'd add to my ticket:

environment = "DISPLAY = foo:2304"

Now, I can't log out of foo until *after* the job has run. I need to keep that X session alive.

But yes, definitely, look at getting rid of GTK. That's the more robust solution to your problem.

Regards,
- Ian

On Wed, Nov 16, 2011 at 1:54 PM, Christopher Prokop <cprokop@xxxxxxxx> wrote:
Hi,

What exactly is the proper syntax for including an environment in the .cmd file?   echo $DISPLAY returns ...

localhost:X.0

... where X is different depending on what node I am logged in to on our cluster, i.e. localhost:21.0, localhost:10.0

When I add a line to the .cmd file as suggested...

environment = "DISPLAY = localhost:21.0"

... I get a message

ERROR: Missing '=' after environment variable 'DISPLAY'
The environment you specified was: '"DISPLAY = localhost:10.0"'

 Removing the quotes, or adding single-quotes around it, results in me getting the same  "RuntimeError: could not open display" message as originally.  I also attempted to use my actual IP address instead of localhost, to no improvement.  After looking around some more, I also tried adding a line...

getenv = True

Which, as far as I can tell, should and export my DISPLAY settings automatically, but this failed to fix the error, as well.

Thanks,
Chris Prokop
________________________________________
From: condor-users-bounces@xxxxxxxxxxx [condor-users-bounces@xxxxxxxxxxx] On Behalf Of Ian Chesal [ichesal@xxxxxxxxxxxxxxxxxx]
Sent: Wednesday, November 16, 2011 10:51 AM
To: Condor-Users Mail List
Subject: Re: [Condor-users] condor_submit problems: _gtk.init_check(), RuntimeError: could not open display

On Wednesday, 16 November, 2011 at 11:40 AM, Christopher Prokop wrote:
Hi,

I am encountering a strange error when using condor_submit. Executing a script on my own works fine without errors, but when I try to run it using condor_submit, I get the following errors when trying to import from pylab or pylot from matplotlib:

File "../Local_Install//lib/python2.4/site-packages/matplotlib/pyplot.py",
line 95, in ?
File "../Local_Install//lib/python2.4/site-packages/matplotlib/backends/__init__.py",
line 25, in pylab_setup
File "../Local_Install//lib/python2.4/site-packages/matplotlib/backends/backend_gtkagg.py",
line 10, in ?
File "../Local_Install//lib/python2.4/site-packages/matplotlib/backends/backend_gtk.py",
line 8, in ?
File "/usr/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.py", line 76, in ?
_init()
File "/usr/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.py",
line 64, in _init
_gtk.init_check()
RuntimeError: could not open display
Your script is expecting to be able to connect to an active display. In this case it looks like it's looking for an X display session. Some tools require this even if you're not running anything graphical. Apparently matplotlib is one of those libraries.

You'll either need to figure out how to stop matplotlib from looking for an active display. Preventing it from loading the GTK library is probably your best way to solve this.

Or you'll need to push an DISPLAY environment variable in to the environment of the job on the remote machine. It'll need to point to a valid (and open, permission-wise) X display session. Consider using the display on your submitting desktop machine if it's running list. You can open permissions on your current display with:

xhost +

And then get the DISPLAY settings with:

echo $DISPLAY

Copy that string in to your submission file as an env setting:

environment = "DISPLAY = <stuff you got from that echo command>"

Regards,
- Ian

---
Ian Chesal

Cycle Computing, LLC
Leader in Open Compute Solutions for Clouds, Servers, and Desktops
Enterprise Condor Support and Management Tools

http://www.cyclecomputing.com
http://www.cyclecloud.com
http://twitter.com/cyclecomputing




This makes me think that there I am missing something in passing a permission to condor, but I have been unable to figure out what it is. I'm not even plotting or displaying any images. Are there any lines I need to add to my .cmd file?

Thanks,
Chris Prokop
_______________________________________________
Condor-users mailing list
To unsubscribe, send a message to condor-users-request@xxxxxxxxxxx<mailto:condor-users-request@xxxxxxxxxxx> with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/condor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/condor-users/

_______________________________________________
Condor-users mailing list
To unsubscribe, send a message to condor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/condor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/condor-users/



--
Ian Chesal

Cycle Computing, LLC
Leader in Open Compute Solutions for Clouds, Servers, and Desktops
Enterprise Condor Support and Management Tools
888.292.5320

http://www.cyclecomputing.com
http://www.cyclecloud.com
http://twitter.com/cyclecomputing