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
+40 -43
View File
@@ -603,53 +603,50 @@ 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:
if self.constants.detected_os > non_metal_os: print(f"- Found GPU ({i}): {Utilities.friendly_hex(gpu.vendor_id)}:{Utilities.friendly_hex(gpu.device_id)}")
self.nvidia_legacy = True if gpu.arch in [device_probe.NVIDIA.Archs.Tesla, device_probe.NVIDIA.Archs.Fermi]:
self.amfi_must_disable = True if self.constants.detected_os > non_metal_os:
elif dgpu.arch == device_probe.NVIDIA.Archs.Kepler: self.nvidia_legacy = True
if self.constants.detected_os > self.constants.big_sur: self.amfi_must_disable = True
# Kepler drivers were dropped with Beta 7 elif gpu.arch == device_probe.NVIDIA.Archs.Kepler:
# 12.0 Beta 5: 21.0.0 - 21A5304g if self.constants.detected_os > self.constants.big_sur:
# 12.0 Beta 6: 21.1.0 - 21A5506j # Kepler drivers were dropped with Beta 7
# 12.0 Beta 7: 21.1.0 - 21A5522h # 12.0 Beta 5: 21.0.0 - 21A5304g
if self.constants.detected_os == self.constants.monterey and self.constants.detected_os_minor > 0: # 12.0 Beta 6: 21.1.0 - 21A5506j
if "21A5506j" not in self.constants.detected_os_build: # 12.0 Beta 7: 21.1.0 - 21A5522h
self.kepler_gpu = True if self.constants.detected_os == self.constants.monterey and self.constants.detected_os_minor > 0:
elif dgpu.arch == device_probe.AMD.Archs.TeraScale_1: if "21A5506j" not in self.constants.detected_os_build:
if self.constants.detected_os > non_metal_os: self.kepler_gpu = True
self.amd_ts1 = True elif gpu.arch == device_probe.AMD.Archs.TeraScale_1:
self.amfi_must_disable = True if self.constants.detected_os > non_metal_os:
elif dgpu.arch == device_probe.AMD.Archs.TeraScale_2: self.amd_ts1 = True
if self.constants.detected_os > non_metal_os: self.amfi_must_disable = True
self.amd_ts2 = True elif gpu.arch == device_probe.AMD.Archs.TeraScale_2:
self.amfi_must_disable = True if self.constants.detected_os > non_metal_os:
if igpu and igpu.class_code != 0xFFFFFF: self.amd_ts2 = True
print(f"- Found IGPU: {Utilities.friendly_hex(igpu.vendor_id)}:{Utilities.friendly_hex(igpu.device_id)}") self.amfi_must_disable = True
if igpu.arch == device_probe.Intel.Archs.Iron_Lake: elif gpu.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()