Skip to content

For Apple silicon, add separation between architecture and Metal API selection#96

Merged
Ahajha merged 1 commit into
modular:mainfrom
BradLarson:apple-silicon-detection
Jun 25, 2026
Merged

For Apple silicon, add separation between architecture and Metal API selection#96
Ahajha merged 1 commit into
modular:mainfrom
BradLarson:apple-silicon-detection

Conversation

@BradLarson

Copy link
Copy Markdown
Member

Bazel currently detects only the Metal SDK API version for Apple silicon GPUs, passing that as the architecture string. This results in M2 GPUs running macOS 26 being reported as metal:4, which is different from how Mojo internally detects this hardware (metal:2-metal4). This leads to Bazel-run tests reporting different architecture support than Mojo does when not built via Bazel.

This should at least align the hardware architectures with the correct listings (adding a new listing for M1 hardware), and then detect if the Metal 4 API is present to append to the hardware string.

Comment thread mojo/mojo_host_platform.bzl
@pprovins

Copy link
Copy Markdown

... I think a lot of this stems from Mojo choosing to name "Apple M2" as "metal2".

Is it too late to change that name to something like "agx-m2" -> "apple graphics gpu m2"

@Ahajha

Ahajha commented Jun 16, 2026

Copy link
Copy Markdown
Member

I wouldn't think it's too late, go for it. But I also don't know how involved the actual change would be.

@BradLarson

Copy link
Copy Markdown
Member Author

The big thing here is I want to make sure we align how we detect and describe the architecture / API version internally with how we do it in Bazel. If we do rework how we describe the architecture string, we may want to do that first internally, then reflect it in Bazel once that lands. This was just matching our current internal behavior for special-casing the Metal 4 API level. I imagine we'll want the flexibility for 4.1, etc. API capabilities in the future and may want a more general solution for the architecture / API matrix.

@Ahajha Ahajha merged commit a33aaa6 into modular:main Jun 25, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants