GPU: marked pages could go back on several threads (copy-back 184 to 124 ms here) #2824
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Imported from Marvisak/VIctory. Originally posted by Machad3x on 2026-11-25T21:33:56Z.
What
After a submission,
shadow::copy_back_markswrites the marked pages back one after another on the submitting thread. In a world scene here that is about 2,000 pages of 64 KiB a frame at 55 to 80 µs each (two reads, a compare, writes, a protection change).Change tried
Group the pages by address (two buffers covering the same page stay on one thread, in their old order) and take the groups on up to six scoped threads, the submitting one among them; under 16 pages it stays serial.
The final loop of
copy_back_markscalls it with the withheld check andcopy.copy_back_marked(page)in the closure.Measured
Ryzen 7 5700X, RTX 3080 Ti, Windows 11, on a stack of open pull requests (including #2120, #2130 and #2280) merged with main
67e8ae1, not onmainalone. One 7-minute run each, same scene, medians:victory-gputests pass, with a new one writing 96 marked pages of two overlapping buffers back. No device removal in this and later runs. The gain per thread is well under linear; the threads are made anew each submission, so a kept pool may do better.Code, with the test:
github.com/Machad3x/VIctory-nvidia-3080ti@7229f41Written with Claude Code; tested locally.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T21:46:15Z.
Automated triage for the maintainers.
Performance change with a patch. On
main, the final loop ofcopy_back_marksincrates/victory-gpu/src/shadow.rscallsShadow::copy_back_markedonce per page, serially, on the submitting thread, as described. The change is now open as pull request #2914 (ported to currentmain, original authorship kept). #2051 does the same for refreshes, and #2280/#2409 make each page's copy-back cheaper.The numbers above were measured on a stack of open PRs (#2120, #2130, #2280); a measurement on
mainalone, which #2914 notes is still open, would help the maintainers judge the gain.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T23:52:03Z.
Opened as #2914 — the
7229f41change ported to current main verbatim (keeping your authorship, minus the fork doc page). The 96-page two-copy test passes on a GTX 1050; the main-alone measurement the triage asked for is still open — noted in the PR.