sys_patch: Add AMD Vega support for pre-AVX2.0

This commit is contained in:
Mykola Grymalyuk
2022-12-22 20:14:10 -07:00
parent 1277fef735
commit 2331aeb6d9
5 changed files with 70 additions and 11 deletions

View File

@@ -7,8 +7,10 @@
- Implement Wifi-only patches when no internet connection available but required (ie. KDKs)
- Allows users to install Legacy Wireless patches, then connect to the internet to install remaining patches
- Resolve `/Library/Extensions` not being cleaned on KDK-less root patches
- Add AMD Vega Graphics support for pre-AVX2.0 systems on Ventura
- ex. AMD Vega 56 and 64, AMD Radeon VII
- Increment Binaries:
- PatcherSupportPkg 0.7.2 - release
- PatcherSupportPkg 0.7.3 - release
## 0.5.3
- Integrate FixPCIeLinkrate.efi v0.1.0

View File

@@ -630,6 +630,7 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
"AMD8000Controller.kext": "12.5",
"AMD9000Controller.kext": "12.5",
"AMD9500Controller.kext": "12.5",
"AMD10000Controller.kext": "12.5",
"AMDRadeonX4000.kext": "12.5",
"AMDRadeonX4000HWServices.kext": "12.5",
"AMDFramebuffer.kext": "12.5",
@@ -640,14 +641,6 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
"AMDShared.bundle": "12.5",
},
},
"Remove": {
"/System/Library/Extensions": [
# Due to downgraded AMDSupport.kext
# In the future, we will have to downgrade the entire AMD stack
# to support non-AVX2.0 machines with Vega or newer
"AMD10000Controller.kext",
],
},
},
# Used only for AMD Polaris with host lacking AVX2.0
# Note missing framebuffers are not restored (ex. 'ATY,Berbice')
@@ -673,6 +666,51 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
},
},
},
"AMD Legacy Vega": {
"Display Name": "Graphics: AMD Legacy Vega",
"OS Support": {
"Minimum OS Support": {
"OS Major": os_data.os_data.ventura,
"OS Minor": 0
},
"Maximum OS Support": {
"OS Major": os_data.os_data.max_os,
"OS Minor": 99
},
},
"Install": {
"/System/Library/Extensions": {
"AMDRadeonX5000.kext": "12.5",
"AMDRadeonX5000GLDriver.bundle": "12.5",
"AMDRadeonX5000MTLDriver.bundle": "12.5",
"AMDRadeonX5000Shared.bundle": "12.5",
"AMDShared.bundle": "12.5",
},
},
},
# Support mixed legacy and modern AMD GPUs
# Specifically systems using AMD GCN 1-3 and Vega (ex. MacPro6,1 with eGPU)
# Assume 'AMD Legacy GCN' patchset is installed alongside this
"AMD Legacy Vega Extended": {
"Display Name": "",
"OS Support": {
"Minimum OS Support": {
"OS Major": os_data.os_data.ventura,
"OS Minor": 0
},
"Maximum OS Support": {
"OS Major": os_data.os_data.max_os,
"OS Minor": 99
},
},
"Install": {
"/System/Library/Extensions": {
"AMDRadeonX5000HWServices.kext": "12.5",
},
},
},
"Intel Ironlake": {
"Display Name": "Graphics: Intel Ironlake",
"OS Support": {

View File

@@ -13,7 +13,7 @@ class Constants:
def __init__(self):
# Patcher Versioning
self.patcher_version = "0.5.4" # OpenCore-Legacy-Patcher
self.patcher_support_pkg_version = "0.7.2" # PatcherSupportPkg
self.patcher_support_pkg_version = "0.7.3" # PatcherSupportPkg
self.url_patcher_support_pkg = "https://github.com/dortania/PatcherSupportPkg/releases/download/"
self.nightly_url_patcher_support_pkg = "https://nightly.link/dortania/PatcherSupportPkg/workflows/build/master/"
self.discord_link = "https://discord.gg/rqdPgH8xSN"

View File

@@ -510,7 +510,7 @@ class PatchSysVolume:
else:
print(f"- Running Process:\n{process}")
utilities.process_status(subprocess.run(process, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True))
if any(x in required_patches for x in ["AMD Legacy GCN", "AMD Legacy Polaris"]):
if any(x in required_patches for x in ["AMD Legacy GCN", "AMD Legacy Polaris", "AMD Legacy Vega"]):
sys_patch_helpers.sys_patch_helpers(self.constants).disable_window_server_caching()
if any(x in required_patches for x in ["Intel Ivy Bridge", "Intel Haswell"]):
sys_patch_helpers.sys_patch_helpers(self.constants).remove_news_widgets()

View File

@@ -29,6 +29,7 @@ class detect_root_patch:
self.skylake_gpu = False
self.legacy_gcn = False
self.legacy_polaris = False
self.legacy_vega = False
# Misc Patch Detection
self.brightness_legacy = False
@@ -145,6 +146,15 @@ class detect_root_patch:
self.supports_metal = True
self.requires_root_kc = True
self.amfi_must_disable = True
elif gpu.arch == device_probe.AMD.Archs.Vega:
if self.constants.detected_os > os_data.os_data.monterey:
if "AVX2" in self.constants.computer.cpu.leafs:
continue
self.legacy_vega = True
self.supports_metal = True
self.requires_root_kc = True
self.amfi_must_disable = True
elif gpu.arch == device_probe.Intel.Archs.Iron_Lake:
if self.constants.detected_os > non_metal_os:
self.iron_gpu = True
@@ -227,6 +237,7 @@ class detect_root_patch:
self.sandy_gpu = False
self.legacy_gcn = False
self.legacy_polaris = False
self.legacy_vega = False
self.brightness_legacy = False
self.legacy_audio = False
self.legacy_gmux = False
@@ -375,6 +386,7 @@ class detect_root_patch:
"Graphics: AMD TeraScale 2": self.amd_ts2,
"Graphics: AMD Legacy GCN": self.legacy_gcn,
"Graphics: AMD Legacy Polaris": self.legacy_polaris,
"Graphics: AMD Legacy Vega": self.legacy_vega,
"Graphics: Intel Ironlake": self.iron_gpu,
"Graphics: Intel Sandy Bridge": self.sandy_gpu,
"Graphics: Intel Ivy Bridge": self.ivy_gpu,
@@ -576,6 +588,13 @@ class detect_root_patch:
required_patches.update({"AMD Legacy Polaris": all_hardware_patchset["Graphics"]["AMD Legacy Polaris"]})
if "AVX2" not in self.constants.computer.cpu.leafs:
required_patches.update({"AMD OpenCL": all_hardware_patchset["Graphics"]["AMD OpenCL"]})
if hardware_details["Graphics: AMD Legacy Vega"] is True:
required_patches.update({"Monterey GVA": all_hardware_patchset["Graphics"]["Monterey GVA"]})
required_patches.update({"Monterey OpenCL": all_hardware_patchset["Graphics"]["Monterey OpenCL"]})
required_patches.update({"AMD Legacy Vega": all_hardware_patchset["Graphics"]["AMD Legacy Vega"]})
required_patches.update({"AMD OpenCL": all_hardware_patchset["Graphics"]["AMD OpenCL"]})
if hardware_details["Graphics: AMD Legacy GCN"] is True:
required_patches.update({"AMD Legacy Vega Extended": all_hardware_patchset["Graphics"]["AMD Legacy Vega Extended"]})
if hardware_details["Brightness: Legacy Backlight Control"] is True:
required_patches.update({"Legacy Backlight Control": all_hardware_patchset["Brightness"]["Legacy Backlight Control"]})
if hardware_details["Audio: Legacy Realtek"] is True: