Files
reims-vgpu/docs/video
Anees Iqbal 94f599643a 🐎 Make exportable caches of two-plane surfaces alone
Where the host's video imports device caches (NVDEC), every device cache was
made exportable, whatever its surface. The video writes only two-plane surfaces
(NV12, P010), so a window's or a layer's cache gained nothing from it and paid
for it: metal2vulkan makes each exportable buffer a dedicated allocation, to
which it binds no image, so every texture over every cached surface was a
shadow, copied in before and back after each command buffer that used it.

On a GPU of its own memory the cache maker knew only the first plane's byte of
the layout a cached block's SURFACE_PAGES carries. CacheLayout now carries the
surface's plane count too, and only a cache whose layout gives two planes is
made exportable and gives the video its identity. A cache of one plane, or of
a surface whose pages carry no layout, is made as any other cache.

Measured with a macOS 26.7.2 guest at 3648x2038 on GPUs behind a Thunderbolt 3
link (PCIe x4 Gen3), each step Launchpad or Mission Control held open, ABBA on
one host, development 9e2f9e90f (A) against this change on it (B):

  GPU       run  Launchpad held  take-to-show  Mission Control held
  RTX 2080  A1   24.5/s          66.2 ms       52.1/s
            B1   56.8/s          14.9 ms       59.9/s
            B2   56.9/s           6.9 ms       60.0/s
            A2   24.4/s          66.6 ms       52.1/s
  RTX 3090  A1   23.1/s          70.7 ms       51.9/s
            B1   55.7/s          20.1 ms       59.8/s

The 3090's B2 and A2 did not run: its Thunderbolt link failed during B2 (a
fatal PCIe error at the dock's bridge, Xid 79). A walk of this change with
video on that 3090 held Launchpad at 56.8/s, 6.9 ms. On the 3090 the shadow
copies went from 151M texels in and 165M back a present to 23M to 36M in and
next to none back. NVDEC still lands every picture in its output's exportable
cache, by the hardware.

What the host observes: timing alone; the guest sees nothing else change. The
exportable allocations and their exports are made for the video's caches
alone, and the caches' count line's "made exportable" counts those. No
degradation kind changes; the warning for a carried layout that does not lie
in its surface now says its cache is made, not placed, as with none.
2026-11-11 06:22:13 -08:00
..