Skip to content

rendervulkan: read capture back through a buffer on NVIDIA - #2315

Open
matte-schwartz wants to merge 1 commit into
ValveSoftware:masterfrom
matte-schwartz:matts/nvidia-capture-readback
Open

rendervulkan: read capture back through a buffer on NVIDIA#2315
matte-schwartz wants to merge 1 commit into
ValveSoftware:masterfrom
matte-schwartz:matts/nvidia-capture-readback

Conversation

@matte-schwartz

Copy link
Copy Markdown
Collaborator

On NVIDIA, the capture path's RGB->NV12 shader stores into the host-visible linear PipeWire texture go out at a few hundred MB/s, so one 5120x2160 frame takes ~65ms regardless of GPU clocks. paint_pipewire blocks on that work in the compositor thread, capping the whole session at ~15fps whenever recording or Remote Play is active.

Keep capture images device-local and move them into a host-visible buffer with the copy engine. Both the proprietary driver and NVK map host-visible system memory GPU-uncached, so shader stores bypass the GPU L2 and cross PCIe as individual snooped transactions that nothing coalesces. The copy engine moves the same data in large bursts and does not share the problem. Key on the vendor ID since the behavior is common to both drivers, and this fix results in a >10x speedup for the capture path on my 5090.

On NVIDIA, the capture path's RGB->NV12 shader stores into the
host-visible linear PipeWire texture go out at a few hundred MB/s, so
one 5120x2160 frame takes ~65ms regardless of GPU clocks. paint_pipewire
blocks on that work in the compositor thread, capping the whole session
at ~15fps whenever recording or Remote Play is active.

Keep capture images device-local and move them into a host-visible buffer
with the copy engine. Both the proprietary driver and NVK map host-visible
system memory GPU-uncached, so shader stores bypass the GPU L2 and cross
PCIe as individual snooped transactions that nothing coalesces. The copy
engine moves the same data in large bursts and does not share the problem.
Key on the vendor ID since the behavior is common to both drivers, and
this fix results in a >10x speedup for the capture path on my 5090.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant