umem: run on NVIDIA's driver #168
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/vktory6--VKtory!168
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-168"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@360900 on GitHub · 2026-12-01 23:12 UTC · original
360900:feat/umem-nvidia→main· +636 −110 · 16 files · 2 commits · openWhat
umem runs on NVIDIA's proprietary driver. What differs per driver is one struct chosen at device creation (
umem/src/driver.rsDriver); RADV's values are the ones in use today.VK_EXT_external_memory_host: the driver's dma-bufs map at file offset 0 only, and without Resizable BAR 246 MiB of its VRAM is CPU-visible. Every kind is system RAM there (Memory::placed).Memory::bind_grain).Memory::chunk_handle).UMEM_HOST_CHUNKS=1chooses the chunk source and the 64 KiB on another driver, so the path can be run on the reference card (rule 38).vkback needs more to run the title on this driver; those are pull requests of their own. Issue #3.
The reference
No counterpart: vkd3d-proton has no title memory at fixed addresses. The driver's behaviour is measured by
tests/host_probe.rs(docs/learnings/nvidia.md, docs/tools.md).Evidence
cargo test -p umem --release -- --test-threads=1): 22 unit, gpu 12, sparse_mode 14, the probes.VUID-VkPipelineLayoutCreateInfo-descriptorType-03017and its family, #159), a colour target in a format the card cannot render to (VUID-VkGraphicsPipelineCreateInfo-renderPass-06582and its family, #158),VUID-vkCmdCopyBuffer-pRegions-12482in one of two runs (#160). One of the 10 runs lost the device without a driver account (#161).Driver::ofgives RADV the constants it had, andUMEM_HOST_CHUNKS=1is not run there.Checklist (docs/AGENTS.md)
docs/TASKS.mdnot edited (rule 29)UMEM_HOST_CHUNKSvalue and a driver without the handle type for sparse buffers stop the startUMEM_HOST_CHUNKS(test)unsafeblock has a// SAFETY:comment (rule 36): the new blocks have itTRANSLATOR_VERSION: the translator is not touched (rule 27)@tylerstraub on GitHub · 2026-12-01 23:37 UTC · original
A second NVIDIA card for this: RTX 5090 (32 GB), driver 620.73.04, Linux 7.0, Proton Experimental. The machine also has an AMD iGPU. Built from
d59b4f8with #162–#170 merged (all nine merge cleanly).The probe (
cargo test -p umem --release --test host_probe -- --ignored --nocapture) passes and agrees withdocs/learnings/nvidia.md:memoryTypeBitsOne correction to the notes. "CPU-visible VRAM: a heap of its own, 246 MiB" is that machine, not the driver. Here the device-local, host-visible, host-coherent type (type 4) lives in the 31.84 GiB heap (resizable BAR on), and
VK_EXT_map_memory_placedmaps it at a requested address (memoryMapPlacedyes,memoryMapRangePlacedno, so a placed range is a whole allocation). The comment onDriver::hostand the "Memory" table could say "246 MiB without resizable BAR". It matters for where this goes next:Memory::placedputs every kind in system RAM by driver, and on a card with the BAR the write-combined kinds could be VRAM bound into the same window (the probe above binds VRAM and imported pages side by side). In our own NVIDIA port of umem, moving the title's write-combined graphics heap into BAR VRAM at its own address took the house scene from 345 to 219 ms a frame (interleaved, 3 runs an arm, no loss). Happy to bring that as a pull request on top of this one once it is in.umem's tests. Unit 22/22,
bench,identity_probe,sparse_probe,sparse_speed,sparse_wait_probepass.gpuis 11/12 andsparse_mode10/14 when the binary runs whole (--test-threads=1): the last tests of each fail withMemory::new: Setup("no discrete GPU")(vram_full_spills_to_gtt_write_combined;sparse_pool_views_two_addresses,sparse_span_crosses_runs_up_to_a_hole,sparse_timings,the_title_window_holds_every_title_address_at_its_own_offset). Each passes alone. The same in four runs. It looks as if the NVIDIA device stops being listed after about ten devices in one process, and with an iGPU present the enumeration still succeeds without it. Not traced further; I can run whatever helps.In game: see my comment on #3 (the stack loses the device on this card while the world loads; one translator change fixes it here).
@tylerstraub on GitHub · 2026-12-02 00:25 UTC · original
Split the driver-independent half of this out as #178 so it can go in on its own (your names kept, so this rebases onto it by taking your side in each conflict). Not trying to step on it; happy to adjust if you'd rather shape it differently.
@360900 on GitHub · 2026-12-02 12:08 UTC · original
The 246 MiB is this machine without Resizable BAR; corrected in
1572563. No objection to #178: if it lands first, I merge main into this. Yes to the BAR VRAM pull request on top of this. The "no discrete GPU" failures do not show here with one GPU.@360900 on GitHub · 2026-12-02 14:28 UTC · original
@tylerstraub is the branch with the write-combined heaps in BAR VRAM public anywhere? A draft pull request on top of this one works too. I can run it on the 5080 with Resizable BAR on and off.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.