can't run without GUI in Linux + slurm

When Python is the interpreter, what is a good
design for the interface to the basic NEURON
concepts.

Moderator: hines

Post Reply
patoorio
Posts: 87
Joined: Wed Jan 30, 2008 12:46 pm

can't run without GUI in Linux + slurm

Post 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!
patoorio
Posts: 87
Joined: Wed Jan 30, 2008 12:46 pm

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

Post 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
ted
Site Admin
Posts: 6354
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

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

Post 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.
Post Reply