Repository navigation
Conversation
A lazy compute pipeline was built at its first bind, on the title's thread: the bind has to wait for it (a skipped dispatch corrupts what it computes), and the driver takes seconds for a big one. Preloading (xcl-dev#690) covered only the shaders an earlier run used, so every compute pipeline new to a run was still compiled in the middle of a frame. Every compute pipeline now goes to the preload workers when the title makes it, after the ones of an earlier run (a second, lower line of the same queue). Graphics pipelines stay lazy: a retail title makes ~58 000 pipelines and only 2 734 of them have a compute shader, so building these costs little. A bind that comes first still builds or waits as before, and each build is kept on disk for later runs (driver_cache). Measured on the retail title of xcl-dev#505 (RTX 5080, driver 32.0.16.2124, XCL_NETWORK=0, 240 s), counting resolve_wait calls that found their pipeline not built: without this, 16 compute binds built theirs on a title thread, 3 - 23 s each and 92.7 s in all, on five threads within 10 s, and the title's hang watchdog ended the run at 125 s. With it, one bind waited 2 ms; the run went on until XboxBvhBuilder refused an acceleration structure above 2^40 (xcl-dev#585) at 137 s. Part of xcl-dev#505. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Upstream PR xcl-dev#889 was closed or merged. |
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 pipeline is built at its first bind, on the title's thread: the bind has to wait (a skipped dispatch corrupts what it computes), and on an NVIDIA GPU the driver takes seconds for a big translated compute shader. xcl-dev#690 preloads only the shaders an earlier run used, so every compute pipeline new to a run is still compiled in the middle of a frame. Here every compute pipeline goes to the preload workers when the title makes it, behind the earlier run's ones; graphics pipelines stay lazy. Part of xcl-dev#505.
Open PRs that change
pso_async.rstoo: xcl-dev#828 (the samepreloadfunction: a textual conflict), xcl-dev#533, #267, xcl-dev#754, xcl-dev#628 – each limits or reorders waits; none builds a pipeline before its first use.What is in it
crates/xcl/src/hle/d3d12x/pso_async.rs:submit_lazysends compute pipelines to the preload queue too; the queue has two lines (an earlier run's pipelines first, then the other compute ones). A bind that comes first still builds or waits as before. Test:a_compute_pipeline_is_built_ahead_of_its_first_bind(fails without the change: the compute pipeline is still pending after 10 s).Tested
cargo test --workspace -- --test-threads=4on e1d3b9d: 716 passed, 0 failed, 41 ignored (SKIPPED:gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware– no wave64)XCL_NETWORK=0, 240 s timed runs, with a local counter onresolve_waitcalls that found their pipeline not built (separate PR):Regression run
main:
PR:
Both runs had under 17 GB of commit free at start, so the title's GPU heaps stayed out of the coherent window (512 MB, #284) – hence ~8 fps in both. The PR's run shows 15 % fewer frames; one run each, so whether that is the background compute builds or run-to-run noise is not settled.
Not tested
AI use
resolve_wait), wrote the change and the test, ran the tests and the runs, and wrote this description.Mirror of xcl-dev#889 (auto-synced, do not edit).