Page 1 of 1

can't run without GUI in Linux + slurm

Posted: Mon Aug 12, 2024 11:36 am
by patoorio
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:

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")
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

Code: Select all

Warning: no DISPLAY environment variable.
--No graphics will be displayed.
h imported
stdrun loaded
soma created
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

Code: Select all

MoTTY X11 proxy: No authorisation provided
can't open DISPLAY
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!

Re: can't run without GUI in Linux + slurm

Posted: Tue Aug 13, 2024 3:22 pm
by patoorio
Found a solution. (there are others)

Adding

Code: Select all

export NEURON_MODULE_OPTIONS="-nogui"
to the slurm script file did the trick

Re: can't run without GUI in Linux + slurm

Posted: Wed Aug 14, 2024 12:00 pm
by ted
Thanks for posting that! For others who may read this thread, executing
nrniv -h
at the system prompt prints a list of options that may be specified when launching NEURON from a terminal. These options can also be passed to NEURON's python module through the NEURON_MODULE_OPTIONS environment variable--see
https://nrn.readthedocs.io/en/latest/py ... ables.html
for examples.