From c73a0fd6b908600b18dfad16c98e98441c8d33df Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Mon, 15 Dec 2025 15:49:57 -0800 Subject: [PATCH] Ignore macOS GPUs before macOS 15 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. --- mojo/mojo_host_platform.bzl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mojo/mojo_host_platform.bzl b/mojo/mojo_host_platform.bzl index bf690e1..e37a435 100644 --- a/mojo/mojo_host_platform.bzl +++ b/mojo/mojo_host_platform.bzl @@ -88,6 +88,14 @@ def _get_amd_constraints_with_rocm_smi(rctx, rocm_smi, gpu_mapping): return constraints def _get_apple_constraint(rctx, gpu_mapping): + result = rctx.execute(["/usr/bin/sw_vers", "--productVersion"]) + _log_result(rctx, "/usr/sbin/sw_vers --productVersion", result) + if result.return_code != 0: + fail("sw_vers failed, please report this issue: {}".format(result.stderr)) + major_version = int(result.stdout.split(".")[0]) + if major_version < 15: + return None # Metal < 3.2 is not supported + result = rctx.execute(["/usr/sbin/system_profiler", "SPDisplaysDataType"]) if result.return_code != 0: return None # TODO: Should we fail instead?