Add opt-in NVAPI CPU-Visible VRAM (CVV) fallback and F10 menu setting #104
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/gamingwithhomie--larp!104
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-104"
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?
@reloadggg on GitHub · 2026-12-05 18:32 UTC · original
reloadggg:nvapi-cpu-visible-vidmem→main· +393 −27 · 13 files · 1 commits · merged 2026-12-05 19:00 UTCSummary
Adds an opt-in (off by default) NVIDIA NVAPI CPU-Visible VRAM (
NvAPI_D3D12_CreateHeap2withNV_D3D12_HEAP_FLAG_CPUVISIBLE_VIDMEM) fallback toHost::card_mapped_buffer_aswhen standard D3D12GPU_UPLOADheaps are unavailable, along with anF10menu /settings.ini/LARP_CVVtoggle.Who this helps
> 256 MiB, e.g. Resizable BAR / ReBAR), but D3D12D3D12_HEAP_TYPE_GPU_UPLOADis not exposed by the OS/driver:GPU_UPLOADis unavailable despite ReBAR being enabledGPU_UPLOADis already available are completely unaffected (GPU_UPLOADalways takes priority).nvapi_cvv/LARP_CVVis left at its default (off) are completely unaffected (nonvapi64.dllload, zero behavior change).> 256 MiBtotal CVV guard) and fall back to system-memory upload heaps as before.What changed
crates/larp-gpu/src/nvapi.rs(new):nvapi64.dllfromSystem32(LOAD_LIBRARY_SEARCH_SYSTEM32) only when opted in andGPU_UPLOADis unavailable.NvAPI_D3D12_QueryCpuVisibleVidmemand requires> 256 MiBtotal CVV before enabling.D3D12_HEAP_TYPE_CUSTOM(WRITE_COMBINE+L0) heaps viaNvAPI_D3D12_CreateHeap2(NV_D3D12_HEAP_FLAG_CPUVISIBLE_VIDMEM = 1), supporting UAV +COMMONinitial state for all fourcard_mapped_buffer_ascall sites (descriptor staging, host scratch, title memory windows, shadow UAV windows), and keeps the backing heap alive viaSetPrivateDataInterface.ask(bool),status(), andnote_status()for theF10menu andsettings.ini.crates/larp-gpu/src/host.rs:heap.Type == GPU_UPLOAD(scratch_buffer/take_chunk).card memory the CPU maps supported=true way="NVAPI CVV" cvv_mib=...when active.crates/larp-game/src/settings.rs,crates/larp-hle/src/settings.rs,locales/*.json(all 7 catalogs),docs/environment-variables.md:nvapi_cvv(default/off/on,When::Start, envLARP_CVV, defaultoff) to[picture]and theF10menu.Testing
Unit tests & build (Windows x86_64 MSVC, commit
5406444)cargo test -p larp-gpu --lib nvapi::tests --locked— 4/4 passedcargo test -p larp-core --locked— 7/7 passed (all 7 locale catalogs verified sorted/complete)cargo test -p larp-game --locked— 60/60 passedcargo build --release --locked -p larp— succeededLive game verification (Windows 11 26300, i5-13490F, NVIDIA RTX 2080 Ti with 16 GiB expanded BAR1, driver 621.1,
LARP_CVV=1)nvapi64.dlldetection & activation:NVAPI CPU-visible vidmem total_mib=16352 free_mib=15835card memory the CPU maps supported=true way="NVAPI CVV" cvv_mib=16352--console series-xand--console series-sin-world at 2560×1440 with DXR 1.2 ray tracing + DLSS + DLSS FG (copies 0.1 ms,copying back 0.1 ms, 0 CVV errors).min_cvv_guard_requires_expanded_bar) or AMD/Intel GPUs (wherenvapi64.dllis not loaded by default and returns unavailable if opted in).