Running fmriprep-docker on a Mac Studio (M1 Max: 10 Core CPU and 32GB RAM; macOS Ventura 13.1) for a single subject takes a very long time.
E.g.:
Subject with 1 T1 weighted structural image, 1 EPI (>820 volumes), 1 phasedifference fieldmap (acquired with a Siemens scanner) takes ~ 16h without freesurfer surface reconstruction and ~ 3-4 days with freesurfer reconstruction.
Subject with 1 T1 weighted strucutral image, 8 EPIs (>190 volumes each), 1 phasedifference fieldmap (acquired with a Siemens scanner) takes ~ 26h without freesurfer surface reconstruction.
This is nowhere close to the expected run time mentioned in the docs (FAQ, Tips, and Tricks — fmriprep version documentation).
We have > 150 Subjects to be preprocessed and at this rate it would take several months to complete (currently we do not have access to a HPC). Therefore, I am wondering whether there are any options that I am missing that might help accelerate fmriprep?
Thank you very much for any help in advance!
Best,
Tibor
Command used (and if a helper script was used, a link to the helper script or the command generated):
This just isn’t going to work without someone contributing a Docker image and build process for the M1 architecture. You may have some success installing fMRIPrep in a conda environment instead of Docker:
If you inspect the Dockerfile, you should be able to see all of the other tools that need installing, such as AFNI, FreeSurfer, Connectome Workbench, etc. Note that any of these tools might also not be compiled for the M1/M2 architecture, so I can’t guarantee any performance.
We also can only give limited support for “bare-metal” installations, so taking this route is accepting some responsibility for figuring things out. I definitely cannot help with reproducing bugs on a Mac.
I am currently working on brining our www.Neurodesk.org project to Apple Silicon and one thing I found with respect to performance is that activating Rosetta for x86 images brings a 5 fold speedup in my tests and I haven’t seen a downside yet:
thanks for posting this solution.
I’m running into the following warning and, my first attempt at running fMRIprep on my new M2 Mac mini with dockers, did not complete the preprocessing after over 30h.
The requested image’s platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
I’ve flagged the Rosetta option as you suggested. When I run the code, I still get the warning. Is this your observation as well when implementing your solution? Just to understand if this is going to solve the 30h+ of processing of 1 participant.
Yes, the warning will still appear, because you are still running an amd64 image on arm64, but now the processing will be faster because Rosetta 2 is more performant than the default qemu-based emulation in docker.
@ilaria - what other errors are popping up? To avoid the requested image’s platform error there are two options:
develop an arm64 image of fmriprep (which currently doesn’t exist, but there is progress on getting freesurfer to work natively in arm64 and the rest in that image could also be ported)
run the current container on an x86 machine and not on apple silicon