Update "Stock GPUs" handling

closes #1128
This commit is contained in:
Dhinak G
2024-03-15 19:18:33 -04:00
parent 4c4b202bcc
commit 9c2da4e4fb
3 changed files with 34 additions and 38 deletions
+12 -14
View File
@@ -493,22 +493,20 @@ class BuildGraphicsAudio:
This primarily occurs when installing an RSR update, where root is cleaned but AuxKC is not This primarily occurs when installing an RSR update, where root is cleaned but AuxKC is not
""" """
gpu_dict = [] gpu_archs = []
if not self.constants.custom_model: if not self.constants.custom_model:
gpu_dict = self.constants.computer.gpus gpu_archs = [gpu.arch for gpu in self.constants.computer.gpus]
else: else:
if not self.model in smbios_data.smbios_dictionary: if self.model not in smbios_data.smbios_dictionary:
return return
gpu_dict = smbios_data.smbios_dictionary[self.model]["Stock GPUs"] gpu_archs = smbios_data.smbios_dictionary[self.model]["Stock GPUs"]
# Check if KDKless and KDK GPUs are present # Check if KDKless and KDK GPUs are present
# We only want KDKless.kext if there are no KDK GPUs # We only want KDKless.kext if there are no KDK GPUs
has_kdkless_gpu = False has_kdkless_gpu = False
has_kdk_gpu = False has_kdk_gpu = False
for gpu in gpu_dict: for arch in gpu_archs:
if not self.constants.custom_model: if arch in [
gpu = gpu.arch
if gpu in [
device_probe.Intel.Archs.Ivy_Bridge, device_probe.Intel.Archs.Ivy_Bridge,
device_probe.Intel.Archs.Haswell, device_probe.Intel.Archs.Haswell,
device_probe.Intel.Archs.Broadwell, device_probe.Intel.Archs.Broadwell,
@@ -518,7 +516,7 @@ class BuildGraphicsAudio:
has_kdkless_gpu = True has_kdkless_gpu = True
# Non-Metal KDK # Non-Metal KDK
if gpu in [ if arch in [
device_probe.NVIDIA.Archs.Tesla, device_probe.NVIDIA.Archs.Tesla,
device_probe.NVIDIA.Archs.Maxwell, device_probe.NVIDIA.Archs.Maxwell,
device_probe.NVIDIA.Archs.Pascal, device_probe.NVIDIA.Archs.Pascal,
@@ -529,7 +527,7 @@ class BuildGraphicsAudio:
]: ]:
has_kdk_gpu = True has_kdk_gpu = True
if gpu in [ if arch in [
# Metal KDK (always) # Metal KDK (always)
device_probe.AMD.Archs.Legacy_GCN_7000, device_probe.AMD.Archs.Legacy_GCN_7000,
device_probe.AMD.Archs.Legacy_GCN_8000, device_probe.AMD.Archs.Legacy_GCN_8000,
@@ -537,7 +535,7 @@ class BuildGraphicsAudio:
]: ]:
has_kdk_gpu = True has_kdk_gpu = True
if gpu in [ if arch in [
# Metal KDK (pre-AVX2.0) # Metal KDK (pre-AVX2.0)
device_probe.AMD.Archs.Polaris, device_probe.AMD.Archs.Polaris,
device_probe.AMD.Archs.Polaris_Spoof, device_probe.AMD.Archs.Polaris_Spoof,
@@ -560,10 +558,10 @@ class BuildGraphicsAudio:
# Applicable for Polaris, Vega, Navi GPUs # Applicable for Polaris, Vega, Navi GPUs
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] > cpu_data.CPUGen.ivy_bridge.value: if smbios_data.smbios_dictionary[self.model]["CPU Generation"] > cpu_data.CPUGen.ivy_bridge.value:
return return
for gpu in gpu_dict: for arch in gpu_archs:
if not self.constants.custom_model: if not self.constants.custom_model:
gpu = gpu.arch arch = arch.arch
if gpu in [ if arch in [
device_probe.AMD.Archs.Polaris, device_probe.AMD.Archs.Polaris,
device_probe.AMD.Archs.Polaris_Spoof, device_probe.AMD.Archs.Polaris_Spoof,
device_probe.AMD.Archs.Vega, device_probe.AMD.Archs.Vega,
+10 -16
View File
@@ -234,22 +234,16 @@ class GenerateDefaults:
Graphics specific probe Graphics specific probe
""" """
gpu_dict = [] gpu_archs = []
if self.host_is_target: if self.host_is_target:
gpu_dict = self.constants.computer.gpus gpu_archs = [gpu.arch for gpu in self.constants.computer.gpus if gpu.class_code != 0xFFFFFFFF]
else: else:
if self.model in smbios_data.smbios_dictionary: if self.model in smbios_data.smbios_dictionary:
gpu_dict = smbios_data.smbios_dictionary[self.model]["Stock GPUs"] gpu_archs = smbios_data.smbios_dictionary[self.model]["Stock GPUs"]
for gpu in gpu_dict:
if self.host_is_target:
if gpu.class_code:
if gpu.class_code == 0xFFFFFFFF:
continue
gpu = gpu.arch
for arch in gpu_archs:
# Legacy Metal Logic # Legacy Metal Logic
if gpu in [ if arch in [
device_probe.Intel.Archs.Ivy_Bridge, device_probe.Intel.Archs.Ivy_Bridge,
device_probe.Intel.Archs.Haswell, device_probe.Intel.Archs.Haswell,
device_probe.Intel.Archs.Broadwell, device_probe.Intel.Archs.Broadwell,
@@ -263,14 +257,14 @@ class GenerateDefaults:
device_probe.AMD.Archs.Vega, device_probe.AMD.Archs.Vega,
device_probe.AMD.Archs.Navi, device_probe.AMD.Archs.Navi,
]: ]:
if gpu in [ if arch in [
device_probe.Intel.Archs.Ivy_Bridge, device_probe.Intel.Archs.Ivy_Bridge,
device_probe.Intel.Archs.Haswell, device_probe.Intel.Archs.Haswell,
device_probe.NVIDIA.Archs.Kepler, device_probe.NVIDIA.Archs.Kepler,
]: ]:
self.constants.disable_amfi = True self.constants.disable_amfi = True
if gpu in [ if arch in [
device_probe.AMD.Archs.Legacy_GCN_7000, device_probe.AMD.Archs.Legacy_GCN_7000,
device_probe.AMD.Archs.Legacy_GCN_8000, device_probe.AMD.Archs.Legacy_GCN_8000,
device_probe.AMD.Archs.Legacy_GCN_9000, device_probe.AMD.Archs.Legacy_GCN_9000,
@@ -279,7 +273,7 @@ class GenerateDefaults:
device_probe.AMD.Archs.Vega, device_probe.AMD.Archs.Vega,
device_probe.AMD.Archs.Navi, device_probe.AMD.Archs.Navi,
]: ]:
if gpu == device_probe.AMD.Archs.Legacy_GCN_7000: if arch == device_probe.AMD.Archs.Legacy_GCN_7000:
# Check if we're running in Rosetta # Check if we're running in Rosetta
if self.host_is_target: if self.host_is_target:
if self.constants.computer.rosetta_active is True: if self.constants.computer.rosetta_active is True:
@@ -291,7 +285,7 @@ class GenerateDefaults:
self.constants.serial_settings = "Minimal" self.constants.serial_settings = "Minimal"
# See if system can use the native AMD stack in Ventura # See if system can use the native AMD stack in Ventura
if gpu in [ if arch in [
device_probe.AMD.Archs.Polaris, device_probe.AMD.Archs.Polaris,
device_probe.AMD.Archs.Polaris_Spoof, device_probe.AMD.Archs.Polaris_Spoof,
device_probe.AMD.Archs.Vega, device_probe.AMD.Archs.Vega,
@@ -310,7 +304,7 @@ class GenerateDefaults:
self.constants.disable_cs_lv = True self.constants.disable_cs_lv = True
# Non-Metal Logic # Non-Metal Logic
elif gpu in [ elif arch in [
device_probe.Intel.Archs.Iron_Lake, device_probe.Intel.Archs.Iron_Lake,
device_probe.Intel.Archs.Sandy_Bridge, device_probe.Intel.Archs.Sandy_Bridge,
device_probe.NVIDIA.Archs.Tesla, device_probe.NVIDIA.Archs.Tesla,
+12 -8
View File
@@ -199,15 +199,19 @@ class CheckProperties:
""" """
Check if either host, or override model, has a 3802 GPU Check if either host, or override model, has a 3802 GPU
""" """
gpu_dict = [] if self.constants.custom_model else self.constants.computer.gpus
model = self.constants.custom_model if self.constants.custom_model else self.constants.computer.real_model
if gpu_dict == []:
gpu_dict = smbios_data.smbios_dictionary[model]["Stock GPUs"] if model in smbios_data.smbios_dictionary else []
for gpu in gpu_dict: gpu_archs = []
if not self.constants.custom_model: if self.constants.custom_model:
gpu = gpu.arch model = self.constants.custom_model
if gpu in [ else:
model = self.constants.computer.real_model
gpu_archs = [gpu.arch for gpu in self.constants.computer.gpus]
if not gpu_archs:
gpu_archs = smbios_data.smbios_dictionary.get(model, {}).get("Stock GPUs", [])
for arch in gpu_archs:
if arch in [
device_probe.Intel.Archs.Ivy_Bridge, device_probe.Intel.Archs.Ivy_Bridge,
device_probe.Intel.Archs.Haswell, device_probe.Intel.Archs.Haswell,
device_probe.NVIDIA.Archs.Kepler, device_probe.NVIDIA.Archs.Kepler,