Mantid crash on startup in Big Sur (MacOS 11.0.1)

Hi, I’ve got a fancy new mac with the new M1 chip. Mantid does not seem to like it. In a similar way the crash reporter crashes on startup.

Expected behavior

Mantid starts up nicely

Actual behavior

Spinning beachball/unresponsive application

Steps to reproduce the behavior

Start mantid

Platforms affected

MacOS Big Sur 11.0.01 new mac mini with M1 processor
Mantid 5.1.0 & 5.1.20201202.1608

As far as I know, no one has tried to install Mantid on a new Mac with Big Sur yet!

Was there a “Problem Report for Python” when Mantid failed to launch?

Nothing obvious popped up. I can have a dig about for logs etc. if you let me know where to look.

That’s fine for the moment. You would have seen the Python report pop-up if it was created.

To be honest, for the moment, we’re very unlikely to get Mantid to work with the M1 chip without some code changes. As we currently don’t have an M1 Mac in the development team, we’re not going to be able to support it. I’m sure as Big Sur and newer Macs become more common we’ll be able to support them, but for the meantime I’m not sure there’s much we can do, sadly.

I’ll update you if we start trying to support M1 devices.

Thanks Daniel. I was expecting that it would work easily enough due to the chips x86 emulation. Sounds like a good excuse to do some shopping to me…

Haha I agree it’s a good exciuse for some shopping. Later in the week, I might have a look at Big Sur on the Mac I’ve got, but can you try launching from terminal:

/Applications/MantidWorkbench.app/Contents/MacOS/MantidWorkbench

I assume that won’t work, but is there any useful ouput?

Also, try:

cd /Applications/MantidWorkbench.app/Contents/MacOS
export QT_PLUGIN_PATH=$PWD/../PlugIns/
export PYTHONPATH=$PWD:$PYTHONPATH
python3 -m workbench.app.main

And:

/Applications/MantidWorkbench.app/Contents/MacOS/mantidpython --classic
import qtpy.QtCore

If we can get some more info then we might not be flying so blind.

Hello again,

launching from terminal causes hanging as before, with no output.

The second test:

cd /Applications/MantidWorkbench.app/Contents/MacOS
export QT_PLUGIN_PATH=$PWD/../PlugIns/
export PYTHONPATH=$PWD:$PYTHONPATH
python3 -m workbench.app.main 

gives a lot of output:

Traceback (most recent call last):
  File "/Applications/MantidWorkbench.app/Contents/MacOS/mantid/utils.py", line 35, in import_mantid_cext
    lib = import_module(modulename, package)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 657, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 556, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1101, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: dlopen(/Applications/MantidWorkbench.app/Contents/MacOS/mantid/kernel/_kernel.so, 2): no suitable image found.  Did find:
	/Applications/MantidWorkbench.app/Contents/MacOS/mantid/kernel/_kernel.so: mach-o, but wrong architecture
	/Applications/MantidWorkbench.app/Contents/MacOS/mantid/kernel/_kernel.so: mach-o, but wrong architecture

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Applications/MantidWorkbench.app/Contents/MacOS/mantid/utils.py", line 39, in import_mantid_cext
    lib = import_module(modulename.lstrip('.'))
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named '_kernel'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/runpy.py", line 193, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Applications/MantidWorkbench.app/Contents/MacOS/workbench/app/main.py", line 55, in <module>
    main()
  File "/Applications/MantidWorkbench.app/Contents/MacOS/workbench/app/main.py", line 46, in main
    start(options)
  File "/Applications/MantidWorkbench.app/Contents/MacOS/workbench/app/main.py", line 50, in start
    from workbench.app.start import start
  File "/Applications/MantidWorkbench.app/Contents/MacOS/workbench/app/start.py", line 15, in <module>
    from mantid.api import FrameworkManagerImpl
  File "/Applications/MantidWorkbench.app/Contents/MacOS/mantid/__init__.py", line 105, in <module>
    from mantid import kernel as _kernel
  File "/Applications/MantidWorkbench.app/Contents/MacOS/mantid/kernel/__init__.py", line 36, in <module>
    import_mantid_cext('._kernel', 'mantid.kernel', globals())
  File "/Applications/MantidWorkbench.app/Contents/MacOS/mantid/utils.py", line 44, in import_mantid_cext
    raise ImportError(msg)
ImportError: First import of "._kernel" failed with "dlopen(/Applications/MantidWorkbench.app/Contents/MacOS/mantid/kernel/_kernel.so, 2): no suitable image found.  Did find:
	/Applications/MantidWorkbench.app/Contents/MacOS/mantid/kernel/_kernel.so: mach-o, but wrong architecture
	/Applications/MantidWorkbench.app/Contents/MacOS/mantid/kernel/_kernel.so: mach-o, but wrong architecture". Second import of "_kernel" failed with "No module named '_kernel'"
/Applications/MantidWorkbench.app/Contents/MacOS/mantidpython --classic

gives

Python 3.8.4 (default, Jul 14 2020, 01:58:29)
[Clang 10.0.0 (clang-1000.11.45.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

then

import qtpy.QtCore

executes without errors or output

Thanks for trying those. Can you try a slightly amended version of the second test, as it seems to be using your system Python rather than the version we have bundled with Mantid.

cd /Applications/MantidWorkbench.app/Contents/MacOS
export QT_PLUGIN_PATH=$PWD/../PlugIns/
export PYTHONPATH=$PWD:$PYTHONPATH
./python -m workbench.app.main

Same as previous - hangs on startup

It offers me an error report - I’ve clipped the start and added at the bottom, but can add the rest if you want. It’s pretty long.

I’d be happy if I can get the mantid algorithms working in standalone python.
if I try:

import sys
import os
os.environ.update({'MANTIDPATH': '/Applications/MantidPlot.app/Contents/MacOS'})
sys.path.append(os.environ['MANTIDPATH'])
from mantid.simpleapi import *

I get

ModuleNotFoundError: No module named 'mantid'

Is it possible that the installer is not properly setting MANTIDPATH? Should it be

'/Applications/MantidPlot.app/Contents/MacOS'

or is there some other directory I should point it at?

Thanks

Date/Time:        2020-12-09 15:28:20.083 +0000
End time:         2020-12-09 15:35:36.282 +0000
OS Version:       macOS 11.0.1 (Build 20B29)
Architecture:     arm64e
Report Version:   32

Data Source:      Stackshots
Shared Cache:     5B214DF8-6286-3F23-9467-D8050EA7AF75 slid base address 0x19b8c4000, slide 0x1b8c4000
Shared Cache:     37FEA16C-BED8-3B52-974D-F87051F072C8 slid base address 0x7fff20084000, slide 0x84000

Command:          Python
Path:             /Applications/MantidWorkbench.app/Contents/Frameworks/Python.framework/Versions/3.8/Resources/Python.app/Contents/MacOS/Python
Version:          ??? (???)
Parent:           zsh [5612]
Responsible:      Terminal [559]
PID:              5617
Time Since Fork:  437s

Event:            hang
Duration:         436.20s
Duration Sampled: 1.10s (process was unresponsive for 435 seconds before sampling)
Steps:            11 (100ms sampling interval)

Hardware model:   Macmini9,1
Active cpus:      8

Time Awake Since Boot: 59569s
Time Since Wake:  27549s

Fan speed:        1694 rpm

--------------------------------------------------
Timeline format: stacks are sorted chronologically
Use -i and -heavy to re-report with count sorting
--------------------------------------------------


Heaviest stack for the main thread of the target process:
  2  -[NSImage _usingRepresentationsPerformBlock:] + 77 (AppKit + 91175) [0x7fff22bae427]
  2  ??? [0x7ffe95e3ec7c]
  2  -[NSArray mutableCopyWithZone:] + 0 (CoreFoundation + 458305) [0x7fff20478e41]
 *2  ??? (kernel.release.t8101 + 578552) [0xfffffe0007dc53f8]


Process:          Python [5617]
UUID:             676A015B-EA5E-3D18-B7CE-BC2FE2286D8D
Shared Cache:     37FEA16C-BED8-3B52-974D-F87051F072C8 slid base address 0x7fff20084000, slide 0x84000
Path:             /Applications/MantidWorkbench.app/Contents/Frameworks/Python.framework/Versions/3.8/Resources/Python.app/Contents/MacOS/Python
Architecture:     x86_64 (translated)
Parent:           zsh [5612]
Responsible:      Terminal [559]
UID:              501
Footprint:        2222.64 MB
Time Since Fork:  437s
Num samples:      11 (1-11)
CPU Time:         0.806s (2.4G cycles, 7.7G instructions, 0.32c/i)
Note:             Suspended for 2 samples
Note:             Unresponsive for 435 seconds before sampling
Note:             2 idle work queue threads omitted

Oops - problem in previous post all my fault:
I used '/Applications/MantidPlot.app/Contents/MacOS' instead of '/Applications/MantidWorkbench.app/Contents/MacOS'.

Using the right path gives same error as

cd /Applications/MantidWorkbench.app/Contents/MacOS
export QT_PLUGIN_PATH=$PWD/../PlugIns/
export PYTHONPATH=$PWD:$PYTHONPATH
python3 -m workbench.app.main

(3 posts up)

Same (?) problem here: Big Sur, but still the good (?) old Intel processor (MB16"):

Summary

[marenair:~] hansen% setenv MANTIDPATH /Applications/MantidWorkbench.app/Contents/MacOS/
[marenair:~] hansen% python3
Python 3.8.2 (default, Nov 4 2020, 21:23:28)
[Clang 12.0.0 (clang-1200.0.32.28)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.

import sys
import os
sys.path.append(os.environ[‘MANTIDPATH’])
from mantid.simpleapi import *
Traceback (most recent call last):
File “”, line 1, in
File “/Applications/MantidWorkbench.app/Contents/MacOS/mantid/init.py”, line 105, in
from mantid import kernel as _kernel
File “/Applications/MantidWorkbench.app/Contents/MacOS/mantid/kernel/init.py”, line 36, in
import_mantid_cext(’._kernel’, ‘mantid.kernel’, globals())
File “/Applications/MantidWorkbench.app/Contents/MacOS/mantid/utils.py”, line 35, in import_mantid_cext
lib = import_module(modulename, package)
File “/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/importlib/init.py”, line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
SystemError: initialization of _kernel raised unreported exception

Wish I’d seen this before updating to Big Sur… there’s always something! I’m having the same issue, have tried this with latest stable version, and yesterday’s (27/01) nightly build. Still hanging on launch.

Quick update on this. Tried with most recent nightly build again (5.1.202010201.855) and some progress, actually getting to the stage where an error message appears before everything completely crashes!

Blockquote
Process: MantidWorkbenchNightly [49402]
Path: /Applications/MantidWorkbenchNightly.app/Contents/MacOS/MantidWorkbenchNightly
Identifier: org.mantidproject.MantidWorkbenchNightly
Version: 5.1.20210201.855 (5.1.20210201.855)
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: MantidWorkbenchNightly [49402]
User ID: 503
Date/Time: 2021-02-02 09:21:04.372 +0000
OS Version: macOS 11.1 (20C69)
Report Version: 12
Bridge OS Version: 5.1 (18P3030)
Anonymous UUID: DC8DD0A4-5ADE-2242-ADD7-8AE7A617FC82
Sleep/Wake UUID: FE40B694-AC30-4FB6-9A12-7F7E4DD4736B
Time Awake Since Boot: 210000 seconds
Time Since Wake: 1000 seconds
System Integrity Protection: enabled
Crashed Thread: 0
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Reason: DYLD, [0x1] Library missing
Application Specific Information:
dyld: launch, loading dependent libraries
Dyld Error Message:
dyld: Using shared cache: 467A83CB-BA86-3F07-B652-B9256C74080A
Library not loaded: /usr/local/opt/libomp/lib/libomp.dylib
Referenced from: /Applications/MantidWorkbenchNightly.app/Contents/MacOS/MantidWorkbenchNightly
Reason: image not found
Binary Images:
0x101217000 - 0x101229fff +org.mantidproject.MantidWorkbenchNightly (5.1.20210201.855 - 5.1.20210201.855) <068D2B5F-2944-31AB-B755-5674153E0CB6> /Applications/MantidWorkbenchNightly.app/Contents/MacOS/MantidWorkbenchNightly
0x101239000 - 0x10124cfff +libboost_filesystem-mt.dylib (0) /usr/local/opt/boost/lib/libboost_filesystem-mt.dylib
0x10c6c5000 - 0x10c760fff dyld (832.7.1) /usr/lib/dyld

Hi All

Same for me with Workbench and and M1 Big Sur Mac.
Interestingly, “end-of-life” mantidplot works fine.

Getting the same missing dynamic library message as ChrisR.

I’ve raised an issue and we’ll see if we can get a solution to this. I’ll update here if we do!

As mentioned on the issue, there seems to be a workaround, so you should be able to launch from terminal with:

export QT_MAC_WANTS_LAYER=1
/Applications/MantidWorkbench.app/Contents/MacOS/MantidWorkbench

Thanks Daniel - can confirm that works for me on M1.

1 Like

Works for me too - thanks

1 Like