External Email - Use Caution        

 
Python code  (including 3rd party python packages) in the Intel Mac build cannot be guaranteed to run on Mac M1, M2 arm processors.  Package developers may still build their code using Intel processor specific instructions which cannot be emulated by the Rosetta environment on arm64 Macs.  Rosetta translates Intel processor instructions to arm64 processor instructions; when there is no equivalent arm processor instruction, you get the error “illegal instruction”.  The remedy for this is to re-write and/or re-build the code (to be more portable).

There is an arm64 freesurfer development build including an arm64 python with Apple’s tensorflow.   However, the freesurfer python code is not yet entirely compatible with arm64 python and all its packages.  The mri_synthsr script currently does not work with arm64 tensorflow; I don’t know about mri_samseg.   You can try the arm64 development build via the link,  MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/dev/freesurfer-macOS-darwin_arm64-dev.pkg  Please keep in mind this it not a release build and please report any errors.

Fixes for these kinds of issues will become available in the development builds via the link above once they are added into the freesurfer development stream.   We can also notify the list.

- R.

On Oct 7, 2023, at 03:23, Bianka Forgó <fbia021@gmail.com> wrote:

        External Email - Use Caution        


Dear Freesurfer Developers,

I am attempting to use Freesurfer on MacOS Ventura (version 13.5.2) with an M2 Pro silicone chip and GPU. I have successfully installed Freesurfer version 7.4.1.
I am trying to use samseg for cross-sectional MS lesion volume analysis by running the following command:

run_samseg --input Freesurfer_subjects/T1.nii Freesurfer_subjects/FAMUS/T2FLAIR_reg.nii --pallidum-separate --lesion --lesion-mask-pattern 0 1 --output Freesurfer_subjects/FAMUS/samseg

I get the error message:
zsh: illegal hardware instruction  run_samseg --input Freesurfer_subjects/FAMUS/T1.nii   --lesion  0 1

 

As described in the samseg manual, one may be prompted to use Tensorflow when using this module for the first time. I was not prompted to do so but I did install it (and python3 as well) using the instructions here: MailScanner has detected a possible fraud attempt from "secure-web.cisco.com" claiming to be https://www.tensorflow.org/install/pip
After this, I still get the above error message.

I can also see that there is no support for running Tensorflow on Mac with GPU.
Does this mean that there's no way for me to run this command or is there anything else I can try to solve this?
Of note, the basic samseg command (run_samseg --input <file> [<file> ...] --output <dir> [--threads <threads>] [--pallidum-separate]) is running without any issues.

Thank you,
Bianka



_______________________________________________
Freesurfer mailing list
Freesurfer@nmr.mgh.harvard.edu
https://mail.nmr.mgh.harvard.edu/mailman/listinfo/freesurfer