Implement Alpha Support for Nvidia Web Drivers

This commit is contained in:
Mykola Grymalyuk
2022-05-25 17:11:50 -06:00
parent 37f428ede6
commit 8f7df604af
5 changed files with 39 additions and 3 deletions

View File

@@ -123,6 +123,26 @@ def SystemPatchDictionary(os_major, os_minor, non_metal_os_support):
},
},
"Non-Metal CoreDisplay Common": {
# Nvidia Web Drivers require an older build of CoreDisplay
"Display Name": "",
"OS Support": {
"Minimum OS Support": {
"OS Major": non_metal_os_support[0],
"OS Minor": 0
},
"Maximum OS Support": {
"OS Major": non_metal_os_support[-1],
"OS Minor": 99
},
},
"Install": {
"/System/Library/Frameworks": {
"CoreDisplay.framework": f"10.13.6-{os_major}",
},
},
},
"Non-Metal Enforcement": {
# Forces Metal kexts from High Sierra to run in the fallback non-Metal mode
# Verified functional with HD4000 and Iris Plus 655

View File

@@ -689,6 +689,12 @@ class BuildOpenCore:
self.config["UEFI"]["Quirks"]["ForgeUefiSupport"] = True
self.config["UEFI"]["Quirks"]["ReloadOptionRoms"] = True
if device.arch in [device_probe.NVIDIA.Archs.Maxwell, device_probe.NVIDIA.Archs.Pascal]:
print("- Adding Web Driver Patches")
self.config["DeviceProperties"]["Add"][device.pci_path].update({"disable-metal": 1, "force-compat": 1})
if "nvda_drv_vrl=1" not in self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"]:
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " nvda_drv_vrl=1"
else:
print(f"- Failed to find Device path for dGPU {i + 1}")
if isinstance(device, device_probe.AMD):
@@ -705,6 +711,10 @@ class BuildOpenCore:
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " -wegtree agdpmod=vit9696"
self.config["UEFI"]["Quirks"]["ForgeUefiSupport"] = True
self.config["UEFI"]["Quirks"]["ReloadOptionRoms"] = True
if device.arch in [device_probe.NVIDIA.Archs.Maxwell, device_probe.NVIDIA.Archs.Pascal]:
if "ngfxgl=1 ngfxcompat=1 nvda_drv_vrl=1" not in self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"]:
print("- Adding Web Driver Patches")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " ngfxgl=1 ngfxcompat=1 nvda_drv_vrl=1"
if not self.computer.gpus:
print("- No socketed dGPU found")

View File

@@ -15,7 +15,7 @@ class Constants:
def __init__(self):
# Patcher Versioning
self.patcher_version = "0.4.6" # OpenCore-Legacy-Patcher
self.patcher_support_pkg_version = "0.4.1" # PatcherSupportPkg
self.patcher_support_pkg_version = "0.5.0" # 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

@@ -65,6 +65,7 @@ class detect_root_patch:
elif gpu.arch in [device_probe.NVIDIA.Archs.Maxwell, device_probe.NVIDIA.Archs.Pascal]:
if self.constants.detected_os > os_data.os_data.mojave:
self.nvidia_web = True
self.amfi_must_disable = True
elif gpu.arch == device_probe.AMD.Archs.TeraScale_1:
if self.constants.detected_os > non_metal_os:
self.amd_ts1 = True
@@ -91,6 +92,7 @@ class detect_root_patch:
# Avoid patching Metal and non-Metal GPUs if both present, prioritize Metal GPU
# Main concerns are for iMac12,x with Sandy iGPU and Kepler dGPU
self.nvidia_tesla = False
self.nvidia_web = False
self.amd_ts1 = False
self.amd_ts2 = False
self.iron_gpu = False
@@ -159,8 +161,8 @@ class detect_root_patch:
self.root_patch_dict = {
"Graphics: Nvidia Tesla": self.nvidia_tesla,
"Graphics: Nvidia Kepler": self.kepler_gpu,
# "Graphics: Nvidia Web Drivers": self.nvidia_web,
"Graphics: Nvidia Web Drivers": False,
"Graphics: Nvidia Web Drivers": self.nvidia_web,
# "Graphics: Nvidia Web Drivers": False,
"Graphics: AMD TeraScale 1": self.amd_ts1,
"Graphics: AMD TeraScale 2": self.amd_ts2,
"Graphics: Intel Ironlake": self.iron_gpu,
@@ -245,7 +247,9 @@ class detect_root_patch:
if hardware_details["Graphics: Nvidia Web Drivers"] is True:
required_patches.update({"Non-Metal Common": all_hardware_patchset["Graphics"]["Non-Metal Common"]})
required_patches.update({"Non-Metal IOAccelerator Common": all_hardware_patchset["Graphics"]["Non-Metal IOAccelerator Common"]})
required_patches.update({"Non-Metal CoreDisplay Common": all_hardware_patchset["Graphics"]["Non-Metal CoreDisplay Common"]})
required_patches.update({"Nvidia Web Drivers": all_hardware_patchset["Graphics"]["Nvidia Web Drivers"]})
required_patches.update({"Non-Metal Enforcement": all_hardware_patchset["Graphics"]["Non-Metal Enforcement"]})
if hardware_details["Graphics: Nvidia Kepler"] is True:
required_patches.update({"Metal Common": all_hardware_patchset["Graphics"]["Metal Common"]})
required_patches.update({"Nvidia Kepler": all_hardware_patchset["Graphics"]["Nvidia Kepler"]})

View File

@@ -197,6 +197,8 @@ def check_metal_support(device_probe, computer):
(gpu.arch in [
device_probe.NVIDIA.Archs.Tesla,
device_probe.NVIDIA.Archs.Fermi,
device_probe.NVIDIA.Archs.Maxwell,
device_probe.NVIDIA.Archs.Pascal,
device_probe.AMD.Archs.TeraScale_1,
device_probe.AMD.Archs.TeraScale_2,
device_probe.Intel.Archs.Iron_Lake,