Skip to content

Commit a6252c8

Browse files
authored
Ignore macOS GPUs before macOS 15 (#68)
Currently mojo requires metal 3.2, which is only macOS 15+. Unfortunately the system_profiler output doesn't contain this specificity so the easiest thing for us to do is check the major OS version first and just bail on that.
1 parent f2bda94 commit a6252c8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

mojo/mojo_host_platform.bzl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,14 @@ def _get_amd_constraints_with_rocm_smi(rctx, rocm_smi, gpu_mapping):
8888
return constraints
8989

9090
def _get_apple_constraint(rctx, gpu_mapping):
91+
result = rctx.execute(["/usr/bin/sw_vers", "--productVersion"])
92+
_log_result(rctx, "/usr/sbin/sw_vers --productVersion", result)
93+
if result.return_code != 0:
94+
fail("sw_vers failed, please report this issue: {}".format(result.stderr))
95+
major_version = int(result.stdout.split(".")[0])
96+
if major_version < 15:
97+
return None # Metal < 3.2 is not supported
98+
9199
result = rctx.execute(["/usr/sbin/system_profiler", "SPDisplaysDataType"])
92100
if result.return_code != 0:
93101
return None # TODO: Should we fail instead?

0 commit comments

Comments
 (0)