0

I'm parallelizing a process by using the multiprocessing module. The function that is parallelized does plotting and using savefig module saves the plot in pdf format.

However, when the code is run, only one of the iterations results in an image while other images although created are of size 0 bytes.

The following error is thrown and the computer freezes:

Gdk-Message: 14:44:50.467: python2.7: Fatal IO error 11 (Resource temporarily unavailable) on X server :0.

I'm using Ubuntu 18.04.2 LTS on a laptop with 4 cores.

  • Are you serializing communications with the X server? I suspect that the processes share a connection and the X protocol is being corrupted. – stolenmoment Jun 20 '19 at 0:13
  • If I'm not mistaken, the display environment for all the processes is remaining the same viz. os.environ['DISPLAY'] = ':0', which is causing temporary resource (in this case, the display) unavailability. How do I obviate using the same display for such a multiprocessing job? – Schlator Jun 20 '19 at 3:06
  • The issue isn't the display, it's the socket connecting your script to the X11 server. I don't know which X library you use, but if you open the socket (initialize the X library, perhaps) separately in each subprocess, that ought to take care of it. – stolenmoment Jun 20 '19 at 10:28
  • How can I initialize the X11 server? I'm not sure if I'm correct, but I think my system is using xorg because I'm running Ubuntu 18.04. Could you provide how I could initialize the X library separately in each subprocess? I'm very new to this jargon, thank you for bearing with me. – Schlator Jun 20 '19 at 12:58
  • Within python when I do the following: >>> import os; >>> os.system('Xorg'). This error results: /usr/lib/xorg/Xorg.wrap: Only console users are allowed to run the X server – Schlator Jun 20 '19 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.