From e27bead52e7f3015714e78412ae7948148093063 Mon Sep 17 00:00:00 2001 From: Hoang Hong Quan Date: Tue, 30 Jul 2024 14:42:50 +0700 Subject: [PATCH] Add support for AMD GPUs of GCN 1, 2, and 3 generations --- Scripts/compatibility_checker.py | 3 +++ Scripts/config_prodigy.py | 10 +++++++++- Scripts/datasets/gpu_data.py | 12 ++++++++++++ Scripts/datasets/pci_data.py | 16 +++++++++++++++- 4 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 Scripts/datasets/gpu_data.py diff --git a/Scripts/compatibility_checker.py b/Scripts/compatibility_checker.py index b377d86..11bc2a3 100755 --- a/Scripts/compatibility_checker.py +++ b/Scripts/compatibility_checker.py @@ -1,5 +1,6 @@ from Scripts.datasets import chipset_data from Scripts.datasets import cpu_data +from Scripts.datasets import gpu_data from Scripts.datasets import pci_data from Scripts import utils @@ -86,6 +87,8 @@ class CompatibilityChecker: self.min_supported_macos_version = max(17, self.min_supported_macos_version) elif "Vega 10" in gpu_codename or "Polaris" in gpu_codename or "550" in gpu_name: self.min_supported_macos_version = max(17, self.min_supported_macos_version) + elif self.utils.contains_any(gpu_data.AMDCodename, gpu_codename): + self.max_supported_macos_version = 21 else: self.max_supported_macos_version = self.min_supported_macos_version = -1 is_supported_discrete_gpu = is_supported_gpu = False diff --git a/Scripts/config_prodigy.py b/Scripts/config_prodigy.py index dbd7b3f..6862a7a 100755 --- a/Scripts/config_prodigy.py +++ b/Scripts/config_prodigy.py @@ -1,5 +1,6 @@ from Scripts.datasets import chipset_data from Scripts.datasets import cpu_data +from Scripts.datasets import gpu_data from Scripts import codec_layouts from Scripts import gathering_files from Scripts import smbios @@ -164,7 +165,7 @@ class ConfigProdigy: return kernel_patch - def boot_args(self, motherboard_name, platform, cpu_manufacturer, cpu_codename, discrete_gpu_codename, integrated_gpu_name, ethernet_pci, codec_id, touchpad_communication, unsupported_devices, custom_cpu_name, macos_version): + def boot_args(self, motherboard_name, platform, cpu_manufacturer, cpu_codename, discrete_gpu_codename, discrete_gpu_id, integrated_gpu_name, ethernet_pci, codec_id, touchpad_communication, unsupported_devices, custom_cpu_name, macos_version): boot_args = [ "-v", "debug=0x100", @@ -217,6 +218,12 @@ class ConfigProdigy: if "Integrated GPU" in ",".join(unsupported_devices): boot_args.append("-wegnoigpu") + if discrete_gpu_id in ["1002-6610", "1002-682B", "1002-6837", "1002-683D", "1002-683F"]: + boot_args.append("radpg=15") + + if discrete_gpu_id in ["1002-67B0", "1002-67B1", "1002-67B8", "1002-6810", "1002-6811"]: + boot_args.append("-raddvi") + return " ".join(boot_args) def csr_active_config(self, macos_version): @@ -329,6 +336,7 @@ class ConfigProdigy: hardware.get("CPU Manufacturer"), hardware.get("CPU Codename"), hardware.get("Discrete GPU").get("GPU Codename", ""), + hardware.get("Discrete GPU").get("Device ID", ""), hardware.get("Integrated GPU Name"), hardware.get("Ethernet (PCI)"), hardware.get("Codec ID"), diff --git a/Scripts/datasets/gpu_data.py b/Scripts/datasets/gpu_data.py new file mode 100644 index 0000000..ac0de00 --- /dev/null +++ b/Scripts/datasets/gpu_data.py @@ -0,0 +1,12 @@ +# Resource: https://en.wikipedia.org/wiki/Graphics_Core_Next +AMDCodename = [ + "Hainan", + "Oland", + "Cape Verde", + "Pitcairn", + "Tahiti", + "Bonaire", + "Hawaii", + "Tonga", + "Fiji" +] \ No newline at end of file diff --git a/Scripts/datasets/pci_data.py b/Scripts/datasets/pci_data.py index cbfcae7..2ec4bfe 100755 --- a/Scripts/datasets/pci_data.py +++ b/Scripts/datasets/pci_data.py @@ -1139,6 +1139,20 @@ UnsupportedNVMeSSDIDs = { "2646-2263": "Kingston A2000" } +# Resource: https://pci-ids.ucw.cz/ SpoofGPUIDs = { - "1002-699F": "1002-67FF" # AMD RX 550 (Lexa core) + "1002-6611": "1002-6610", # AMD Radeon HD 8570 / R5 430 / R7 240/340 / Radeon 520 + "1002-6613": "1002-6610", # AMD Radeon R7 240/340 / Radeon 520 + "1002-6617": "1002-6610", # AMD Radeon R7 240 + "1002-6649": "1002-665C", # AMD FirePro W5100 + "1002-665C": "1002-6658", # AMD Radeon HD 7790/8770 / R7 360 / R9 260/360 + "1002-679A": "1002-6798", # AMD Radeon HD 7950/8950 / R9 280 + "1002-67B1": "1002-67B0", # AMD Radeon R9 290/390 + "1002-6811": "1002-6810", # AMD Radeon R7 370 / R9 270/370 + "1002-6819": "1002-6818", # AMD Radeon HD 7850 / R7 265 / R9 270 1024SP + "1002-682B": "1002-683D", # AMD Radeon HD 8830M / R7 250 + "1002-683F": "1002-683D", # AMD Radeon HD 7750/8740 / R7 250E + "1002-6930": "1002-6938", # AMD Radeon R9 380 + "1002-6939": "1002-6938", # AMD Radeon R9 285/380 + "1002-699F": "1002-67FF", # AMD Radeon RX 550 (Lexa core) } \ No newline at end of file