Skip to content

Commit

Permalink
GUI: Add option to configure cpus=4 on MacPro3,1/Xserve2,1
Browse files Browse the repository at this point in the history
If booting Sonoma or older, can toggle off the workaround
  • Loading branch information
khronokernel committed Sep 14, 2024
1 parent 85cf440 commit 8eebf7e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@
- iMac7,1 - 18,x
- MacPro3,1 - 6,1
- MacPro3,1 can only boot with 4 cores max currently
- 8 cores can be re-enabled for older OSes in the GUI:
- Settings -> Build -> MacPro3,1/Xserve2,1 Workaround
- Xserve2,1 - 3,1
- Xserve2,1 can only boot with 4 cores max currently
- 8 cores can be re-enabled for older OSes in the GUI:
- Settings -> Build -> MacPro3,1/Xserve2,1 Workaround
- Excludes the newly dropped MacBookAir8,x series.
- No estimate can be given when support will be added.
- For non-Metal graphics, Photos app will be broken.
Expand Down
1 change: 1 addition & 0 deletions opencore_legacy_patcher/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ def __init__(self) -> None:
self.disable_connectdrivers: bool = False # Disable ConnectDrivers (hibernation)
self.set_vmm_cpuid: bool = False # Set VMM bit inside CPUID
self.disable_mediaanalysisd: bool = False # Set mediaanalysisd to spawn
self.force_quad_thread: bool = False # Force quad thread mode (cpus=4)
self.set_alc_usage: bool = True # Set AppleALC usage
self.allow_3rd_party_drives: bool = True # Allow ThridPartyDrives quirk
self.allow_nvme_fixing: bool = True # Allow NVMe Kernel Space Patches
Expand Down
6 changes: 6 additions & 0 deletions opencore_legacy_patcher/efi_builder/firmware.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,12 @@ def _cpu_compatibility_handling(self) -> None:
logging.info("- Adding IOHIDFamily patch")
support.BuildSupport(self.model, self.constants, self.config).get_item_by_kv(self.config["Kernel"]["Patch"], "Identifier", "com.apple.iokit.IOHIDFamily")["Enabled"] = True

# MacPro3,1/Xserve2,1 cannot boot with more than 4 threads in Sequoia
# Note cpus=4 only overrides if more than 4 threads are present. So same on dual-core units
if self.constants.force_quad_thread is True:
logging.info("- Adding CPU Thread Limit Patch")
self.config["NVRAM"]["Add"]["7C436110-AB2A-4BBB-A880-FE41995C9F82"]["boot-args"] += " cpus=4"


def _firmware_driver_handling(self) -> None:
"""
Expand Down
6 changes: 5 additions & 1 deletion opencore_legacy_patcher/support/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ def _general_probe(self) -> None:
global_settings.GlobalEnviromentSettings().write_property("MacBookPro_TeraScale_2_Accel", False)
self.constants.allow_ts2_accel = False

if self.model in ["MacPro3,1", "Xserve2,1"]:
self.constants.force_quad_thread = True
else:
self.constants.force_quad_thread = False

if self.model in smbios_data.smbios_dictionary:
if smbios_data.smbios_dictionary[self.model]["CPU Generation"] >= cpu_data.CPUGen.skylake.value:
# On 2016-2017 MacBook Pros, 15" devices used a stock Samsung SSD with IONVMeController
Expand Down Expand Up @@ -197,7 +202,6 @@ def _networking_probe(self) -> None:
device_probe.Broadcom.Chipsets.AirportBrcmNIC,
]
):
print("Modern WiFi")
is_modern_wifi = True

if is_legacy_wifi is False and is_modern_wifi is False:
Expand Down
13 changes: 11 additions & 2 deletions opencore_legacy_patcher/wx_gui/gui_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(self, parent: wx.Frame, title: str, global_constants: constants.Con

self.settings = self._settings()

self.frame_modal = wx.Dialog(parent, title=title, size=(600, 675))
self.frame_modal = wx.Dialog(parent, title=title, size=(600, 685))

self._generate_elements(self.frame_modal)
self.frame_modal.ShowWindowModal()
Expand Down Expand Up @@ -314,6 +314,16 @@ def _settings(self) -> dict:
"min": 0,
"max": 60,
},
"MacPro3,1/Xserve2,1 Workaround": {
"type": "checkbox",
"value": self.constants.force_quad_thread,
"variable": "force_quad_thread",
"description": [
"Limits to 4 threads max on these units.",
"Required for macOS Sequoia and later.",
],
"condition": (self.constants.custom_model and self.constants.custom_model in ["MacPro3,1", "Xserve2,1"]) or self.constants.computer.real_model in ["MacPro3,1", "Xserve2,1"]
},
"Debug": {
"type": "title",
},
Expand Down Expand Up @@ -456,7 +466,6 @@ def _settings(self) -> dict:
"Recommended for all users, however faulty",
"SSDs may benefit from disabling this.",
],

},
},
"Advanced": {
Expand Down

0 comments on commit 8eebf7e

Please sign in to comment.