Repository navigation
D3D12.X: a bind's driver compile is not on the title thread - #8
Merged
Merged
Conversation
Dispatch waited in resolve_wait and ran the driver's compile on the title thread, 5–10 s for a large compute PSO. The title's stall check Sleeps once a second and gives up after 30 ticks while that thread has not returned, then writes 0. The compile now runs on its own thread, and a Sleep of 100 ms or more does not count the time a bind is waiting. No dispatch is skipped and pipelines are not built ahead. Assisted-by: Cursor (Grok 4.7) Co-authored-by: stolk88 <stolk88@users.noreply.github.com>
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.
A lazy compute PSO is built on the title thread inside
resolve_waitwhen no worker has started it. On this NVIDIA GPU that driver compile takes 5–10 s (517 KB DXIL measured at 9673 ms). The title's stall check, a thread thatSleeps once a second and gives up after 30 ticks without a sign of the main thread (xcl-dev#505), then writes 0 atgame_scarlett_master.exe+0x23cf683. The device is still alive, so #7's GPU-wait hold has nothing to log: that path is not an armedqueue.Wait.What the other approaches do, and why this is the small one:
XCL_PSO_WAIT_MSstops waiting and later dispatches of that PSO are skipped. A skipped compute dispatch leaves its outputs unwritten.Sleepof 100 ms or more does not count time a bind is waiting, so the 30-tick check does not fire. No dispatch is skipped. Measured on the retail title: the process stayed up instead of exiting 30–70 s into world setup.This PR is that hold, plus the compile itself leaving the title thread. The bind still waits until the PSO exists. It does not run
CreatePipelineStateon the title thread, and it does not build every compute PSO at create.What is in it
resolve_waitruns a compile no worker has started onxcl-pso-bind, then waits. The caller is not inside the driver compile.title_heldis set for that wait, with or withoutXCL_PSO_WAIT_MS.kernelx::Sleep: a sleep of 100 ms or more (XCL_SLEEP_HOLD,0leaves the PC Sleep) does not count timetitle_heldis set. Shorter sleeps, a yield andINFINITEare passed on.Tested
cargo test --workspace: not runRegression run
main: not run (no Windows host)
PR: not run
Not tested
scripts/smoke.ps1, the retail title, RTX 4080.Sleep. Upstream kernelx: Sleep does not count the time a bind waits for a pipeline build xcl-dev/xcl#1288 calls that out; it did not fire in their runs.AI use