From fcf24cef88cd71d9041d6cbd2f1f8a10bfa6ed7e Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Mon, 2 Sep 2024 19:17:17 -0600 Subject: [PATCH] detect.py: Resolve Haswell + AMD GCN combo --- .../sys_patch/patchsets/detect.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/opencore_legacy_patcher/sys_patch/patchsets/detect.py b/opencore_legacy_patcher/sys_patch/patchsets/detect.py index 98a3570e5..26e3fb320 100644 --- a/opencore_legacy_patcher/sys_patch/patchsets/detect.py +++ b/opencore_legacy_patcher/sys_patch/patchsets/detect.py @@ -339,17 +339,21 @@ class HardwarePatchsetDetection: Notes: - Non-Metal GPUs are stripped out if any Metal GPUs are present - Metal 3802 GPUs are stripped out if Metal 31001 GPUs are present on macOS Sequoia or newer + - Exception is made for "Graphics: AMD Legacy GCN" on Sequoia or newer + - Special handling is done in amd_legacy_gcn.py """ non_metal_gpu_present = False metal_gpu_present = False metal_3802_gpu_present = False metal_31001_gpu_present = False + metal_31001_name = None for hardware in present_hardware: hardware: BaseHardware sub_variant = hardware.hardware_variant_graphics_subclass() if sub_variant == HardwareVariantGraphicsSubclass.METAL_31001_GRAPHICS: metal_31001_gpu_present = True + metal_31001_name = hardware.name() elif sub_variant == HardwareVariantGraphicsSubclass.METAL_3802_GRAPHICS: metal_3802_gpu_present = True elif sub_variant == HardwareVariantGraphicsSubclass.NON_METAL_GRAPHICS: @@ -366,12 +370,13 @@ class HardwarePatchsetDetection: present_hardware.remove(hardware) if metal_3802_gpu_present and metal_31001_gpu_present and self._xnu_major >= os_data.sequoia.value: - logging.error("Cannot mix Metal 3802 and Metal 31001 GPUs on macOS Sequoia or newer") - logging.error("Stripping out Metal 3802 GPUs") - for hardware in list(present_hardware): - if hardware.hardware_variant_graphics_subclass() == HardwareVariantGraphicsSubclass.METAL_3802_GRAPHICS: - logging.error(f" Stripping out {hardware.name()}") - present_hardware.remove(hardware) + if metal_31001_name != "Graphics: AMD Legacy GCN": + logging.error("Cannot mix Metal 3802 and Metal 31001 GPUs on macOS Sequoia or newer") + logging.error("Stripping out Metal 3802 GPUs") + for hardware in list(present_hardware): + if hardware.hardware_variant_graphics_subclass() == HardwareVariantGraphicsSubclass.METAL_3802_GRAPHICS: + logging.error(f" Stripping out {hardware.name()}") + present_hardware.remove(hardware) return present_hardware