mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-21 06:30:52 +10:00
Add beta support for Legacy GPU Acceleration
This commit is contained in:
@@ -6,6 +6,8 @@
|
|||||||
- Fix iMac11,1 boot issues after PRAM reset
|
- Fix iMac11,1 boot issues after PRAM reset
|
||||||
- Fix DRM support on Nvidia-only configurations
|
- Fix DRM support on Nvidia-only configurations
|
||||||
- Support optional setting between DRM and QuickSync support on iMacs13,x and iMac14,x
|
- Support optional setting between DRM and QuickSync support on iMacs13,x and iMac14,x
|
||||||
|
- Add public beta support for Legacy GPU Acceleration
|
||||||
|
- Note ATI/AMD TeraScale 2 unsupported
|
||||||
|
|
||||||
## 0.1.0
|
## 0.1.0
|
||||||
- Fix crash on iMacs with Metal GPUs
|
- Fix crash on iMacs with Metal GPUs
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ system_profiler SPHardwareDataType | grep 'Model Identifier'
|
|||||||
[f"Set SMBIOS Mode:\t\t\tCurrently {self.constants.serial_settings}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).change_serial],
|
[f"Set SMBIOS Mode:\t\t\tCurrently {self.constants.serial_settings}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).change_serial],
|
||||||
[f"DRM Preferences:\t\t\tCurrently {self.constants.drm_support}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).drm_setting],
|
[f"DRM Preferences:\t\t\tCurrently {self.constants.drm_support}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).drm_setting],
|
||||||
[f"Set Generic Bootstrap:\t\t{self.constants.boot_efi}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).bootstrap_setting],
|
[f"Set Generic Bootstrap:\t\t{self.constants.boot_efi}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).bootstrap_setting],
|
||||||
["Set Custom Patch Repo", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).custom_repo],
|
[f"Set Accleration Patches:\t\t{self.constants.legacy_acceleration_patch}", CliMenu.MenuOptions(self.constants.custom_model or self.current_model, self.constants).accel_setting],
|
||||||
]
|
]
|
||||||
|
|
||||||
for option in options:
|
for option in options:
|
||||||
|
|||||||
+27
-25
@@ -219,31 +219,6 @@ running, however this will enforce iMac Nvidia Build Patches.
|
|||||||
else:
|
else:
|
||||||
print("Invalid option")
|
print("Invalid option")
|
||||||
|
|
||||||
def custom_repo(self):
|
|
||||||
Utilities.cls()
|
|
||||||
Utilities.header(["Set custom patch repo"])
|
|
||||||
print(f"""For users participating in OpenCore Patcher betas, this is
|
|
||||||
where you can add custom repos such as Google Drive links.
|
|
||||||
|
|
||||||
Valid options:
|
|
||||||
|
|
||||||
1. Set custom location
|
|
||||||
2. Reset repo location
|
|
||||||
3. Exit
|
|
||||||
|
|
||||||
Current repo:
|
|
||||||
{self.constants.url_apple_binaries}
|
|
||||||
""")
|
|
||||||
change_menu = input("Set custom location?: ")
|
|
||||||
if change_menu == "1":
|
|
||||||
self.constants.url_backup = self.constants.url_apple_binaries
|
|
||||||
self.constants.url_apple_binaries = input("Enter new URL: ")
|
|
||||||
elif change_menu == "2":
|
|
||||||
if self.constants.url_backup != "":
|
|
||||||
self.constants.url_apple_binaries = self.constants.url_backup
|
|
||||||
else:
|
|
||||||
print("Invalid option")
|
|
||||||
|
|
||||||
def bootstrap_setting(self):
|
def bootstrap_setting(self):
|
||||||
Utilities.cls()
|
Utilities.cls()
|
||||||
Utilities.header(["Set Bootstrap method"])
|
Utilities.header(["Set Bootstrap method"])
|
||||||
@@ -293,3 +268,30 @@ Recommend only disabling if absolutely required.
|
|||||||
self.constants.drm_support = False
|
self.constants.drm_support = False
|
||||||
else:
|
else:
|
||||||
print("Invalid option")
|
print("Invalid option")
|
||||||
|
|
||||||
|
def accel_setting(self):
|
||||||
|
Utilities.cls()
|
||||||
|
Utilities.header(["Enable Beta Acceleration Patches"])
|
||||||
|
print("""Enables OCLP's experimental GPU Acceleration Patches
|
||||||
|
Note these are still in beta and we highly recommend users
|
||||||
|
not run them daily or expect stable performance.
|
||||||
|
|
||||||
|
Currently the following are supported:
|
||||||
|
|
||||||
|
- Nvidia: Tesla and Fermi (8000-500)
|
||||||
|
- AMD/ATI: TeraScale 1 (2000-4000)
|
||||||
|
- Intel: Ironlake and Sandy Bridge
|
||||||
|
|
||||||
|
For relaibaility, please consider running macOS Catalina or
|
||||||
|
older via Dosdude1's patchers
|
||||||
|
|
||||||
|
Note: These patches may break Big Sur booting, please have any
|
||||||
|
important data backed up in case of emergencies
|
||||||
|
""")
|
||||||
|
change_menu = input("Enable Beta Acceleration Patches(y/n): ")
|
||||||
|
if change_menu in {"y", "Y", "yes", "Yes"}:
|
||||||
|
self.constants.legacy_acceleration_patch = True
|
||||||
|
elif change_menu in {"n", "N", "no", "No"}:
|
||||||
|
self.constants.legacy_acceleration_patch = False
|
||||||
|
else:
|
||||||
|
print("Invalid option")
|
||||||
@@ -35,6 +35,7 @@ class Constants:
|
|||||||
self.smcspoof_version = "1.0.0"
|
self.smcspoof_version = "1.0.0"
|
||||||
self.cputscsync = "1.0.3"
|
self.cputscsync = "1.0.3"
|
||||||
self.hibernationfixup = "1.3.9"
|
self.hibernationfixup = "1.3.9"
|
||||||
|
self.payload_version = "0.0.2"
|
||||||
|
|
||||||
# Get resource path
|
# Get resource path
|
||||||
self.current_path = Path(__file__).parent.parent.resolve()
|
self.current_path = Path(__file__).parent.parent.resolve()
|
||||||
@@ -69,6 +70,7 @@ class Constants:
|
|||||||
self.detected_os = 0
|
self.detected_os = 0
|
||||||
self.boot_efi = False
|
self.boot_efi = False
|
||||||
self.drm_support = False
|
self.drm_support = False
|
||||||
|
self.legacy_acceleration_patch = False
|
||||||
|
|
||||||
# OS Versions
|
# OS Versions
|
||||||
self.tiger = 8
|
self.tiger = 8
|
||||||
@@ -93,8 +95,7 @@ class Constants:
|
|||||||
self.pci_atheros = "168C"
|
self.pci_atheros = "168C"
|
||||||
|
|
||||||
# External Files
|
# External Files
|
||||||
self.url_backup = ""
|
self.url_apple_binaries = "https://github.com/dortania/Apple-Binaries-OCLP/archive/refs/tags/"
|
||||||
self.url_apple_binaries = "https://github.com/dortania/Apple-Binaries-OCLP/archive/refs/heads/main.zip"
|
|
||||||
|
|
||||||
# Payload Location
|
# Payload Location
|
||||||
# OpenCore
|
# OpenCore
|
||||||
@@ -232,7 +233,7 @@ class Constants:
|
|||||||
|
|
||||||
# Apple Paylods Paths
|
# Apple Paylods Paths
|
||||||
@property
|
@property
|
||||||
def payload_apple_root_path_unzip(self): return self.payload_path / Path("Apple-Binaries-OCLP-main")
|
def payload_apple_root_path_unzip(self): return self.payload_path / Path(f"Apple-Binaries-OCLP-{self.payload_version}")
|
||||||
@property
|
@property
|
||||||
def payload_apple_root_path_zip(self): return self.payload_path / Path("Apple.zip")
|
def payload_apple_root_path_zip(self): return self.payload_path / Path("Apple.zip")
|
||||||
@property
|
@property
|
||||||
@@ -284,7 +285,9 @@ class Constants:
|
|||||||
|
|
||||||
# Apple LaunchDaemons
|
# Apple LaunchDaemons
|
||||||
@property
|
@property
|
||||||
def hiddhack_path(self): return self.payload_apple_lauchd_path_accel / Path("HiddHack.plist")
|
def hiddhack_path(self): return self.payload_apple_lauchd_path_accel / Path("IOHID-Fixup.plist")
|
||||||
|
@property
|
||||||
|
def legacy_hiddhack_path(self): return self.payload_apple_lauchd_path_accel / Path("HiddHack.plist")
|
||||||
|
|
||||||
# Apple PrivateFrameworks
|
# Apple PrivateFrameworks
|
||||||
@property
|
@property
|
||||||
|
|||||||
@@ -176,10 +176,13 @@ class PatchSysVolume:
|
|||||||
self.add_brightness_patch()
|
self.add_brightness_patch()
|
||||||
|
|
||||||
# LaunchDaemons
|
# LaunchDaemons
|
||||||
print("- Adding HiddHack.plist")
|
if Path(self.mount_lauchd / Path("HiddHack.plist")).exists():
|
||||||
|
print("- Removing legacy HiddHack")
|
||||||
|
subprocess.run(f"sudo rm {self.mount_lauchd}/HiddHack.plist".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
|
print("- Adding IOHID-Fixup.plist")
|
||||||
subprocess.run(f"sudo ditto {self.constants.payload_apple_lauchd_path_accel} {self.mount_lauchd}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
subprocess.run(f"sudo ditto {self.constants.payload_apple_lauchd_path_accel} {self.mount_lauchd}".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
subprocess.run(f"sudo chmod 755 {self.mount_lauchd}/HiddHack.plist".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
subprocess.run(f"sudo chmod 755 {self.mount_lauchd}/IOHID-Fixup.plist".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
subprocess.run(f"sudo chown root:wheel {self.mount_lauchd}/HiddHack.plist".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
subprocess.run(f"sudo chown root:wheel {self.mount_lauchd}/IOHID-Fixup.plist".split(), stdout=subprocess.PIPE).stdout.decode().strip().encode()
|
||||||
|
|
||||||
# PrivateFrameworks
|
# PrivateFrameworks
|
||||||
print("- Merging legacy PrivateFrameworks")
|
print("- Merging legacy PrivateFrameworks")
|
||||||
@@ -209,7 +212,7 @@ class PatchSysVolume:
|
|||||||
elif self.dgpu_devices and self.dgpu_vendor == self.constants.pci_nvidia and self.dgpu_device in ModelArray.NVIDIAMXMGPUs:
|
elif self.dgpu_devices and self.dgpu_vendor == self.constants.pci_nvidia and self.dgpu_device in ModelArray.NVIDIAMXMGPUs:
|
||||||
print("- Detected Metal-based Nvidia GPU, skipping legacy patches")
|
print("- Detected Metal-based Nvidia GPU, skipping legacy patches")
|
||||||
else:
|
else:
|
||||||
if Path(self.constants.hiddhack_path).exists():
|
if self.constants.legacy_acceleration_patch is True:
|
||||||
print("- Detected legacy GPU, attempting legacy acceleration patches")
|
print("- Detected legacy GPU, attempting legacy acceleration patches")
|
||||||
self.gpu_accel_patches_11()
|
self.gpu_accel_patches_11()
|
||||||
else:
|
else:
|
||||||
@@ -311,7 +314,7 @@ class PatchSysVolume:
|
|||||||
def download_files(self):
|
def download_files(self):
|
||||||
Utilities.cls()
|
Utilities.cls()
|
||||||
print("- Downloading Apple binaries")
|
print("- Downloading Apple binaries")
|
||||||
popen_oclp = subprocess.Popen(f"curl -S -L {self.constants.url_apple_binaries} --output {self.constants.payload_apple_root_path_zip}".split(), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)
|
popen_oclp = subprocess.Popen(f"curl -S -L {self.constants.url_apple_binaries}{self.constants.payload_version}.zip --output {self.constants.payload_apple_root_path_zip}".split(), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, universal_newlines=True)
|
||||||
for stdout_line in iter(popen_oclp.stdout.readline, ""):
|
for stdout_line in iter(popen_oclp.stdout.readline, ""):
|
||||||
print(stdout_line, end="")
|
print(stdout_line, end="")
|
||||||
popen_oclp.stdout.close()
|
popen_oclp.stdout.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user