The NVIDIA arm read each encode source as host bytes and copied it with the
CPU into an NVENC input buffer; a source in a device cache went through a
staging copy first. The runtime device's GPU now copies the source's planes,
where they lie, into an exportable buffer that CUDA imports and NVENC
registers as input (nvEncRegisterResource, a CUDA device pointer, mapped for
each frame and unmapped once its bitstream is locked), as the VA-API arm
fills its input surfaces (cee727b5e). A frame whose copy is declined is
uploaded as before, with the reason logged once a session; a session whose
input CUDA or NVENC refuses uploads from then on.
NVENC codes the same bytes either way: the new hardware test
each_frame_filled_by_the_gpu_encodes_as_uploaded compares every access
unit of H.264 High and HEVC Main at 1080p, from pages and from a device
cache. The guest sees the same results sooner: on um870's RTX 3090,
VideoToolbox's H.264 encode of 300 frames went from 88.7 to 156.5 fps at
1080p (6 Mbit/s) and from 24.6 to 40.5 fps at 2160p (30 Mbit/s), each
stream byte-identical in size and in PSNR against the source.