GeneRisi
(Gene Risi)
April 24, 2024, 3:58am
1
PyTorch has support for using the shaders in the M series chips, but to use it, one has to use the arm64 version of Python. Should a native (in this case, M3) build of Slicer3D be possible? If yes, where should I get the 5.15.2 Qt package (for MacOS arm64)?
Thank you!
Gene
Support for a macOS arm64 version of Slicer is something planned though not for the immediate short term. If you have technical build experience you can try following the collection of work arounds to get something working posted in the following issue:
opened 05:46PM - 12 Oct 21 UTC
Type: Bug
Domain: build-system
## Steps to reproduce
I followed all the instructions from the [docs](https:/… /slicer.readthedocs.io/en/latest/developer_guide/build_instructions/macos.html#prerequisites) to build slicer from source.
Build halts with the following error while trying to build DCMTK:
```
make[2]: *** [DCMTK-prefix/src/DCMTK-stamp/DCMTK-configure] Error 1
make[1]: *** [CMakeFiles/DCMTK.dir/all] Error 2
-- OpenSSL: Errors detected - See below.
ld: warning: double slash removed from -install_name (/Users/kliron/opt/slicer/OpenSSL//libcrypto.1.1.dylib)
ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
ld: warning: ignoring file /Users/kliron/opt/slicer/zlib-install/lib/libz.a, building for macOS-i386 but attempting to link with file built for macOS-arm64
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/libSystem.tbd, missing required architecture i386 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.3.sdk/usr/lib/libSystem.tbd (3 slices)
Undefined symbols for architecture i386:
"__DefaultRuneLocale", referenced from:
_CONF_parse_list in conf_mod.o
"___bzero", referenced from:
_ASN1_BIT_STRING_set_bit in a_bitstr.o
_asn1_item_embed_new in tasn_new.o
_addr_strings in b_addr.o
_mem_ctrl in bss_mem.o
_BLAKE2b_Final in blake2b.o
_BLAKE2s_Final in blake2s.o
_bn_div_fixed_top in bn_div.o
...
[...an extensive output of a lot more missing symbols...]
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [libcrypto.dylib] Error 1
make[3]: *** [build_libs] Error 2
CMake Error at /Users/kliron/Projects/slicer/CMake/ExternalProjectForNonCMakeProject.cmake:104 (message):
OpenSSL: build step failed with exit code '2'.
```
## Expected behavior
A successful build.
## Environment
- Slicer version: latest source tree
- Operating system: MacOS Big Sur 11.6
Has anyone been able to compile slicer from source on a M1 Mac? How do I bypass the missing i386 openssl library?
Some uses of PyTorch in things like TotalSegmentator are still not optimized for the MPS usage in PyTorch as seen at:
opened 05:56PM - 29 Dec 23 UTC
I'm running TotalSegmentator on my M3Max chip (16-core CPU 40-core GPU) Macbook … Pro and it's taking over 600 seconds to fully segment a 3D CT image of size 512*512*54, whereas it tends to take about 60 seconds on my 3070 GPU desktop. Is it possible that the latest version of totalsegmentator just uses the Macbook's CPU instead of calling the Macbook's "MPS" when using pytorch?
Therefore I can’t say for sure how much benefit you may get at this time.