Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metal: fix crash by enabling concurrent compilation only if available #12311

Conversation

kemenaran
Copy link
Contributor

@kemenaran kemenaran commented Nov 22, 2023

Bug: https://bugs.dolphin-emu.org/issues/13404

On macOS 13.6 / Intel Iris with Metal 2, when starting any game, Dolphin crashes immediately with this message:

-[MTLIGAccelDevice setShouldMaximizeConcurrentCompilation:]: unrecognized selector

It seems that even on macOS 13.3+, not all devices implement this selector (first implemented in #11911).

As the behavior is an optional optimization anyway, we now perform a dynamic detection to avoid crashing if the feature is not available.

@kemenaran
Copy link
Contributor Author

PR updated, with:

  • Fixed linter warnings,
  • Added an explanation on why this is failing when using OCLP patches, which models are affected, and a link to the OCLP doc.

Copy link
Contributor

@TellowKrinkle TellowKrinkle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AdmiralCurtiss AdmiralCurtiss force-pushed the fix-metal-adapter-unknown-selector branch from 106f853 to 1441ca9 Compare November 24, 2023 14:07
Bug: https://bugs.dolphin-emu.org/issues/13404

On macOS 13.6 / Intel HD 5000, Dolphin crashes with this message:

> -[MTLIGAccelDevice setShouldMaximizeConcurrentCompilation:]: unrecognized selector

This should be available on all macOS 13.3+ systems – but when using OCLP drivers,
some devices use an older version of Metal.framework, which doesn't expose the selector.

This concerns Intel Ivy Bridge, Haswell and Nvidia Kepler when using OCLP on macOS 13.3
or newer.
(See
https://github.com/dortania/OpenCore-Legacy-Patcher/blob/34676702f494a2a789c514cc76dba19b8b7206b1/docs/PATCHEXPLAIN.md?plain=1#L354C1-L354C83)

As the behavior is an optional optimization anyway, perform a dynamic
detection to avoid crashing if the feature is not available.
@AdmiralCurtiss AdmiralCurtiss force-pushed the fix-metal-adapter-unknown-selector branch from 1441ca9 to 0ecfaf3 Compare November 24, 2023 14:09
@AdmiralCurtiss
Copy link
Contributor

Fixed the remaining lint errors.

@AdmiralCurtiss AdmiralCurtiss merged commit afb4be1 into dolphin-emu:master Nov 24, 2023
11 checks passed
@kemenaran kemenaran deleted the fix-metal-adapter-unknown-selector branch November 28, 2023 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants