Error: Node Name: _autorecon_surfs0

I have an error in recon-all. It run in Ubuntu 20.04.2.
It did work with a single subject (without the for loop), so I assume it is a memory issue? I thought it run a single subject in each iteration.

for i in cat $bids_root/subjects_list.txt; do
echo $i

fmriprep-docker $bids_root $out participant
–fs-license-file /home/taliw/data/derivatives/license.txt
–skip_bids_validation
–participant-label $i
–md-only-boilerplate
–nthreads 4
–error-on-aroma-warnings
–ignore {fieldmaps,slicetiming,sbref,t2w,flair}
–output-spaces MNI152NLin2009cAsym:res-2
–dummy-scans 5
–use-aroma
–fd-spike-threshold 0.25
–stop-on-first-crash
–resource-monitor
–write-graph

done

Node Name: _autorecon_surfs0

Traceback (most recent call last):
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/plugins/multiproc.py”, line 67, in run_node
result[“result”] = node.run(updatehash=updatehash)
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 516, in run
result = self._run_interface(execute=True)
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 635, in _run_interface
return self._run_command(execute)
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py”, line 741, in _run_command
result = self._interface.run(cwd=outdir)
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py”, line 428, in run
runtime = self._run_interface(runtime)
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py”, line 822, in _run_interface
self.raise_exception(runtime)
File “/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py”, line 753, in raise_exception
).format(**runtime.dictcopy())
RuntimeError: Command:
recon-all -autorecon-hemi lh -noparcstats -noparcstats2 -noparcstats3 -nohyporelabel -nobalabels -openmp 3 -subjid sub-005 -sd /out/freesurfer
Standard output:
Subject Stamp: freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1-f53a55a
Current Stamp: freesurfer-Linux-centos6_x86_64-stable-pub-v6.0.1-f53a55a
INFO: SUBJECTS_DIR is /out/freesurfer
Actual FREESURFER_HOME /opt/freesurfer
Linux 1e7f2c054df0 5.8.0-53-generic #60~20.04.1-Ubuntu SMP Thu May 6 09:52:46 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
‘/opt/freesurfer/bin/recon-all’ → ‘/out/freesurfer/sub-005/scripts/recon-all.local-copy’
#--------------------------------------------
#@# Tessellate lh Thu Sep 23 20:53:30 UTC 2021
/out/freesurfer/sub-005/scripts

mri_pretess …/mri/filled.mgz 255 …/mri/norm.mgz …/mri/filled-pretess255.mgz

Iteration Number : 1
pass 1 (xy+): 0 found - 0 modified | TOTAL: 0
pass 1 (xy-): 0 found - 0 modified | TOTAL: 0
pass 1 (yz+): 4 found - 4 modified | TOTAL: 4
pass 2 (yz+): 0 found - 4 modified | TOTAL: 4
pass 1 (yz-): 1 found - 1 modified | TOTAL: 5
pass 2 (yz-): 0 found - 1 modified | TOTAL: 5
pass 1 (xz+): 0 found - 0 modified | TOTAL: 5
pass 1 (xz-): 0 found - 0 modified | TOTAL: 5
Iteration Number : 1
pass 1 (+++): 0 found - 0 modified | TOTAL: 0
pass 1 (+++): 0 found - 0 modified | TOTAL: 0
pass 1 (+++): 0 found - 0 modified | TOTAL: 0
pass 1 (+++): 0 found - 0 modified | TOTAL: 0
Iteration Number : 1
pass 1 (++): 0 found - 0 modified | TOTAL: 0
pass 1 (±): 1 found - 1 modified | TOTAL: 1
pass 2 (±): 0 found - 1 modified | TOTAL: 1
pass 1 (–): 0 found - 0 modified | TOTAL: 1
pass 1 (-+): 0 found - 0 modified | TOTAL: 1
Iteration Number : 2
pass 1 (xy+): 0 found - 0 modified | TOTAL: 0
pass 1 (xy-): 0 found - 0 modified | TOTAL: 0
pass 1 (yz+): 0 found - 0 modified | TOTAL: 0
pass 1 (yz-): 0 found - 0 modified | TOTAL: 0
pass 1 (xz+): 0 found - 0 modified | TOTAL: 0
pass 1 (xz-): 0 found - 0 modified | TOTAL: 0
Iteration Number : 2
pass 1 (+++): 0 found - 0 modified | TOTAL: 0
pass 1 (+++): 0 found - 0 modified | TOTAL: 0
pass 1 (+++): 0 found - 0 modified | TOTAL: 0
pass 1 (+++): 0 found - 0 modified | TOTAL: 0
Iteration Number : 2
pass 1 (++): 0 found - 0 modified | TOTAL: 0
pass 1 (±): 0 found - 0 modified | TOTAL: 0
pass 1 (–): 0 found - 0 modified | TOTAL: 0
pass 1 (-+): 0 found - 0 modified | TOTAL: 0

Total Number of Modified Voxels = 6 (out of 221490: 0.002709)
Ambiguous edge configurations…

mri_pretess done

mri_tessellate …/mri/filled-pretess255.mgz 255 …/surf/lh.orig.nofix

Id: mri_tessellate.c,v 1.38.2.1 2016/07/26 18:46:38 zkaufman Exp
Id: mrisurf.c,v 1.781.2.6 2016/12/27 16:47:14 zkaufman Exp
slice 40: 1849 vertices, 2020 faces
slice 50: 8286 vertices, 8569 faces
slice 60: 17957 vertices, 18318 faces
slice 70: 28353 vertices, 28702 faces
slice 80: 38488 vertices, 38800 faces
slice 90: 48688 vertices, 49059 faces
slice 100: 59017 vertices, 59358 faces
slice 110: 68799 vertices, 69143 faces
slice 120: 78494 vertices, 78842 faces
slice 130: 87986 vertices, 88328 faces
slice 140: 96797 vertices, 97080 faces
slice 150: 104573 vertices, 104849 faces
slice 160: 111057 vertices, 111267 faces
slice 170: 116342 vertices, 116492 faces
slice 180: 119738 vertices, 119830 faces
slice 190: 120480 vertices, 120494 faces
slice 200: 120480 vertices, 120494 faces
slice 210: 120480 vertices, 120494 faces
slice 220: 120480 vertices, 120494 faces
slice 230: 120480 vertices, 120494 faces
slice 240: 120480 vertices, 120494 faces
slice 250: 120480 vertices, 120494 faces
using the conformed surface RAS to save vertex points…
writing …/surf/lh.orig.nofix
using vox2ras matrix:
-1.00000 0.00000 0.00000 128.00000;
0.00000 0.00000 1.00000 -128.00000;
0.00000 -1.00000 0.00000 128.00000;
0.00000 0.00000 0.00000 1.00000;

rm -f …/mri/filled-pretess255.mgz

mris_extract_main_component …/surf/lh.orig.nofix …/surf/lh.orig.nofix

counting number of connected components…
120480 voxel in cpt #1: X=-14 [v=120480,e=361482,f=240988] located at (-23.462450, -25.882595, 29.635824)
For the whole surface: X=-14 [v=120480,e=361482,f=240988]
One single component has been found
nothing to do
done

#--------------------------------------------
#@# Smooth1 lh Thu Sep 23 20:53:32 UTC 2021
/out/freesurfer/sub-005/scripts

mris_smooth -nw -seed 1234 …/surf/lh.orig.nofix …/surf/lh.smoothwm.nofix

setting seed for random number generator to 1234
smoothing surface tessellation for 10 iterations…
smoothing complete - recomputing first and second fundamental forms…
#--------------------------------------------
#@# Inflation1 lh Thu Sep 23 20:53:35 UTC 2021
/out/freesurfer/sub-005/scripts

mris_inflate -no-save-sulc …/surf/lh.smoothwm.nofix …/surf/lh.inflated.nofix

Not saving sulc
Reading …/surf/lh.smoothwm.nofix
avg radius = 44.7 mm, total surface area = 63931 mm^2
writing inflated surface to …/surf/lh.inflated.nofix
inflation took 0.2 minutes

step 000: RMS=0.151 (target=0.015)
step 005: RMS=0.112 (target=0.015)
step 010: RMS=0.081 (target=0.015)
step 015: RMS=0.067 (target=0.015)
step 020: RMS=0.056 (target=0.015)
step 025: RMS=0.048 (target=0.015)
step 030: RMS=0.041 (target=0.015)
step 035: RMS=0.036 (target=0.015)
step 040: RMS=0.033 (target=0.015)
step 045: RMS=0.031 (target=0.015)
step 050: RMS=0.029 (target=0.015)
step 055: RMS=0.028 (target=0.015)
step 060: RMS=0.027 (target=0.015)
inflation complete.
Not saving sulc
mris_inflate utimesec 25.935448
mris_inflate stimesec 0.116033
mris_inflate ru_maxrss 187068
mris_inflate ru_ixrss 0
mris_inflate ru_idrss 0
mris_inflate ru_isrss 0
mris_inflate ru_minflt 45265
mris_inflate ru_majflt 0
mris_inflate ru_nswap 0
mris_inflate ru_inblock 0
mris_inflate ru_oublock 8480
mris_inflate ru_msgsnd 0
mris_inflate ru_msgrcv 0
mris_inflate ru_nsignals 0
mris_inflate ru_nvcsw 21990
mris_inflate ru_nivcsw 59
#--------------------------------------------
#@# QSphere lh Thu Sep 23 20:53:45 UTC 2021
/out/freesurfer/sub-005/scripts

mris_sphere -q -seed 1234 …/surf/lh.inflated.nofix …/surf/lh.qsphere.nofix

doing quick spherical unfolding.
setting seed for random number genererator to 1234
Id: mris_sphere.c,v 1.61 2016/01/20 23:42:15 greve Exp
Id: mrisurf.c,v 1.781.2.6 2016/12/27 16:47:14 zkaufman Exp
reading original vertex positions…
unfolding cortex into spherical form…
surface projected - minimizing metric distortion…
vertex spacing 1.05 ± 0.59 (0.00–>6.54) (max @ vno 52577 → 53632)
face area 0.03 ± 0.04 (-0.11–>0.66)
Segmentation fault (core dumped)
Linux 1e7f2c054df0 5.8.0-53-generic #60~20.04.1-Ubuntu SMP Thu May 6 09:52:46 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

recon-all -s sub-005 exited with ERRORS at Thu Sep 23 20:54:26 UTC 2021

For more details, see the log file /out/freesurfer/sub-005/scripts/recon-all-lh.log
To report a problem, see http://surfer.nmr.mgh.harvard.edu/fswiki/BugReporting

Standard error:

Return code: 1

Segmentation faults, as in the error message, could be due to memory issues or due to the code trying to access memory it does not have access to (e.g. accessing a drive you do not have permission to read). If the same command worked outside the loop then I would guess it’s a memory issue, so try devoting more RAM to the task.