Files
reims-vgpu/docs
Anees Iqbal 341c86217c 🐎 Bound the device caches on a GPU of its own memory too
What changes for the host on a GPU with memory of its own (a discrete
card): the IOSurface device caches now fit one budget together, two thirds
of the GPU's own memory's budget as the platform answers it at the device's
start. Past it, in the per-shape form the Vulkan platform takes, the shapes
no texture references are trimmed, least recently used first (never a dirty
or plane one), and a texture that takes one again has it made again and
filled from its cache's buffer. The guest reads the same bytes; only the
GPU's work and time change. Before, only a GPU that shares the CPU's
memory had a budget; its half stays as it was. The device's info line now
names the budget and the GPU's memory on both kinds.

Why: on a 4 GiB Radeon RX 550 (RADV) with no budget, QEMU asked the card
for more than it has in a browser's 3D page (by 201-270 MiB) and in a video
(by up to 1283 MiB, most of it the host's video decoder's). What did not fit
stayed in GTT after the card had room, and where long-lived allocations
stayed there a later benchmark scene ran at 17.2-17.5 frames a second
against 29.4-32.6 (jobs m3-max-63976 and 64138). The caches were the most
of what QEMU asked; of them the budget can trim only the unreferenced
shapes, 353-670 MiB at each over-asking moment, more than the 3D page's
over-ask, above a floor (buffers and referenced shapes) of 2912-3634 MiB.
Two thirds of the card is under every such floor, so it trims all it may
there, and in those walks would have trimmed elsewhere only where QEMU
asked within 415 MiB of the card's room; half would also have trimmed a
scroll that asked 2.2 GB of it.

The test that held the budget for unified memory alone takes both kinds,
and a new one checks a device on a GPU of its own memory sets it.
2026-11-21 11:24:19 -08:00
..