Native window X11 IOError when running Brainstorm with no gui

Hello,

I've got this error when trying to run a script with Brainstorm nogui

PROGRESS> Running process: Baseline normalization... [creating new file]
PROGRESS> Update results links: Updating results links...
Nativewindow X11 IOError: Display 0x7fa2e848d940 (localhost:16.0): Resource temporarily unavailable
Nativewindow X11 IOError: Display 0x7fa109699500 (localhost:16.0): Resource temporarily unavailable
Nativewindow X11 IOError: Display 0x7fa2e848d940 (localhost:16.0): Resource temporarily unavailable
Nativewindow X11 IOError: Display 0x7fa109699500 (localhost:16.0): Resource temporarily unavailable
Opening log file: /home/cnrl/java.log.26796
MATLAB: javainit.cpp:1386: void {anonymous}::mwJavaAbort(): Assertion Fatal Java Exception. See this file for details: /home/cnrl/hs_error_pid26796.log' failed. MATLAB: javainit.cpp:1386: void {anonymous}::mwJavaAbort(): Assertion Fatal Java Exception. See this file for details: /home/cnrl/hs_error_pid26796.log' failed.
Abort (core dumped)

I am still learning about Brainstorm and I don't know what that error may be. I am definitely sure that in my code I am not calling for any display that may need the gui, and it seems to be a very inconsistent error, as I may rerun the script again and it won't show up.

Could you please give me any advice on how to solve this? I provide below the line of code where this happened this time but, as said, it can happen pretty much anywhere in the code. The only consistency I can find is that it occurs when 'updating links' after any bst_process.

        % Process: DC offset correction
        sFiles = bst_process('CallProcess', 'process_baseline_norm', sFiles, [], ...
            'baseline',    epoch_baseline{w}, ...
            'sensortypes', '', ...
            'method',      'bl', ...  % DC offset correction:    x_std = x - μ
            'overwrite',   1);

*Here is where the error happened

        % Process: Detect bad trials: Peak-to-peak  MEGGRAD(0-5000) MEGMAG(0-5000)
        sFiles = bst_process('CallProcess', 'process_detectbad', sFiles, [], ...
            'timewindow', [], ...
            'meggrad',    reject_MEG_grad, ...
            'megmag',     reject_MEG_mag, ...
            'eeg',        [0, 0], ...
            'ieeg',       [0, 0], ...
            'eog',        [0, 0], ...
            'ecg',        [0, 0], ...
            'rejectmode', 2);  % Reject the entire trial

Many thanks!

Fran

Hi Fran,

From your error messages, your issues seem to be coming from X11 display and Java initialization. When you run brainstorm with the nogui option, the user interface and Java objects are still created, but hidden. Have you tried running brainstorm with the server option? No display or Java elements will be created at all, this will probably fix your issues.

Refer to the following tutorial page for more information on running Brainstorm in headless mode: Running scripts on a cluster

Let us know if this works!
Martin

Hello,

Many thanks for your answer. I tried with this new method but now I get another error:

BST> Loading current protocol...
BST> =================================


** Error: Protocol 'Project_name' already exists in database.


I think this first error is fine, it's just a warning that I am trying to load a protocol that already exists, but it continues with no problems.


EPOCHING


Renaming events for subject xxx


Making epochs for subject xxx

BST> Emptying temporary directory...
BST> Emptying temporary directory...
BST> Emptying temporary directory...
BST> Emptying temporary directory...
BST> Saving protocol "Project_name"...
BST> Emptying temporary directory...
BST> Emptying temporary directory...
BST> Emptying temporary directory...
BST> Emptying temporary directory...
BST> Emptying temporary directory...
BST> Saving protocol "Project_name"...


Baseline correction for subject xx

BST> Saving protocol "Project_name"...


Cleaning for subject xx

BST> Saving protocol "Project_name"...
Segmentation fault (core dumped)

This last is the actual error that stops my script. I included at the begging of my script the section recommended in the link you attached.

Many thanks again,

Fran

Hi Fran,

It seems Matlab crashed during the execution of your script. This could be due to many factors, it's hard to debug since we don't get an actual error message. Is it possible to isolate which line crashes in your script, and check if it's consistent i.e. it always crashes at this specific line? You could also share your script with us so we can test on our end if it's specific to your machine & data or not.

Martin

Hello Martin,

We double checked and it may have been due to lack of space in our drive. Sorry for the trouble. We are rerunning it now with enough space and hopefully it will work.

Many thanks,

Fran

1 Like