smistad / FAST

A framework for high-performance medical image processing, neural network inference and visualization
https://fast.eriksmistad.no
BSD 2-Clause "Simplified" License
433 stars 101 forks source link

Mac M1 chip future compatibility? #161

Closed mawskay closed 1 year ago

mawskay commented 1 year ago

Is your feature request related to a problem? Please describe. The FAST framework doesn't support Mac with M1 chip because OpenCL is deprecated. Is there a planned support on M chips?

Describe the solution you'd like Maybe add a metal framework version.

smistad commented 1 year ago

OpenCL (and OpenGL for that matter) is deprecated on macOS. But FAST runs ok on macOS as OpenCL is still available. OpenCL also appearantly works on M1 https://browser.geekbench.com/v5/compute/2084893

Nevertheless, the future of OpenCL and OpenGL on macOS is very uncertain. There is talk in the community about running OpenCL on top of metal, which could be s nice workaround.

The main reason we can't run FAST now on M1 is that it is an arm processor and thus all of FAST and it's dependcies must be recompiled for arm. This will take some time work and i need to find some funds to do it.

My goal is to support these new processors, but i need to find time and funds to do it.

mawskay commented 1 year ago

I have a Mac M1, can I try to build the project using the same instructions as the macOS steps described in the wiki? What other changes should I consider?

smistad commented 1 year ago

FAST depends on a lot of third party libraries like Qt, zlib, zip, dcmtk ++, and I precompile these for FAST to make it more robust. Thus, these libraries will have to be recompiled for M1/arm before FAST can be compiled for M1/arm. This might be some work, as there probably will be some hurdles along the way.

If you still would like to try; FAST's third party libraries are compiled and packaged using the code in this repository: https://github.com/smistad/FAST-dependencies/ A lot of these libraries are optional though. If you manage to compile the mandatory ones: zlib, zip and qt5 you should be able to compile FAST as well.

smistad commented 1 year ago

Hi again @mawskay

I have now successfully built FAST on Mac M1. The binaries are available at https://github.com/smistad/FAST/releases/tag/v4.6.0 The packages with the tags macos and arm64 are for Mac M1. You can also install pyFAST from pip for Mac M1 now using pip install pyfast. FAST for Mac M1 still uses OpenCL which seems to work fine.

mawskay commented 1 year ago

Thanks a lot! @smistad