You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
kyty: device memory cap does not bound VRAM on NVIDIA/Windows; heap-pinned textures are never freed #315
area: gpu-memoryMemory tracking, write faults, buffer and texture caches, write-backsarea: windowsWindows build and runtimebugSomething isn't workinghardDeep change or open question: comment on the issue before startingneeds: WindowsNeeds a Windows machine
VMA heap 0 holds at its cap (budget less min(3 GiB, 1/4), or KYTY_MEMORY_BUDGET_MB), but images past it go to memory type 0 (heap 1, no flags), which NVIDIA 617.42 keeps in VRAM: VMA heap 1 blocks 4168 MiB vs driver heap 1 usage 648 MiB, driver heap 0 usage 8618 MiB with VMA heap 0 at 3999. Optimal-tiled images cannot use any HOST_VISIBLE type (forcing one: VK_ERROR_FEATURE_NOT_PRESENT).
~1.3 GB of device memory is outside VMA (driver/pipelines) and not in the reserve.
In the first scene ~95% of live image bytes have heap_refs != 0 (bindless table), 2.5-5.3 GB; GC skips them. Texture and buffer GC age is counted in GC ticks (one per frame); at 0-2 fps nothing ages.
Result on 8 GB: the card fills to its size, then Windows demotes; past ~9.5 GB of game usage the device was lost once.
Thanks, that is a precise report, and it explains why the cap holds on Linux but not on Windows. The cap only limits what the allocator places on the device-local heap. Optimal images that do not fit go to the plain memory type of heap 1, and on Windows the driver is free to keep that in VRAM, so the card fills anyway. Since optimal-tiled images cannot use any host-visible type, the allocator cannot fix that alone: the cache has to give memory back.
What we would do, in this order (each can be its own PR):
Trigger on what the driver reports: compare heapUsage from VK_EXT_memory_budget for the device-local heap, which also counts the ~1.3 GB outside the allocator, against heapBudget minus the reserve, instead of the allocator's own block sizes.
Age on time as well as on GC ticks: at 0 to 2 fps nothing ages, so a texture or buffer should also age by wall time, or by memory pressure, not only once per frame.
area: gpu-memoryMemory tracking, write faults, buffer and texture caches, write-backsarea: windowsWindows build and runtimebugSomething isn't workinghardDeep change or open question: comment on the issue before startingneeds: WindowsNeeds a Windows machine
Activity
simnJS commentedon Nov 26, 2026
Thanks, that is a precise report, and it explains why the cap holds on Linux but not on Windows. The cap only limits what the allocator places on the device-local heap. Optimal images that do not fit go to the plain memory type of heap 1, and on Windows the driver is free to keep that in VRAM, so the card fills anyway. Since optimal-tiled images cannot use any host-visible type, the allocator cannot fix that alone: the cache has to give memory back.
What we would do, in this order (each can be its own PR):
heapUsagefromVK_EXT_memory_budgetfor the device-local heap, which also counts the ~1.3 GB outside the allocator, againstheapBudgetminus the reserve, instead of the allocator's own block sizes.#312 and #313 help on 8 GB cards in the meantime; see the reviews there.
Would you like to take 1 and 2? Both are self-contained in the texture and buffer caches, and you can test them on Windows, which we cannot easily do.