Files
reims-vgpu/docs
Anees Iqbal 7f44053438 🐛 Answer a shared-memory GPU's working set from the guest's RAM
On a host GPU that shares the CPU's memory, the device answered
recommendedMaxWorkingSetSize with the platform's device-local memory, a share
of the host's RAM, which can be more than the guest's: guests of 8 GiB were
told 11864629248 bytes on a Radeon 780M and 24950464512 on an Iris Xe. No Mac
answers more than its RAM: a Mac's GPU that shares its memory answers a share
of it, from an Intel UHD 630's 0.023 (macOS 26.7.1) to an Apple M3 Max's 0.81
(macOS 27.0.1).

What the guest sees now:
- On a GPU that shares the CPU's memory (a Radeon 780M, an Iris Xe, an Apple
  GPU under MoltenVK), x86-64 and arm64 guests alike: the working set is three
  quarters of the RAM the host maps for the device, rounded down to 16 KiB, or
  the platform's answer where that is less; about 6 GiB for a guest of 8 GiB.
  maxBufferLength follows it by its rule (three quarters of the working set,
  about 4.5 GiB), and so does the kext's VRAM,totalMB (the working set in MiB).
- On a GPU of its own memory (an RTX 3090 or 5080, an RX 7900 XTX), and where
  the host passes no memory map: the platform's answer, as before, the card's
  own memory, as an AMD Radeon Pro 5300M answers its own 4 GiB less 16 MiB.

The RAM is the sum of the memory map's ranges, so no C API value is added:
q35's map leaves out the 384 KiB below 1 MiB, and vmapple's under HVF adds its
firmware's 1 MiB and config's 64 KiB, both well inside Apple's range.

On an Iris Xe, a macOS 14.8.9 guest told 24950464512, 5726617600, 4278190080
or 1610612736 bytes did the same work over a cold boot and a Safari scroll:
the runtime's blocks, the page's frames and the presents.
2026-11-11 13:16:00 -08:00
..