Probe per GPU detected

Closes https://github.com/dortania/OpenCore-Legacy-Patcher/issues/501
This commit is contained in:
Mykola Grymalyuk
2021-09-22 20:57:10 -06:00
parent 32a0289af3
commit 3364ed702a
+14 -17
View File
@@ -603,19 +603,20 @@ set million colour before rebooting"""
input("Press [ENTER] to continue") input("Press [ENTER] to continue")
def detect_gpus(self): def detect_gpus(self):
dgpu = self.constants.computer.dgpu gpus = self.constants.computer.gpus
igpu = self.constants.computer.igpu
if self.constants.moj_cat_accel is True: if self.constants.moj_cat_accel is True:
non_metal_os = self.constants.high_sierra non_metal_os = self.constants.high_sierra
else: else:
non_metal_os = self.constants.catalina non_metal_os = self.constants.catalina
if dgpu: i = 0
print(f"- Found GFX0: {Utilities.friendly_hex(dgpu.vendor_id)}:{Utilities.friendly_hex(dgpu.device_id)}") for gpu in gpus:
if dgpu.arch in [device_probe.NVIDIA.Archs.Tesla, device_probe.NVIDIA.Archs.Fermi]: if gpu.class_code and gpu.class_code != 0xFFFFFFFF:
print(f"- Found GPU ({i}): {Utilities.friendly_hex(gpu.vendor_id)}:{Utilities.friendly_hex(gpu.device_id)}")
if gpu.arch in [device_probe.NVIDIA.Archs.Tesla, device_probe.NVIDIA.Archs.Fermi]:
if self.constants.detected_os > non_metal_os: if self.constants.detected_os > non_metal_os:
self.nvidia_legacy = True self.nvidia_legacy = True
self.amfi_must_disable = True self.amfi_must_disable = True
elif dgpu.arch == device_probe.NVIDIA.Archs.Kepler: elif gpu.arch == device_probe.NVIDIA.Archs.Kepler:
if self.constants.detected_os > self.constants.big_sur: if self.constants.detected_os > self.constants.big_sur:
# Kepler drivers were dropped with Beta 7 # Kepler drivers were dropped with Beta 7
# 12.0 Beta 5: 21.0.0 - 21A5304g # 12.0 Beta 5: 21.0.0 - 21A5304g
@@ -624,32 +625,28 @@ set million colour before rebooting"""
if self.constants.detected_os == self.constants.monterey and self.constants.detected_os_minor > 0: if self.constants.detected_os == self.constants.monterey and self.constants.detected_os_minor > 0:
if "21A5506j" not in self.constants.detected_os_build: if "21A5506j" not in self.constants.detected_os_build:
self.kepler_gpu = True self.kepler_gpu = True
elif dgpu.arch == device_probe.AMD.Archs.TeraScale_1: elif gpu.arch == device_probe.AMD.Archs.TeraScale_1:
if self.constants.detected_os > non_metal_os: if self.constants.detected_os > non_metal_os:
self.amd_ts1 = True self.amd_ts1 = True
self.amfi_must_disable = True self.amfi_must_disable = True
elif dgpu.arch == device_probe.AMD.Archs.TeraScale_2: elif gpu.arch == device_probe.AMD.Archs.TeraScale_2:
if self.constants.detected_os > non_metal_os: if self.constants.detected_os > non_metal_os:
self.amd_ts2 = True self.amd_ts2 = True
self.amfi_must_disable = True self.amfi_must_disable = True
if igpu and igpu.class_code != 0xFFFFFF: elif gpu.arch == device_probe.Intel.Archs.Iron_Lake:
print(f"- Found IGPU: {Utilities.friendly_hex(igpu.vendor_id)}:{Utilities.friendly_hex(igpu.device_id)}")
if igpu.arch == device_probe.Intel.Archs.Iron_Lake:
if self.constants.detected_os > non_metal_os: if self.constants.detected_os > non_metal_os:
self.iron_gpu = True self.iron_gpu = True
self.amfi_must_disable = True self.amfi_must_disable = True
elif igpu.arch == device_probe.Intel.Archs.Sandy_Bridge: elif gpu.arch == device_probe.Intel.Archs.Sandy_Bridge:
if self.constants.detected_os > non_metal_os: if self.constants.detected_os > non_metal_os:
self.sandy_gpu = True self.sandy_gpu = True
self.amfi_must_disable = True self.amfi_must_disable = True
self.check_board_id = True self.check_board_id = True
elif igpu.arch == device_probe.Intel.Archs.Ivy_Bridge: elif gpu.arch == device_probe.Intel.Archs.Ivy_Bridge:
if self.constants.detected_os > self.constants.big_sur: if self.constants.detected_os > self.constants.big_sur:
self.ivy_gpu = True self.ivy_gpu = True
elif isinstance(igpu, device_probe.NVIDIA): i += 1
if self.constants.detected_os > non_metal_os:
self.nvidia_legacy = True
self.amfi_must_disable = True
def detect_patch_set(self): def detect_patch_set(self):
self.detect_gpus() self.detect_gpus()