Skip to content

Commit e31519a

Browse files
committed
Avoid patching Metal and non-metal together
1 parent 49fa20e commit e31519a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Resources/SysPatch.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def __init__(self, model, versions):
4141
self.bad_board_id = False
4242
self.no_patch = True
4343
self.validate = False
44+
self.supports_metal = False
4445

4546
# if (Path.home() / "Desktop/OCLP-Test/").exists:
4647
# self.mount_location = Path.home() / "Desktop/OCLP-Test"
@@ -625,6 +626,7 @@ def detect_gpus(self):
625626
if self.constants.detected_os == self.constants.monterey and self.constants.detected_os_minor > 0:
626627
if "21A5506j" not in self.constants.detected_os_build:
627628
self.kepler_gpu = True
629+
self.supports_metal = True
628630
elif gpu.arch == device_probe.AMD.Archs.TeraScale_1:
629631
if self.constants.detected_os > non_metal_os:
630632
self.amd_ts1 = True
@@ -645,7 +647,16 @@ def detect_gpus(self):
645647
elif gpu.arch == device_probe.Intel.Archs.Ivy_Bridge:
646648
if self.constants.detected_os > self.constants.big_sur:
647649
self.ivy_gpu = True
650+
self.supports_metal = True
648651
i += 1
652+
if self.supports_metal is True:
653+
# Avoid patching Metal and non-Metal GPUs if both present, prioritize Metal GPU
654+
# Main concerns are for iMac12,x with Sandy iGPU and Kepler dGPU
655+
self.nvidia_legacy = False
656+
self.amd_ts1 = False
657+
self.amd_ts2 = False
658+
self.iron_gpu = False
659+
self.sandy_gpu = False
649660

650661

651662
def detect_patch_set(self):

0 commit comments

Comments
 (0)