From f1210def8983aefad3d6569c8f94228e18a62362 Mon Sep 17 00:00:00 2001 From: Mykola Grymalyuk Date: Sun, 26 Nov 2023 13:03:18 -0700 Subject: [PATCH] sys_patch: Expand 32023 patching for 14.2 Beta 2+ --- CHANGELOG.md | 6 ++++++ data/sys_patch_dict.py | 6 ++++++ resources/constants.py | 2 +- resources/sys_patch/sys_patch_helpers.py | 23 +++++++++++++++-------- 4 files changed, 28 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 499a6a99d4..8f0143cde2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ - corecrypto_T1.kext - corecaptureElCap.kext - IO80211ElCap.kext +- Resolve 3802-GPU support for macOS 14.2 Beta 2 and newer. + - Applicable GPUs: + - Intel Ivy Bridge and Haswell iGPUs + - Nvidia Kepler dGPUs +- Increment Binaries: + - PatcherSupportPkg 1.4.6 - release ## 1.2.1 - Resolve `TeraScale 2 Acceleration` checkbox in Settings not being saved diff --git a/data/sys_patch_dict.py b/data/sys_patch_dict.py index 4a3d379a7c..cf6fb64b9c 100644 --- a/data/sys_patch_dict.py +++ b/data/sys_patch_dict.py @@ -71,6 +71,7 @@ def __init__(self, os_major: int, os_minor: int, non_metal_os_support: list) -> self.macOS_12_5: float = 21.6 self.macOS_13_3: float = 22.4 self.macOS_14_1: float = 23.1 + self.macOS_14_2: float = 23.2 self._generate_sys_patch_dict() @@ -388,6 +389,11 @@ def _generate_sys_patch_dict(self): **({ "MTLCompiler.framework": "13.2.1" } if self.os_major == os_data.os_data.ventura else {}), **({ "GPUCompiler.framework": "13.2.1" } if self.os_major == os_data.os_data.ventura else {}), "RenderBox.framework": "13.2.1-3802" if self.os_major == os_data.os_data.ventura else "14.0-3802", + + # More issues for 3802, now with 14.2 Beta 2+... + # If there is a god, they clearly despise us and legacy Macs. + **({ "MTLCompiler.framework": "14.2 Beta 1" } if self.os_float >= self.macOS_14_2 else {}), + **({ "GPUCompiler.framework": "14.2 Beta 1" } if self.os_float >= self.macOS_14_2 else {}), }, }, }, diff --git a/resources/constants.py b/resources/constants.py index 49419324b1..df37821988 100644 --- a/resources/constants.py +++ b/resources/constants.py @@ -14,7 +14,7 @@ class Constants: def __init__(self) -> None: # Patcher Versioning self.patcher_version: str = "1.3.0" # OpenCore-Legacy-Patcher - self.patcher_support_pkg_version: str = "1.4.5" # PatcherSupportPkg + self.patcher_support_pkg_version: str = "1.4.6" # PatcherSupportPkg self.copyright_date: str = "Copyright © 2020-2023 Dortania" self.patcher_name: str = "OpenCore Legacy Patcher" diff --git a/resources/sys_patch/sys_patch_helpers.py b/resources/sys_patch/sys_patch_helpers.py index 0e4828ece9..7674f0e70c 100644 --- a/resources/sys_patch/sys_patch_helpers.py +++ b/resources/sys_patch/sys_patch_helpers.py @@ -235,23 +235,30 @@ def patch_gpu_compiler_libraries(self, mount_point: Union[str, Path]): - lib (entire directory) Note: With macOS Sonoma, 32023 compiler is used instead and so this patch is not needed + until macOS 14.2 Beta 2 with version '32023.26'. Parameters: mount_point: The mount point of the target volume """ - - if self.constants.detected_os != os_data.os_data.ventura: - return - if self.constants.detected_os_minor < 4: + if os_data.os_data.sonoma < self.constants.detected_os < os_data.os_data.ventura: return - LIBRARY_DIR = f"{mount_point}/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/31001/Libraries/lib/clang" - GPU_VERSION = "31001.669" + if self.constants.detected_os == os_data.os_data.ventura: + if self.constants.detected_os_minor < 4: # 13.3 + return + BASE_VERSION = "31001" + GPU_VERSION = f"{BASE_VERSION}.669" + elif self.constants.detected_os == os_data.os_data.sonoma: + if self.constants.detected_os_minor < 2: # 14.2 Beta 2 + return + BASE_VERSION = "32023" + GPU_VERSION = f"{BASE_VERSION}.26" + LIBRARY_DIR = f"{mount_point}/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/{BASE_VERSION}/Libraries/lib/clang" DEST_DIR = f"{LIBRARY_DIR}/{GPU_VERSION}" if not Path(DEST_DIR).exists(): - return + raise Exception(f"Failed to find GPUCompiler libraries at {DEST_DIR}") for file in Path(LIBRARY_DIR).iterdir(): if file.is_file(): @@ -260,7 +267,7 @@ def patch_gpu_compiler_libraries(self, mount_point: Union[str, Path]): continue # Partial match as each OS can increment the version - if not file.name.startswith("31001."): + if not file.name.startswith(f"{BASE_VERSION}."): continue logging.info(f"Merging GPUCompiler.framework libraries to match binary")