detect.py: Resolve Haswell + AMD GCN combo

This commit is contained in:
Mykola Grymalyuk
2024-09-02 19:17:17 -06:00
parent 1d37c5a4ee
commit fcf24cef88

View File

@@ -339,17 +339,21 @@ class HardwarePatchsetDetection:
Notes: Notes:
- Non-Metal GPUs are stripped out if any Metal GPUs are present - 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 - 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 non_metal_gpu_present = False
metal_gpu_present = False metal_gpu_present = False
metal_3802_gpu_present = False metal_3802_gpu_present = False
metal_31001_gpu_present = False metal_31001_gpu_present = False
metal_31001_name = None
for hardware in present_hardware: for hardware in present_hardware:
hardware: BaseHardware hardware: BaseHardware
sub_variant = hardware.hardware_variant_graphics_subclass() sub_variant = hardware.hardware_variant_graphics_subclass()
if sub_variant == HardwareVariantGraphicsSubclass.METAL_31001_GRAPHICS: if sub_variant == HardwareVariantGraphicsSubclass.METAL_31001_GRAPHICS:
metal_31001_gpu_present = True metal_31001_gpu_present = True
metal_31001_name = hardware.name()
elif sub_variant == HardwareVariantGraphicsSubclass.METAL_3802_GRAPHICS: elif sub_variant == HardwareVariantGraphicsSubclass.METAL_3802_GRAPHICS:
metal_3802_gpu_present = True metal_3802_gpu_present = True
elif sub_variant == HardwareVariantGraphicsSubclass.NON_METAL_GRAPHICS: elif sub_variant == HardwareVariantGraphicsSubclass.NON_METAL_GRAPHICS:
@@ -366,6 +370,7 @@ class HardwarePatchsetDetection:
present_hardware.remove(hardware) present_hardware.remove(hardware)
if metal_3802_gpu_present and metal_31001_gpu_present and self._xnu_major >= os_data.sequoia.value: if metal_3802_gpu_present and metal_31001_gpu_present and self._xnu_major >= os_data.sequoia.value:
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("Cannot mix Metal 3802 and Metal 31001 GPUs on macOS Sequoia or newer")
logging.error("Stripping out Metal 3802 GPUs") logging.error("Stripping out Metal 3802 GPUs")
for hardware in list(present_hardware): for hardware in list(present_hardware):