can't run without GUI in Linux + slurm
Posted: Mon Aug 12, 2024 11:36 am
Hi,
A while ago I used to run Python+Neuron scripts and models in a computing cluster without the need of GUI. But now I can't; I don't know what may have changed.
I have this simple code:
If I run it from the terminal in the cluster's gateway it gives no problem at all. That machine has a graphical environment set and running.
But then if I go to one of the computing nodes, that lack graphical capabilities, I get
Which is still fine; I get a warning but the code runs.
The problem is when I submit the code as a slurm job. In that case, the output is
So not even the 'h' importing was sucessfull. I tried by adding a `export DISPLAY=:0` line in the slurm script but in that case I still get the 'can't open DISPLAY' output.
How can I import neuron.h without a display environment? And why the "--No graphics will be displayed" warning message changes to "can't open DISPLAY" error when submitting the same code via slurm?
Thanks!
A while ago I used to run Python+Neuron scripts and models in a computing cluster without the need of GUI. But now I can't; I don't know what may have changed.
I have this simple code:
Code: Select all
import matplotlib
matplotlib.use('Agg')
from neuron import h
print("h imported")
h.load_file("stdrun.hoc")
print("stdrun loaded")
soma = h.Section()
print("soma created")
But then if I go to one of the computing nodes, that lack graphical capabilities, I get
Code: Select all
Warning: no DISPLAY environment variable.
--No graphics will be displayed.
h imported
stdrun loaded
soma created
The problem is when I submit the code as a slurm job. In that case, the output is
Code: Select all
MoTTY X11 proxy: No authorisation provided
can't open DISPLAY
How can I import neuron.h without a display environment? And why the "--No graphics will be displayed" warning message changes to "can't open DISPLAY" error when submitting the same code via slurm?
Thanks!