DARNER_ASYNC_QUEUE=1: run the title's compute lists on a host compute queue (off by default) #530
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
hle
input
INTEL
lighting
linux-proton
memory
MULDER
needs-info
needs-logs
needs-rebase
NVIDIA
performance
post-merge
pr-diagnostics
pr-docs
pre-merge
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
relevance
high
relevance
low
relevance
medium
relevance
very-high
rendering
report
roadmap-proposal
saves
series-s
shaders
startup
status
blocked-by-rework
status
needs-test-report
status
needs-triage
status
ready-for-review
status
stale
status
superseded
status
wip
tools
ui
upstream
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!530
Loading…
Reference in a new issue
No description provided.
Delete branch "nastyhotdog/Darner:pr/async-compute-queue"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Title:
[pr-feature] DARNER_ASYNC_QUEUE=1: run the title's compute lists on a host compute queue (off by default)
Contributor role (optional)
What it changes
host/two_queues.rsplans which submissions could go to a second queue (DARNER_ASYNC_QUEUE=plan), but everything runs on the direct queue, and its log line says so.With
DARNER_ASYNC_QUEUE=1, the title's compute lists run on a host compute queue. Nothing changes unless it is set.list/thin.rs). Compute lists keep their type through host list swaps and have their own idle pool (list.rs).DARNER_ASYNC_OVERLAP).0(default with the queue on): safe mode, where each queue waits for the other at every submission.1: the direct queue waits for compute work only before the part of a submission that needs it.2: compute work also starts behind only what it needs. A ledger records what each submission reads and writes and resolves it against what was actually sent. A third queue signals the submission fence, so neither queue waits for the other at a submission's end. Value waits a flight in the air will meet are placed at their part.DARNER_ASYNC_PRELUDE=1: preludes that only move states a compute list may hold run on the compute queue.DARNER_ASYNC_READS=1: a compute list reads sampled textures in the state they are in, without moving them there and back.barstat.rslogs a compute list barrier that names a drawing state.This PR does not make anything faster. In the one scene measured there was no gain (below). It is offered as an opt-in base for card-limited scenes, which are where overlapping compute with graphics can pay, and which have not been measured with it yet.
How it was tested
Tested revision: gates on
b914fb3(this branch, on mainc8258f9). The game runs used the same async-queue code on an older main (bd0de0c) with other local, off-by-default changes.b914fb3itself was not run in the game.Commands and results: see the gates below; there is a GPU test,
gpu_tests::the_direct_queue_runs_on_while_the_fence_waits_for_compute_work, that runs on the card.Changes a default: no.
A/B result: same scene (standing still, about 5,000 draws per frame), same settings and hardware, one run each. 5-second fps readings after the scene settled:
DARNER_ASYNC_QUEUE=1,DARNER_ASYNC_OVERLAP=2,DARNER_ASYNC_READS=1,DARNER_ASYNC_PRELUDE=1)Both runs had
DARNER_PASSES_HOT=300, and B also hadDARNER_CARD_METER=0. A third run with neither switch measured 25.0 (7 readings, 24.2-25.6). The differences are within run-to-run noise.In run B the log showed, per frame: about 8 submissions with compute lists, 9 runs on the compute queue, and 15 of 18 submissions whose direct lists never waited for the compute queue.
An Nsight Systems capture (10 s, on) explains the lack of gain in that scene:
Gates run on that revision (
b914fb3), on the machine below:cargo xtask policy: asset policy: 576 files ok.cargo clippy --workspace --all-targets --locked -- -D warnings: clean.cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: clean.cargo test --workspace --locked: 3525 passed, 0 failed, 121 ignored. One test did not finish:darner-shader'soracle64::legacy_mul_forms_are_exactwas stopped after more than 15 minutes in the debug build. This PR does not changedarner-shader. The targets after it (darner-simd,xtask, the doc tests) were then run on their own withcargo test --locked -p darner-simd -p xtaskandcargo test --workspace --locked --doc.nvlddmkm, event 153) while thedarner-gputests ran. The cause was not confirmed. That revision's GPU test left its compute queue waiting on a fence if an assert failed first, so it now opens that fence however it ends. Since then, no driver errors have been logged in that test alone, in all ofcargo test -p darner-gpu(1811 passed, 0 failed, 81 ignored) or in the gate 3 run above.Gameplay: NVIDIA RTX 3070 Ti (8 GB), Intel i5-12600K, Windows 11 (10.0.26300), driver 591.44. Series S profile, 1920x1080 picture (the title's own 1280x720 scene), DLSS off, frame generation off, ray tracing off.
Shader wave sizes tested: not relevant (no shader change).
Hardware dependence: untested elsewhere; only on that NVIDIA card. How much compute can overlap depends on the card and driver.
Coverage gaps:
DARNER_ASYNC_OVERLAP=1,DARNER_ASYNC_READSandDARNER_ASYNC_PRELUDEwere not A/B tested on their own.Checklist
The async-queue code ran in the game on the older base described above. This rebased commit was not run in the game.
main.docs/asset-policy.md.Checked for overlap
DARNER_LATE_FENCE, cross-queue fences; also changesqueue/behind.rs).host.rs(41) andlist/thin.rs(6); none of them changeshost/two_queues.rs.🤖 Generated with Claude Code
[pr-feature] DARNER_ASYNC_QUEUE=1: run the title's compute lists on a host compute queue (off by default)to DARNER_ASYNC_QUEUE=1: run the title's compute lists on a host compute queue (off by default)Test needed — commit
b914fb3f; what to check:host/two_queues.rsplans which submissions could go to a second queue (DARNER_ASYNC_QUEUE=plan), but everything runs on the direct queue, and its log line says so.With
DARNER_ASYNC_QUEUE=1, the title's compute lists run on a host compute queue. Nothing changes unless it is set.list/thin.rs). Compute lists keep their type through host list swaps and have their own idle pool (list.rs).DARNER_ASYNC_OVERLAP).0(default with the queue on): safe mode, where each queue waits for the other at every submission.1: the direct queue waits for compute work only before the part of a submission that needs it.2: compute work also starts behind only what it needs. A ledger records what each submission reads and writes and resolves it against what was actually sent. A third queue signals the submission fence, so neither queEvidence to post: card + driver, settings, commit tested, before/after (switch off vs on, two runs each), fps median and p99, and one line saying you looked at the picture.
Reply
testingto take this run; it's free again after 24 h with no results.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.