From 9bfcf78ff900e56b94a57b66f677ad309850cbe8 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sat, 11 Mar 2023 11:11:24 -0700 Subject: [PATCH] detect: Set new class for Lexa GPUs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As these cards require spoofing, OCLP needs to treat them differently. Primarily due to root volume patching checking against the same class, and prevent users from believing the root patches failed (when their card’s actually unsupported by their Device ID) --- data/pci_data.py | 3 +++ resources/build/graphics_audio.py | 11 +++++------ resources/defaults.py | 3 +++ resources/device_probe.py | 3 +++ 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/data/pci_data.py b/data/pci_data.py index 39c18b2ae..69aa831a3 100644 --- a/data/pci_data.py +++ b/data/pci_data.py @@ -794,6 +794,9 @@ class amd_ids: 0x67CA, # Unknown 0x67CC, # Unknown 0x67CF, # Unknown + ] + + polaris_spoof_ids = [ # Polaris 12 (Lexa) 0x6981, # Lexa XT [Radeon PRO WX 3200] ] diff --git a/resources/build/graphics_audio.py b/resources/build/graphics_audio.py index 1e019b9f1..85a71c34e 100644 --- a/resources/build/graphics_audio.py +++ b/resources/build/graphics_audio.py @@ -106,7 +106,7 @@ class build_graphics_audio: self.config["NVRAM"]["Delete"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"] += ["nvda_drv"] def backlight_path_detection(self): - + # self.constants.custom_model: iMac has been modded with new dGPU # self.computer.dgpu: dGPU has been found using the GFX0 path # self.computer.dgpu.pci_path: @@ -114,7 +114,7 @@ class build_graphics_audio: for i, device in enumerate(self.computer.gpus): logging.info(f"- Found dGPU ({i + 1}): {utilities.friendly_hex(device.vendor_id)}:{utilities.friendly_hex(device.device_id)}") self.config["#Revision"][f"Hardware-iMac-dGPU-{i + 1}"] = f"{utilities.friendly_hex(device.vendor_id)}:{utilities.friendly_hex(device.device_id)}" - + if device.pci_path != self.computer.dgpu.pci_path: logging.info("- device path and GFX0 Device path are different") self.gfx0_path = device.pci_path @@ -409,7 +409,6 @@ class build_graphics_audio: self.backlight_path_detection() # Check GPU Vendor if self.constants.metal_build is True: - # self.backlight_path_detection() logging.info("- Adding Metal GPU patches on request") if self.constants.imac_vendor == "AMD": self.amd_mxm_patch(self.gfx0_path) @@ -418,20 +417,18 @@ class build_graphics_audio: else: logging.info("- Failed to find vendor") elif not self.constants.custom_model and self.model in model_array.LegacyGPU and self.computer.dgpu: - # self.backlight_path_detection() logging.info(f"- Detected dGPU: {utilities.friendly_hex(self.computer.dgpu.vendor_id)}:{utilities.friendly_hex(self.computer.dgpu.device_id)}") if self.computer.dgpu.arch in [ device_probe.AMD.Archs.Legacy_GCN_7000, device_probe.AMD.Archs.Legacy_GCN_8000, device_probe.AMD.Archs.Legacy_GCN_9000, device_probe.AMD.Archs.Polaris, + device_probe.AMD.Archs.Polaris_Spoof, device_probe.AMD.Archs.Vega, device_probe.AMD.Archs.Navi, ]: - # self.backlight_path_detection() self.amd_mxm_patch(self.gfx0_path) elif self.computer.dgpu.arch == device_probe.NVIDIA.Archs.Kepler: - # self.backlight_path_detection() self.nvidia_mxm_patch(self.gfx0_path) def ioaccel_workaround(self): @@ -486,6 +483,7 @@ class build_graphics_audio: if gpu in [ # Metal KDK (pre-AVX2.0) device_probe.AMD.Archs.Polaris, + device_probe.AMD.Archs.Polaris_Spoof, device_probe.AMD.Archs.Vega, device_probe.AMD.Archs.Navi, ]: @@ -510,6 +508,7 @@ class build_graphics_audio: gpu = gpu.arch if gpu in [ device_probe.AMD.Archs.Polaris, + device_probe.AMD.Archs.Polaris_Spoof, device_probe.AMD.Archs.Vega, device_probe.AMD.Archs.Navi, ]: diff --git a/resources/defaults.py b/resources/defaults.py index 0f49b7f89..84910ac10 100644 --- a/resources/defaults.py +++ b/resources/defaults.py @@ -196,6 +196,7 @@ class generate_defaults: device_probe.AMD.Archs.Legacy_GCN_8000, device_probe.AMD.Archs.Legacy_GCN_9000, device_probe.AMD.Archs.Polaris, + device_probe.AMD.Archs.Polaris_Spoof, device_probe.AMD.Archs.Vega, device_probe.AMD.Archs.Navi, ]: @@ -204,6 +205,7 @@ class generate_defaults: device_probe.AMD.Archs.Legacy_GCN_8000, device_probe.AMD.Archs.Legacy_GCN_9000, device_probe.AMD.Archs.Polaris, + device_probe.AMD.Archs.Polaris_Spoof, device_probe.AMD.Archs.Vega, device_probe.AMD.Archs.Navi, ]: @@ -221,6 +223,7 @@ class generate_defaults: # See if system can use the native AMD stack in Ventura if gpu in [ device_probe.AMD.Archs.Polaris, + device_probe.AMD.Archs.Polaris_Spoof, device_probe.AMD.Archs.Vega, device_probe.AMD.Archs.Navi, ]: diff --git a/resources/device_probe.py b/resources/device_probe.py index 3eb10c6e2..8e8b8e4e5 100644 --- a/resources/device_probe.py +++ b/resources/device_probe.py @@ -242,6 +242,7 @@ class AMD(GPU): Legacy_GCN_8000 = "Legacy GCN v2" Legacy_GCN_9000 = "Legacy GCN v3" Polaris = "Polaris" + Polaris_Spoof = "Polaris (Spoofed)" Vega = "Vega" Navi = "Navi" Unknown = "Unknown" @@ -263,6 +264,8 @@ class AMD(GPU): self.arch = AMD.Archs.TeraScale_2 elif self.device_id in pci_data.amd_ids.polaris_ids: self.arch = AMD.Archs.Polaris + elif self.device_id in pci_data.amd_ids.polaris_spoof_ids: + self.arch = AMD.Archs.Polaris_Spoof elif self.device_id in pci_data.amd_ids.vega_ids: self.arch = AMD.Archs.Vega elif self.device_id in pci_data.amd_ids.navi_ids: