diff --git a/mojo/extensions.bzl b/mojo/extensions.bzl index bb4bee7..f1ee985 100644 --- a/mojo/extensions.bzl +++ b/mojo/extensions.bzl @@ -204,10 +204,8 @@ _gpu_toolchains_tag = tag_class( "mi300x": "amdgpu:gfx942", "mi325": "amdgpu:gfx942", "rtx5090": "nvidia:120a", - "m1": "metal:10", - "m2": "metal:20", - "m3": "metal:30", - "m4": "metal:40", + "metal3": "metal:30", + "metal4": "metal:40", }, doc = "The GPUs supported by this toolchain, mapping to Mojo's target accelerators.", ), @@ -231,10 +229,8 @@ _gpu_toolchains_tag = tag_class( "MI325": "mi325", "Navi": "radeon", "AMD Radeon Graphics": "radeon", - "Apple M1": "m1", - "Apple M2": "m2", - "Apple M3": "m3", - "Apple M4": "m4", + "Metal 3": "metal3", + "Metal 4": "metal4", }, doc = "The output from nvidia-smi or rocm-smi to the corresponding GPU name in SUPPORTED_GPUS.", ), diff --git a/mojo/mojo_host_platform.bzl b/mojo/mojo_host_platform.bzl index c43b8ca..bf690e1 100644 --- a/mojo/mojo_host_platform.bzl +++ b/mojo/mojo_host_platform.bzl @@ -94,17 +94,17 @@ def _get_apple_constraint(rctx, gpu_mapping): _log_result(rctx, "/usr/sbin/system_profiler SPDisplaysDataType", result) - chipset = None + metal_version = None for line in result.stdout.splitlines(): - if "Chipset Model" in line: - chipset = line + if "Metal Support:" in line: + metal_version = line break - if not chipset: # macOS VMs may not have GPUs attached + if not metal_version: # macOS VMs may not have GPUs attached return None for gpu_name, constraint in gpu_mapping.items(): - if gpu_name in chipset: + if gpu_name in metal_version: if constraint: return "@mojo_gpu_toolchains//:{}_gpu".format(constraint) else: