Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.6.5 with matplotlib not running well in sbatch #6

Open
ygmayor opened this issue Feb 1, 2019 · 3 comments
Open

Python 3.6.5 with matplotlib not running well in sbatch #6

ygmayor opened this issue Feb 1, 2019 · 3 comments

Comments

@ygmayor
Copy link

ygmayor commented Feb 1, 2019

Hi,
I tried to run an slurm job through sbatch with a python script inside. The script does not run and it can be seen the following message instead:
QStandardPaths: XDG_RUNTIME_DIR points to non-existing path '/run/user/9980', please create it with 0700 permissions.
qt.qpa.screen: QXcbConnection: Could not connect to display localhost:12.0
Could not connect to any X display.

Now:

  • I know the problem is that I am importing the matplotlib module since my final results are some figures.
  • I also know that the same script runs well when I run it in the login node which I remotely accessed via ssh -X
  • I believe that the compute nodes don't have permission to access any X display because perhaps the communication between the login node and the compute node was automatically made by slurm without this feature enabled
  • I confirmed that /run/user/9980, accessed from the login node, does exist and has proper permissions assigned.
    So, my real question is: How do I solve my problem????

Any help or ideas please

@vsoch
Copy link
Owner

vsoch commented Feb 1, 2019

You should try to not complicated the batch runs with trying to use display - this is asking for trouble. I would save data / results needed to generate the plots instead, and then generate them in a (non batch) interactive job.

@ygmayor
Copy link
Author

ygmayor commented Feb 1, 2019

Hi vsoch,
Thank you for your answer. I am afraid that is exactly what I will have to do. I was just hoping there was a simple solution to that problem to make my life easier :-).

@vsoch
Copy link
Owner

vsoch commented Feb 1, 2019

hey @ygmayor I've been there! The only way I would get display working to display graphics on a node like that is to use xvirtual frame buffer (xvfb). But honestly, what that does is make your pipeline much more error prone. So it's good to abide by the idea of keeping things as simple as possible. The node is optimized to run the analysis, but not for graphics, so you run the analysis there. The graphics are better created in an interactive session, and so you should do it there. If you are a Stanford affiliate you can try to use ondemand and jupyter notebooks that could be an easy way to connect to your data on the cluster too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants