[SERVER-56728] Cannot run 4.9+ on Apple Silicon Created: 06/May/21  Updated: 29/Oct/23  Resolved: 09/May/21

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: None
Fix Version/s: 4.9.0-rc1, 5.0.0-rc0

Type: Bug Priority: Blocker - P1
Reporter: Louisa Berger Assignee: Andrew Morrow (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Documented
is documented by DOCS-14430 Investigate changes in SERVER-56728: ... Closed
Problem/Incident
is caused by SERVER-54407 Specify a microarchitecture minimum f... Closed
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.9
Sprint: Dev Platform 2021-05-17
Participants:
Case:

 Description   

Mongo 4.9+ cannot start on M1 laptops:

% /tmp/mms-automation/test/versions/mongodb-macos-x86_64-4.9.0-rc0/bin/mongod
zsh: illegal hardware instruction  /tmp/mms-automation/test/versions/mongodb-macos-x86_64-4.9.0-rc0/bin/mongod

acm tracked down that this is because the ISA targeting for the server build was upgraded in 4.9 to sandybridge, which uses AVX instructions that are not handled by Rosetta:
https://developer.apple.com/documentation/apple-silicon/about-the-rosetta-translation-environment

Rosetta translates all x86_64 instructions, but it doesn't support the execution of some newer instruction sets and processor features, such as AVX, AVX2, and AVX512 vector instructions.

He recommended special case downgrading the macOS target ISA to something that doesn’t generate AVX until we have a native Apple Silicon build.



 Comments   
Comment by Githook User [ 09/May/21 ]

Author:

{'name': 'Andrew Morrow', 'email': 'acm@mongodb.com', 'username': 'acmorrow'}

Message: SERVER-56728 Don't enable sandybridge optimizations for macOS

Doing so allows AVX instructions, but those aren't supported on
Rosetta 2. We can restore this one we have native Apple Silicon
builds.

(cherry picked from commit d740377ed7aa5bf944aa0750eb5a14379314f6c3)
Branch: v4.9
https://github.com/mongodb/mongo/commit/925e0ea2b6ea9d4377d0be9f6305a74b69d580eb

Comment by Githook User [ 09/May/21 ]

Author:

{'name': 'Andrew Morrow', 'email': 'acm@mongodb.com', 'username': 'acmorrow'}

Message: SERVER-56728 Don't enable sandybridge optimizations for macOS

Doing so allows AVX instructions, but those aren't supported on
Rosetta 2. We can restore this one we have native Apple Silicon
builds.
Branch: master
https://github.com/mongodb/mongo/commit/d740377ed7aa5bf944aa0750eb5a14379314f6c3

Comment by Andrew Morrow (Inactive) [ 06/May/21 ]

This is a consequence of SERVER-54407 where we bumped our target microarchitecture to sandybridge. That entitled the compiler to start emitting AVX instructions. Unfortunately, Rosetta2 does not support those instructions, per https://developer.apple.com/documentation/apple-silicon/about-the-rosetta-translation-environment.

We will need to downgrade the microarchitecture targeting for macOS to something which does not contain AVX instructions, probably core2.

Once we have a native Apple Silicon build, we can reevaluate microarchitecture targeting for macOS.

Generated at Thu Feb 08 05:40:03 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.