-
Notifications
You must be signed in to change notification settings - Fork 119
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
NEURON wheel without X11 => Ability to turn off GUI loading in wheel #590
Comments
Actually, except for the warning message, that is the way it is now. I.e. the process continues on, but just without InterViews graphics. The warning message is turned off if nrniv is launched with the Did you experience this on mac or linux? On the mac, the pip wheel dynamically loads X11 only if XQuartz is installed. @pramodk , I don't recall at the moment if the wheel for linux |
Thanks for your quick reply! I see, it is not so easy. I noticed that because after starting an sbatch job running neuron, and logging out of my session (on supercomputer), it was killing my job with a xserver error message. Then I realised that it was not my code, but neuron that was using X11, which I had recently installed via |
This actually raises a puzzle. If NEURON runs in parallel with launch of |
I see, but I'm not using MPI for this, I do many single cell simulations, using simple multiprocessing and each neuron run in a different isolated process. But never mind, I can leave with the warning message in the logs. My usecase is quite specific, and not sure it'll be worth you time to fix that just for me. |
@nrnhines I wonder if it would not be possible to build a separate wheel for nrn without gui. I think it would be beneficial for people working on cluster or on machine that don't need X11 at all. |
Although we are getting to the point with travis and azure where we do not have to expend a lot of manual effort and time to prepare distributions. I think the user confusion resulting from too many installation choices is to be avoided. I think choice makes more sense at the time when the user can more easily understand the implications of the choice. In this particular case I'm leaning toward eliminating the DISPLAY message for distributions where X11 is dynamically loaded ( linux wheels and all mac?). I think the puzzlement that will result when no graphics appears will be rare as there is normally a DISPLAY environment variable. And then to avoid graphics in arnaudon's situation just consists in ```unset DISPLAY`` before the sbatch launch. |
In fact, having neuron connecting to X11 could be 'bad'. I was trying to run many small neuron computations on multiple nodes with dask (or even starting independent multiprocessing jobs on different nodes), and it was breaking if too many processes where launched at the same time, because of a lack of available socket for neuron to use X11. I couldn't understand what was causing that, but now I know! So |
Thanks @arnaudon for the detailed information! Similar issue was raised during the last neuron-dev meeting specifically in the context of OSX and X11/XQuartz initialisation. We will discuss this again during next week meeting because there are other related issues and will come back here. |
@nrnhines actually the nrn_options package also sounds tempting. Not sure if it would 100% solve this particular issue, since people would still need to know that they have to load the package etc. |
Pull request #602 responds to this issue. For -nogui and -NFRAME args one can
You can leave out the |
Just in case, I noticed that the warning message I get many times is here: Line 661 in 6d23a39
|
After discussion at the June developer meeting, it was concluded that polluting
|
Was the NEURON_MODULE_OPTIONS ability ever merged? @alex4200 and me were wondering how we can disable X11 in the context of a MOOC jupyter notebook. There is an external script that opens nrngui.hoc, but we would like to prevent it opening the nrn X11 window. I've tried setting NEURON_MODULE_OPTIONS="-nogui" in the notebook but it doesn't seem to have an effect. I think it would still be nice to have a wheel (e.g. to be installed as an extra with 'pip install neuron[nogui]') that doesn't have an X11 dependency. |
Could this be worked-around by having a script unset I'd like a programmatic way around connecting to xquartz on a mac (which takes a long time if xquartz isn't running), because I want the option of using the gui, but I almost never want it, and it's especially silly whenever I'm trying to use |
I tried unsetting DISPLAY, but that didn't work (not 100% sure it's because of jupiter or nrn) |
The option is good, but it would also be nice to have a package that doesn't depend on X11 at all. In some contexts one is 100% sure no GUI will be used (HPC, notebooks, etc.), so having the dependency is just an overhead in these cases. |
For temporary purposes, does
work for you. That may not help @ramcdougal as it likely turns off his wx stuff as well as not loading x11 (if configured so that InterViews is dynamically loaded). Maybe #602 should be broken into two PRs, one of which does only the |
@ramcdougal For temporary purposes, one can have the effect of -nogui (and no loading of x11) by
Let me know if that turns off your wx stuff as well? |
I am reopening this issue but changing title to |
@nrnhines I just wanted to try your solution to turn the GUI off by renaming that so file - but I could not find it anywhere! Note: I did install NEURON using |
@alex4200 : Michael was mentioning above command from build directory when install neuron from source. For python wheel installation, I tried: → pip install neuron
Collecting neuron
Using cached NEURON-7.8.2-cp38-cp38-macosx_10_9_x86_64.whl (11.6 MB)
Requirement already satisfied: numpy>=1.9.3 in ./vnew/lib/python3.8/site-packages (from neuron) (1.20.2)
Installing collected packages: neuron
Successfully installed neuron-7.8.2
→ python
Python 3.8.9 (v3.8.9:a743f8192b, Apr 2 2021, 08:12:53)
>>> import neuron
Warning: no DISPLAY environment variable.
--No graphics will be displayed.
# NOW, remove / rename `libivx11dynam.so` library
# check location of site packages dir in virtual env
→ python -c 'import site; print(site.getsitepackages()[0])'
/Users/pramod/Downloads/vnew/lib/python3.8/site-packages
# now temporarily rename that shared library
→ mv /Users/pramod/Downloads/vnew/lib/python3.8/site-packages/neuron/.data/lib/libivx11dynam.dylib /Users/pramod/Downloads/vnew/lib/python3.8/site-packages/neuron/.data/lib/libivx11dynam.dylib.new
# if I try to import neuron then I don't see DISPLAY warning
→ python
Python 3.8.9 (v3.8.9:a743f8192b, Apr 2 2021, 08:12:53)
>>> import neuron Obviously this is for testing purposes and we would like to have a proper option for this. |
Thanks, that workaround seems to work. Here is my complete code that I can run in a jupyter notebook to disable the GUI:
|
Does it work now? How can we use it? |
|
Would it be possible to have the
pip install NEURON
without any X11, so that it can be used without the$DISPLAY
variable and not have warning such asThanks!
The text was updated successfully, but these errors were encountered: