Repository navigation
GPU: enable M2 Max compute preemption and preserve explicit overrides - #68
Merged
Merged
Conversation
The compute work queue pins its priority fields to the highest entry, preventing the firmware from switching compute work out for other clients. On M2 Max, long compute dispatches beside an animating compositor trigger watchdog timeouts, incorrect compute results and stalled display fences. Preserve the requested priority fields on G14X so firmware can preempt compute work. Add compute_preempt: -1 selects the GPU default, 0 retains the disabled-preemption priority fields and nonzero overrides enable it. Signed-off-by: Joshua Warren <[email protected]> Signed-off-by: Chris Kearney <[email protected]>
Pass the existing hardware configuration to each legacy workqueue. Automatic mode enables preemption on G14X T6021 and retains the Debug0 opt-in; explicit compute_preempt overrides take precedence. M2 Pro and Ultra remain explicit opt-in targets. Preserve all priority fields outside the disabled compute case. Signed-off-by: Chris Kearney <[email protected]>
This was referenced Oct 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
M2 Max can starve an animating compositor during long compute dispatches because its legacy compute queue disables firmware preemption. Bring in Joshua Warren’s PR #16 with a narrow integration successor: automatic preemption on G14X T6021 (M2 Max), retain the existing Debug0 opt-in, and let explicit
compute_preempt=0/1override automatic selection.M2 Pro/Ultra keep their current defaults and can opt in explicitly while their hardware qualification remains open. Vertex/fragment priorities, compute backing and firmware timeouts, and M3 HAL200 submit paths are unchanged.
Validation: 12,960 compiled policy/priority combinations use the production Rust version macro and priority table; the original broad/default policy and four mutated policies fail the successor’s controls. Focused ARM64 compilation of the complete Asahi object passes with Clang 22.1.8 and Rust 1.93.1. Independent adversarial review of the successor passes, including all four hardware-configuration call sites and the frozen policy controls.
Joshua’s hardware evidence in #16 covers M2 Max: 152/690 ms dispatches complete correctly beside an animating page without the stock watchdog storm. Those are the author’s reported results, not a new run here; his candidate also carried an unrelated timeout fix that remained inactive in the passing run. No new hardware, scheduling/teardown or Pro/Ultra acceptance is claimed.
Related #25; supersedes #16 while retaining Joshua’s authorship. No release assets change.