GPU → CPU: let the GPU mark the pages that need a read-back #1303
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 fxceless/victory-fork. Originally posted by liuycsbxbxn on 2026-11-26T13:31:58Z.
Split out of #1273.
Suggested labels: performance / gpu
Verification cost:
[GPU][TITLE]What the meta-issue asks
Current shape
Acceptance
VICTORY_*) that reads back only flagged pages, off by default.Imported from fxceless/victory-fork. Originally posted by JayFoxRox on 2026-11-26T16:42:54Z.
Some information was lost in transition from #1273.
Currently, my understanding is that the GPU hasher communicates which pages changed, and then changed pages get downloaded to the CPU / system-RAM again (periodically?). Even if there is already on-demand page fetching (by using guard-pages) the following should still be a performance improvement.
When the CPU reads from (the guard page system-RAM copy of) a GPU resource, currently a guard page exception occurs which eventually triggers a redownload of the GPU side memory to the CPU. However, page-exceptions are slow and the current approach requires unlocking and relocking pages.
The proposals are
Imported from fxceless/victory-fork. Originally posted by liuycsbxbxn on 2026-11-26T17:02:46Z.
Fair point — the split dropped the rationale. Restoring it so this stands on its own:
today the GPU hasher reports which pages changed, and the changed ranges are copied back to system RAM on a schedule, whether or not the CPU ever touches them. On-demand fetch already exists via guard pages, so this is an optimisation on top of that, not a replacement — and it is still worth doing, because when the CPU does read, avoiding the fault + re-lock path is where the win is.
Agreed that #1305 is the prerequisite: without the trampoline, any on-demand path still pays the exception and the re-lock cost you cite. So the order I would propose is #1305 first, then this as a switch that gates the download on an actual CPU read. #1307 is the mirror case, on the write side.