Fmri-prep reruns freesurfer and does not finish


I am running fMRI-prep with version 20.2.3 using singularity. Although I am specifying my FS directory (which was already ran outside of fmri-prep), I think that FS is rerunning because all files and directories of FS get recreated during the fmri-prep run. I was wondering if you have any help with this? Also, fmri-prep never finishes (it has now been running for longer than 48h for one subject). It only created a couple of files in ‘anat’ (i.e., T1w_to-fsnative_mode-image_xfm.txt, fsnative_to-T1w_mode-image_xfm.txt, and desc-preproc_T1w.nii.gz and .json) and there is no ‘func’ output folder. Please find attached our complete log file here. According to the log-file, the pre-run FS directory is recognized, but then later on it says that it is executing recon-all…

Could someone help with this?
Thank you!
Best wishes

Can you provide a few pieces of info that might help us help you?

  1. does your old FS directory contain recon-all outputs, or less complete FS outputs? If it doesn’t contain recon-all that would explain why recon-all is being run by fMRIprep.
  2. please paste the command you are using to rub fMRIprep
  3. how are you running it (python/docker/singularity), and what OS? How much memory/CPUs are you devoting to the job?


Hi Steven,

Thank you so much for your reply.

The recon-all folders were indeed there. FS was run to completion without error with v6 before.

Regarding memory, we are using:
n_procs=1, mem_gb=56.60.
We are using Linux Ubuntu.

I am using singularity and my command line is:
singularity run --cleanenv -B /dir:/grave -B /dir2 -B /dir2 -B /dir3/fmriprep_templateflow/templateflow:/opt/templateflow /dir3/singularity_images/fmriprep-20.2.3.simg {input_loc} {output_loc} participant --participant-label ${subject} --notrack --use-aroma --aroma-melodic-dimensionality 100 --nthreads 1 --omp-nthreads 4 --output-space T1w MNI152NLin6Asym fsnative fsaverage -vvv --error-on-aroma-warnings --fs-subjects-dir /dir4/FMRIPREP/freesurfer --fs-license-file /dir5/.license/license.txt --work-dir /grave

Thank you very much for the help!

  1. That’s certainly enough memory, and you can probably get away with using less memory (like 20 GB). Try raising n_procs to 8 or 16. That should drastically speed up performance.

  2. Is it possible that the FS dir is not bound to singularity? That is, add -B /dir4. Then fmriprep can find the previous FS outputs.

Hi Steven

Thank you! Thats a great suggestion regarding the memory, will def try that.

Sorry, completely my bad, I didn’t name my directories well when copying the command line to here. The freesurfer dir (dir3 in this case) is actually bound, if Im not mistaken:

singularity run --cleanenv -B /dir1:/grave -B /dir2:/dir2 -B /dir3:/dir3 -B /dir4/bin/fmriprep_templateflow/templateflow:/opt/templateflow /dir5/bin/singularity_images/fmriprep-20.2.3.simg {input_loc} {output_loc} participant --participant-label ${subject} --notrack --use-aroma --aroma-melodic-dimensionality 100 --nthreads 1 --omp-nthreads 4 --output-space T1w MNI152NLin6Asym fsnative fsaverage -vvv --error-on-aroma-warnings --fs-subjects-dir /dir3/folder/folder/folder/FMRIPREP/freesurfer --fs-license-file /dir6/.license/license.txt --work-dir /grave

Sorry again for this mistake. I guess the binding would not be the issue then?


In that case, binding should not be the issue, so try upping the #cpus and we can go from there!

Thank you, Steven, will do and get back to you!