3-manifolds / Sage_macOS

SageMath as a macOS application bundle.
156 stars 15 forks source link

Can I use it on new apple silicon M1? #20

Closed s4lTea closed 3 years ago

s4lTea commented 3 years ago

Now I have an Apple M1 machine, I wonder if sage has a M1 version or just for intel. If it supports M1, how can I use it?

culler commented 3 years ago

As I understand it, the M1 systems come with an Intel emulator, so they might be able to run this app. It has not been tested, however, and there are probably issues with the AVX2 instructions. I would recommend trying the 9.4 beta version. Please let us know if it crashes.

NathanDunfield commented 3 years ago

Another option, which provides native support for the M1 processor is to install Sage via Conda.

s4lTea commented 3 years ago

As I understand it, the M1 systems come with an Intel emulator, so they might be able to run this app. It has not been tested, however, and there are probably issues with the AVX2 instructions. I would recommend trying the 9.4 beta version. Please let us know if it crashes.

thx!I have already installed SageMath-9.2 macOS app https://github.com/3-manifolds/Sage_macOS/releases/tag/v1.0 installed from dmg. It worked and not crashed: )

s4lTea commented 3 years ago

Another option, which provides native support for the M1 processor is to install Sage via Conda.

thx! I'll try it!

caiorcferreira commented 3 years ago

For information purposes, when trying to install with the DMG package from the release page on version 9.3 it crashed. With version 9.2 it worked as expected.

The error reported was:

Process:               python3.9 [1850]
Path:                  /Applications/SageMath-9-3.app/Contents/MacOS/SageMath
Identifier:            org.computop.SageMath
Version:               ???
Code Type:             X86-64 (Translated)
Parent Process:        ??? [1]
Responsible:           python3.9 [1850]
User ID:               501

Date/Time:             2021-08-21 23:27:52.244 -0300
OS Version:            macOS 11.5.1 (20G80)
Report Version:        12
Anonymous UUID:        3F89A5E8-5CAE-916B-EF7F-9CF5A05499A8

Sleep/Wake UUID:       EBB776BB-1E61-42DD-8F6A-BA965AF7AADD

Time Awake Since Boot: 13000 seconds
Time Since Wake:       10000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes:       0x0000000000000001, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Signal:    Illegal instruction: 4
Termination Reason:    Namespace SIGNAL, Code 0x4
Terminating Process:   exc handler [1850]

Application Specific Information:
dyld2 mode

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   libpython3.9.dylib              0x000000010d51f202 _PyMem_SetDefaultAllocator + 34
1   libpython3.9.dylib              0x000000010d5fae1e _PyRuntimeState_Init + 30
2   libpython3.9.dylib              0x000000010d5f7c52 _PyRuntime_Initialize + 50
3   libpython3.9.dylib              0x000000010d61a8b2 0x10d48a000 + 1640626
4   libpython3.9.dylib              0x000000010d61aa3b Py_BytesMain + 43
5   libdyld.dylib                   0x00007fff20399f3d start + 1

Thread 1:: com.apple.rosetta.exceptionserver
0   runtime                         0x00007ffdffc47a28 0x7ffdffc43000 + 18984
1   runtime                         0x00007ffdffc4ceec 0x7ffdffc43000 + 40684
2   runtime                         0x00007ffdffc4e2c0 0x7ffdffc43000 + 45760

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x000000010d51f920  rbx: 0x000000010d75d090  rcx: 0x000000030b18bb18  rdx: 0x000000030b18baa0
  rdi: 0x0000000000000000  rsi: 0x000000030b18b778  rbp: 0x000000030b18b760  rsp: 0x000000030b18b760
   r8: 0x0000000000000000   r9: 0x0000000000000000  r10: 0x0000000000000002  r11: 0x000000010d61aa10
  r12: 0x0000000000000000  r13: 0x0000000000000000  r14: 0x000000030b18b898  r15: 0x0000000000000000
  rip: <unavailable>  rfl: 0x0000000000000243

Binary Images:
       0x104f68000 -        0x104f6bfff +SageMath (0) <353C3350-2970-3C72-A885-219F979F24F4> /Applications/SageMath-9-3.app/Contents/Frameworks/Sage.framework/Versions/9.3/local/bin/python3.9
       0x10cf8a000 -        0x10cfd9fff +libRosettaRuntime (203.58) <B7ACCAB9-2251-33FA-AAB3-B2ED92992F33> /Library/Apple/*/libRosettaRuntime
       0x10d48a000 -        0x10d701fff +libpython3.9.dylib (0) <86451832-18F4-37B4-B6F5-FDA94047BF08> /Applications/SageMath-9-3.app/Contents/Frameworks/Sage.framework/Versions/9.3/local/lib/libpython3.9.dylib
       0x205108000 -        0x2051a3fff  dyld (852.2) <57DB2053-BFD5-3683-97C6-F1DB2A1F1D09> /usr/lib/dyld
    0x7ffdffc43000 -     0x7ffdffc72fff  runtime (203.58) <52A2E5D0-FAA3-34EF-8BB7-07F73718C034> /usr/libexec/rosetta/runtime
    0x7fff200b6000 -     0x7fff200b7fff  libsystem_blocks.dylib (79) <C05B8BD3-ADF0-37BD-BF53-664D03226FD9> /usr/lib/system/libsystem_blocks.dylib
    0x7fff200b8000 -     0x7fff200edfff  libxpc.dylib (2038.120.1) <D3D34FC5-2269-399E-A637-4D33E6BAFC64> /usr/lib/system/libxpc.dylib
    0x7fff200ee000 -     0x7fff20105fff  libsystem_trace.dylib (1277.120.1) <5B36BE08-BABA-3F2F-934B-B3FFD10A07A3> /usr/lib/system/libsystem_trace.dylib
    0x7fff20106000 -     0x7fff201a3fff  libcorecrypto.dylib (1000.140.4) <75692EFA-23F5-381B-A2BB-A8C8B78FCFAA> /usr/lib/system/libcorecrypto.dylib
    0x7fff201a4000 -     0x7fff201d0fff  libsystem_malloc.dylib (317.140.5) <0AEDABF0-CFF7-3304-9FF8-EB3BBF0801E6> /usr/lib/system/libsystem_malloc.dylib
    0x7fff201d1000 -     0x7fff20215fff  libdispatch.dylib (1271.120.2) <B0C73267-1BD9-3BEF-97CC-3B3D295FA58A> /usr/lib/system/libdispatch.dylib
    0x7fff20216000 -     0x7fff2024ffff  libobjc.A.dylib (824) <4320EF83-8948-3828-B18A-22EC5F295968> /usr/lib/libobjc.A.dylib
    0x7fff20250000 -     0x7fff20252fff  libsystem_featureflags.dylib (28.60.1) <45D158F7-C4E4-3BDE-A218-AD346686E7AB> /usr/lib/system/libsystem_featureflags.dylib
    0x7fff20253000 -     0x7fff202dbfff  libsystem_c.dylib (1439.141.1) <337F746F-8232-3439-BBFF-BAB9C10731F4> /usr/lib/system/libsystem_c.dylib
    0x7fff202dc000 -     0x7fff20331fff  libc++.1.dylib (905.6) <F4EC1A92-1DFC-3228-9868-5377EB375100> /usr/lib/libc++.1.dylib
    0x7fff20332000 -     0x7fff20347fff  libc++abi.dylib (905.6) <2F9B5E97-FD54-342A-8233-A5ECCD949F81> /usr/lib/libc++abi.dylib
    0x7fff20348000 -     0x7fff20377fff  libsystem_kernel.dylib (7195.141.2) <B51DEA59-1260-35C6-B7B6-AA6D8459ECEC> /usr/lib/system/libsystem_kernel.dylib
    0x7fff20378000 -     0x7fff20383fff  libsystem_pthread.dylib (454.120.2) <B1A74420-49E9-32FC-BFCB-E53550236A23> /usr/lib/system/libsystem_pthread.dylib
    0x7fff20384000 -     0x7fff203bffff  libdyld.dylib (852.2) <11007DE4-ABE1-3079-BF1C-4D0EADA884DD> /usr/lib/system/libdyld.dylib
    0x7fff203c0000 -     0x7fff203c9fff  libsystem_platform.dylib (254.80.2) <6F368391-D41B-3A7E-9992-6000FA985F21> /usr/lib/system/libsystem_platform.dylib
    0x7fff203ca000 -     0x7fff203f5fff  libsystem_info.dylib (542.40.3) <3965B574-34FA-3CF8-BB0B-FCEC7DA8C493> /usr/lib/system/libsystem_info.dylib
    0x7fff203f6000 -     0x7fff20893fff  com.apple.CoreFoundation (6.9 - 1777.103) <A3A992A9-C3EA-3D3A-AAD7-ED2587923EE5> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
    0x7fff2248f000 -     0x7fff226eefff  libicucore.A.dylib (66112) <0F2D441F-A530-322B-B408-5963ABE0A3DF> /usr/lib/libicucore.A.dylib
    0x7fff226ef000 -     0x7fff226f8fff  libsystem_darwin.dylib (1439.141.1) <3D4F1678-BA4A-3318-8DD0-D391F3AB9986> /usr/lib/system/libsystem_darwin.dylib
    0x7fff22b0e000 -     0x7fff22b19fff  libsystem_notify.dylib (279.40.4) <1AE27156-89B5-3E4A-AB14-A77E91F93DC7> /usr/lib/system/libsystem_notify.dylib
    0x7fff24aa5000 -     0x7fff24ab3fff  libsystem_networkextension.dylib (1295.140.3) <8D9FA7DC-AE37-3C15-B730-B9E3CA879BA7> /usr/lib/system/libsystem_networkextension.dylib
    0x7fff24b12000 -     0x7fff24b28fff  libsystem_asl.dylib (385) <9284A3C6-2AB1-3596-BD6C-0D19C7A0DD99> /usr/lib/system/libsystem_asl.dylib
    0x7fff26223000 -     0x7fff2622afff  libsystem_symptoms.dylib (1431.140.1) <D2EDA831-DD60-318D-B59E-60429F9BF82F> /usr/lib/system/libsystem_symptoms.dylib
    0x7fff28536000 -     0x7fff28546fff  libsystem_containermanager.dylib (318.100.4) <6A824A01-6B4C-30DA-907A-580FD51773B8> /usr/lib/system/libsystem_containermanager.dylib
    0x7fff2924e000 -     0x7fff29251fff  libsystem_configuration.dylib (1109.140.1) <99C91EBA-ADE0-3904-8F9C-38B0E3830936> /usr/lib/system/libsystem_configuration.dylib
    0x7fff29252000 -     0x7fff29256fff  libsystem_sandbox.dylib (1441.141.1) <AF683466-5935-369E-A915-006F13CDAD99> /usr/lib/system/libsystem_sandbox.dylib
    0x7fff29e56000 -     0x7fff29e58fff  libquarantine.dylib (119.40.2) <C34FBC7A-963B-3F1D-BBC1-D3C6BB46E14B> /usr/lib/system/libquarantine.dylib
    0x7fff2a401000 -     0x7fff2a405fff  libsystem_coreservices.dylib (127.1) <8F154612-D3F5-3DEB-AF88-48247ABF988E> /usr/lib/system/libsystem_coreservices.dylib
    0x7fff2a615000 -     0x7fff2a660fff  libsystem_m.dylib (3186.100.3) <09799648-AB94-3371-A552-AE8F5BB79FF6> /usr/lib/system/libsystem_m.dylib
    0x7fff2a662000 -     0x7fff2a667fff  libmacho.dylib (980) <2696D4F7-BF83-304F-BDED-9CC268B5FE4E> /usr/lib/system/libmacho.dylib
    0x7fff2a684000 -     0x7fff2a68ffff  libcommonCrypto.dylib (60178.120.3) <79B2C85C-C388-3AFF-B47C-DF0EE43FD292> /usr/lib/system/libcommonCrypto.dylib
    0x7fff2a690000 -     0x7fff2a69afff  libunwind.dylib (201) <072F009A-A981-308F-BEC5-06D58CA30BCF> /usr/lib/system/libunwind.dylib
    0x7fff2a69b000 -     0x7fff2a6a2fff  liboah.dylib (203.58) <A7FFAFB5-B0AB-312E-8EB6-FAF56D76FB7D> /usr/lib/liboah.dylib
    0x7fff2a6a3000 -     0x7fff2a6adfff  libcopyfile.dylib (173.40.2) <569E5E4E-73BE-3C12-818F-713DA0591E1D> /usr/lib/system/libcopyfile.dylib
    0x7fff2a6ae000 -     0x7fff2a6b5fff  libcompiler_rt.dylib (102.2) <396ECEB9-331A-3100-8FA3-BFF3CFC760D6> /usr/lib/system/libcompiler_rt.dylib
    0x7fff2a6b6000 -     0x7fff2a6b8fff  libsystem_collections.dylib (1439.141.1) <AC793F4A-A519-33D5-AE4B-8F903A7B9551> /usr/lib/system/libsystem_collections.dylib
    0x7fff2a6b9000 -     0x7fff2a6bbfff  libsystem_secinit.dylib (87.60.1) <FB875594-4026-3AFB-AF61-BCD1A67478CC> /usr/lib/system/libsystem_secinit.dylib
    0x7fff2a6bc000 -     0x7fff2a6befff  libremovefile.dylib (49.120.1) <9646E2E1-71D1-3463-A556-8CD96059A4A9> /usr/lib/system/libremovefile.dylib
    0x7fff2a6bf000 -     0x7fff2a6bffff  libkeymgr.dylib (31) <07EC6CD6-0DCC-321C-856B-65FF4327E963> /usr/lib/system/libkeymgr.dylib
    0x7fff2a6c0000 -     0x7fff2a6c7fff  libsystem_dnssd.dylib (1310.140.1) <A6F00D58-D64A-35B5-8777-93FC2A690675> /usr/lib/system/libsystem_dnssd.dylib
    0x7fff2a6c8000 -     0x7fff2a6cdfff  libcache.dylib (83) <B92F6CCC-FF53-36B1-BBE0-F056080945D7> /usr/lib/system/libcache.dylib
    0x7fff2a6ce000 -     0x7fff2a6cffff  libSystem.B.dylib (1292.120.1) <46BD4B87-AAC4-3070-BF8B-6BE393247BBE> /usr/lib/libSystem.B.dylib
    0x7fff2a6d0000 -     0x7fff2a6d3fff  libfakelink.dylib (3) <B2261718-E30D-3DC8-B5D0-E41CB356799C> /usr/lib/libfakelink.dylib
    0x7fff2a6d4000 -     0x7fff2a6d4fff  com.apple.SoftLinking (1.0 - 1) <B0F10423-EB4B-3EBE-AAD7-F43F1F29A9CC> /System/Library/PrivateFrameworks/SoftLinking.framework/Versions/A/SoftLinking
    0x7fff2dc2c000 -     0x7fff2dc2cfff  liblaunch.dylib (2038.120.1) <CA5C47E3-5580-3C92-9603-9404291FAE58> /usr/lib/system/liblaunch.dylib
    0x7fff300c3000 -     0x7fff300c3fff  libsystem_product_info_filter.dylib (8.40.1) <C983DE00-5802-390A-9FEC-703E0E9A2114> /usr/lib/system/libsystem_product_info_filter.dylib

Translated Code Information:
  tmp0: 0x000000010d51f202 tmp1: 0x001fc3360510fcc5 tmp2: 0x004863eb0611fcc5

External Modification Summary:
  Calls made by other processes targeting this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by this process:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0
  Calls made by all processes on this machine:
    task_for_pid: 0
    thread_create: 0
    thread_set_state: 0

VM Region Summary:
ReadOnly portion of Libraries: Total=521.1M resident=0K(0%) swapped_out_or_unallocated=521.1M(100%)
Writable regions: Total=168.7M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=168.7M(100%)

                                VIRTUAL   REGION 
REGION TYPE                        SIZE    COUNT (non-coalesced) 
===========                     =======  ======= 
Kernel Alloc Once                    8K        1 
MALLOC                            9312K        8 
MALLOC guard page                   96K        4 
Rosetta Arena                     4096K        2 
Rosetta Generic                    596K      146 
Rosetta IndirectBranch              32K        1 
Rosetta JIT                      128.0M        1 
Rosetta Return Stack                20K        2 
Rosetta Thread Context              20K        2 
Stack                             16.0M        1 
Stack Guard                         16K        1 
VM_ALLOCATE                       7860K        2 
VM_ALLOCATE (reserved)              12K        1         reserved VM address space (unallocated)
__DATA                             914K       53 
__DATA_CONST                      2983K       38 
__DATA_DIRTY                        95K       24 
__LINKEDIT                       506.3M       11 
__OBJC_RO                         70.3M        1 
__OBJC_RW                         2480K        2 
__TEXT                            14.9M       51 
__UNICODE                          588K        1 
mapped file                        4.1G       86 
shared memory                       16K        1 
unshared pmap                     2896K        2 
===========                     =======  ======= 
TOTAL                              4.9G      442 
TOTAL, minus reserved VM space     4.9G      442 

Model: MacBookPro17,1, BootROM 6723.140.2, proc 8:4:4 processors, 16 GB, SMC 
Graphics: kHW_AppleM1Item, Apple M1, spdisplays_builtin
Memory Module: LPDDR4
AirPort: spairport_wireless_card_type_airport_extreme, wl0: Jul  7 2021 00:48:27 version 18.50.40.10.7.8.121 FWID 01-f5ad2691
Bluetooth: Version 8.0.5d7, 3 services, 27 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
USB Device: USB 3.1 Bus
USB Device: USB 3.1 Bus
Thunderbolt Bus: MacBook Pro, Apple Inc.
Thunderbolt Bus: MacBook Pro, Apple Inc.
NathanDunfield commented 3 years ago

For information purposes, when trying to install with the DMG package from the release page on version 9.3 it crashed. With version 9.2 it worked as expected.

The prerelease version of 9.4 has been reported to work on M1 macs.

culler commented 3 years ago

Closing this ticket since it appears that the latest release will work with the Intel emulator. Once we have M1 hardware available we will build a release targeting ARM cpus.