Skip to content
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

3dSkullStrip errors out inside screen #651

Closed
stjep opened this issue Oct 10, 2017 · 7 comments
Closed

3dSkullStrip errors out inside screen #651

stjep opened this issue Oct 10, 2017 · 7 comments
Labels

Comments

@stjep
Copy link

stjep commented Oct 10, 2017

Running the latest mriqc (0.9.9) within Docker, I get the following error if it is run inside of screen, which doesn't forward X11. Running it outside of screen does not produce the error, but also doesn't seem to need X11 forwarding. The crash file is:

Node: workflow_enumerator.anatMRIQCT1w.AFNISkullStripWorkflow.skullstrip
Working directory: /usr/local/src/mriqc/work/workflow_enumerator/anatMRIQCT1w/AFNISkullStripWorkflow/_in_file_..data..sub-11..ses-day2..anat..sub-11_ses-$

Node inputs:

args = <undefined>
environ = {}
ignore_exception = False
in_file = /usr/local/src/mriqc/work/workflow_enumerator/anatMRIQCT1w/AFNISkullStripWorkflow/_in_file_..data..sub-11..ses-day2..anat..sub-11_ses-day1_T1w.$
num_threads = 1
out_file = <undefined>
outputtype = NIFTI_GZ
terminal_output = stream

Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.6/site-packages/niworkflows/nipype/pipeline/plugins/multiproc.py", line 51, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/usr/local/miniconda/lib/python3.6/site-packages/niworkflows/nipype/pipeline/engine/nodes.py", line 407, in run
    self._run_interface()
  File "/usr/local/miniconda/lib/python3.6/site-packages/niworkflows/nipype/pipeline/engine/nodes.py", line 517, in _run_interface
    self._result = self._run_command(execute)
  File "/usr/local/miniconda/lib/python3.6/site-packages/niworkflows/nipype/pipeline/engine/nodes.py", line 650, in _run_command
    result = self._interface.run()
  File "/usr/local/miniconda/lib/python3.6/site-packages/niworkflows/nipype/interfaces/base.py", line 1086, in run
    runtime = self._run_interface(runtime)
  File "/usr/local/miniconda/lib/python3.6/site-packages/niworkflows/nipype/interfaces/afni/base.py", line 129, in _run_interface
    return super(AFNICommandBase, self)._run_interface(runtime)
  File "/usr/local/miniconda/lib/python3.6/site-packages/niworkflows/nipype/interfaces/base.py", line 1587, in _run_interface
    self.raise_exception(runtime)
  File "/usr/local/miniconda/lib/python3.6/site-packages/niworkflows/nipype/interfaces/base.py", line 1526, in raise_exception
    **runtime.dictcopy()))
RuntimeError: Command:
3dSkullStrip -input /usr/local/src/mriqc/work/workflow_enumerator/anatMRIQCT1w/AFNISkullStripWorkflow/_in_file_..data..sub-11..ses-day2..anat..sub-11_ses$
Standard output:

Standard error:
freeglut (3dSkullStrip): failed to open display ':1286930384'

Return code: 1
@oesteban oesteban added the bug label Oct 10, 2017
@oesteban
Copy link
Member

Hi @stjep, the latest mriqc update was supposed to address this. It seems that Xvfb is not correctly running on your settings.

@stjep
Copy link
Author

stjep commented Oct 11, 2017

@oesteban, my bad, my vm instance did not have xvfb installed.

Seems to be running fine now so I'm closing this. Will re-open if the bug re-appears, but looks good so far.

@stjep stjep closed this as completed Oct 11, 2017
@chrisgorgo
Copy link
Collaborator

I'm getting this with 0.9.9 on OpenNeuro: https://openneuro.org/datasets/ds000007/versions/00001?app=MRIQC&version=46

Surprisingly it only happened for one subject out of many. I would suggest switching to including (in the Docker image) a version of AFNI that does not depend on display.

@chrisgorgo chrisgorgo reopened this Oct 18, 2017
@leej3
Copy link
Contributor

leej3 commented Oct 18, 2017

I talked to one of the afni developer's about an xvfb issue like this. For shared machines where you don't have access to docker this problem is solved nicely in afni's @chaufeur_afni (tcsh), have a look with:

vim `which \@chauffeur_afni `

Specifically the following can be used to keep trying different displays until it succeeds :

set ranval = `count -dig 1 1 999999 R1`

if( $?xdisplay == 0 )then
  set killX     = 1
  set ntry      = 1
  set Xnotfound = 1
  while( $Xnotfound )
    set xdisplay = `count -dig 1 3 999 R1`
    if( -e /tmp/.X${xdisplay}-lock ) continue
    echo " -- trying to start Xvfb :${xdisplay}"
    Xvfb :${xdisplay} -screen 0 1024x768x24 &
    sleep 1
    jobs > zzerm.$ranval.txt
    grep -q Xvfb zzerm.$ranval.txt
    set Xnotfound = $status
    \rm -f zzerm.$ranval.txt
    if( $Xnotfound == 0 )break ;
    @ ntry++
    if( $ntry > 99 )then
      echo "** ERROR: can't start Xvfb -- exiting"
      goto BAD_EXIT
    endif
  end
endif

setenv DISPLAY :${xdisplay}
set OW = "OPEN_WINDOW"

xvfb-run -a does this but seems to cause issues with image opacity.

@chrisgorgo
Copy link
Collaborator

I'm running into this more often on OpenNeuro. Would be great to ship with version of 3dskullstrip that does not require display.

@chrisgorgo
Copy link
Collaborator

I also wonder why it started happening now - was AFNI updated?

@chrisgorgo
Copy link
Collaborator

Run into this again on OpenNeuro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants