[pr-fix][shaders][memory][NVIDIA] Add an opt-in NVIDIA shader heap profile #164
Loading…
Reference in a new issue
No description provided.
Delete branch "umcakatabla/Darner:codex/nvidia-shader-heap"
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?
Refs #4
Contributor role (optional)
What it changes
Adds
darner nvidia-shader-heap status,install [one-gib|two-gib], andremoveas explicit commands. An install checks the selected profile, stores the shader-heap reservation in a profile tied to the executable's full path, and verifies the value in a fresh NVAPI session. Removal checks ownership before deleting the profile. The command runs separately from gameplay.The troubleshooting guide documents installation and removal. The approach is adapted from XCL PR #2590 for XCL issue #2403.
How it was tested
e6e599e. Gameplay used a release build with the same executable code.cargo clippy --workspace --all-targets --locked -- -D warnings,cargo clippy --workspace --all-targets --all-features --locked -- -D warnings, andcargo xtask policy --stagedpassed.cargo test --workspace --lockedhitask_once_by_res_splits_reservations_without_refusalsonce. That test passed on clean main and on the retry.cargo test --workspace --locked -- --skip oracle64::legacy_mul_forms_are_exacthit the same two shader test failures as clean main57dea7f. The failing tests weresampled_marks_restore_early_depth_only_when_safe_in_pixel_shadersandlds_shared_atomic_add_producer_executes_wave32_on_hardware.0x887A0005at 24.1 seconds in the world (2,133 distinct pipelines). The 2 GiB profile reached the scheduled 1,200-second limit without a device removal (2,483 pipelines). An earlier default run reached its 360-second limit. A fresh NVAPI query verified 2 GiB after installation and the absence of the override after removal.legacy_mul_forms_are_exacttest was excluded from the workspace retry. Both timed gameplay runs logged a Rust TLS teardown panic after reaching their limits.Please review the NVAPI profile ownership and cleanup checks. If #4 reproduces on your NVIDIA system, please test a matched default-profile run and a
one-gibortwo-gibrun. Include the GPU, driver, time to removal or test duration, and whetherremoverestored the original setting.Checklist
main.docs/asset-policy.md.Checked for overlap
apps/darner/src/main.rs.Tested on an RTX 4090:
install one-gibholds for 38.9 min (control lost after 2 min 7 s);removenot testedA matched pair as asked, on the 1 GiB value the description lists as a coverage gap. Built from
e6e599e(cargo build --release --locked -p darner, version linev2026.12.03.01-23), copied beside the title asdarner.pr164-e6e599e.exe. Same exe, save and area for both runs: Series X, 1440p, DLSS Quality, DLSS frame generation x2, HDR, hardware RT, no test switches.System: Intel Core i9-13900K · 32 GB DDR5-6400 (2 sticks) · NVIDIA GeForce RTX 4090 24 GB, driver 621.40 · Windows 11 Pro build 26300
statusbefore the runNVAPI exposes no shader-heap override (the measured D3D12 driver default is 512 MiB)0x887A0005) after 2 min 7 s; a pipeline first bound 2 ms before; nonvlddmkmeventinstall one-gibNVIDIA shader heap 1024 MiB from the application profilemade=1644); the second start was quick.The commands
install one-gibfrom an elevated PowerShell in the exe's folder (path shortened by me):statusright after, and again from a terminal without administrator rights after the run, gave the same 1024 MiB line.Next to a profile made by hand. This PC already had a profile "Darner" made with NVIDIA Profile Inspector (
0x001ABC0F=0x80000000) that lists other exe names, from my runs in #4. The install left it alone.status, run from copies of this build under three names in the same folder, without administrator rights:statusdarner.pr164-e6e599e.exeSo
statusalso reads a profile the command does not manage, and it answers by exe. That makes it a quick check for anyone who set the value with Profile Inspector and wants to know whether the driver picks it up for the exe they start; a profile attached to the wrong exe name, as reported in #84 (comment), would show here as "no shader-heap override".Not tested:
remove(the profile is still installed here),two-gibthrough this command, andinstallrun for an exe name that a foreign profile already lists.Seen in the long run, probably unrelated: driving very fast on the highway, other cars showed as low-detail models and disappeared before a collision. I have not checked whether the release exe does the same, so I am not attributing it to this change.
Log reading and this write-up were done with AI assistance.
That's a strong result. Driver default (512 MiB) lost the device after 2 min 7 s at 2,482 pipelines; 1024 MiB ran 38 min 51 s with no loss at 3,819 pipelines. Together with the 4070 Ti SUPER run, it ties the hardware RT device losses to the driver's shader heap filling up.
Main already has the same lever since
86c393e8:darner nv-profile(default 2048 MiB,--mb 1024,--status,--remove,--exefor a renamed exe). Rather than carry two installers, the plan is to keep that command and take over what this PR does better: the full-path binding and the checks after install.One run that would help: the same save and area on the 4090 with
darner.exe nv-profilefrom current main (administrator prompt, thendarner.exe nv-profile --statusto confirm 2048 MiB). If 2 GiB also holds for 30+ minutes, that's the value players get pointed to.@TrustNo1 wrote in #164 (comment):
Working on this now.
@TrustNo1 the run you asked for:
nv-profilefrom current main at 2048 MiB held for 42 min 36 s on the 4090, no device loss.Built from main
a361afe(cargo build --release --locked -p darner, version linev2026.12.03.01-80), copied beside the title asdarner.main-a361afe.exe. Same save and area as the two #164 runs above: Series X, 1440p, DLSS Quality, DLSS frame generation x2, HDR, hardware RT, no test switches.System: Intel Core i9-13900K · 32 GB DDR5-6400 (2 sticks) · NVIDIA GeForce RTX 4090 24 GB, driver 621.40 · Windows 11 Pro build 26300
0x887A0005) after 2 min 7 sinstall one-gib(above)nv-profileCommand:
darner.main-a361afe.exe nv-profilefrom an administrator prompt, no arguments. It made its own profile for the renamed exe without--exe.Status, read before the run and again after it:
The first line is my hand-made Profile Inspector profile from the earlier runs on #4, which
nv-profileleft alone; the second is the one the command made, and the one this run used.Pipelines: 3,969 is the highest count I have reached on this PC, about 1,500 past where the default heap lost the device in the control.
Memory: committed peaked at 41,190 MB; the card's own peaked at 20,292 MB.
Frame rate (base, by quarter of the session): 37, 30, 32, 23 fps average. It falls as the session goes on, as in my earlier long runs with either heap size.
Log:
0x887A0005does not appear; the session ends withhost pipeline library saved … made=2385 loaded=5029.Not tested:
--mb 1024,--remove, and--exe. One run, one PC.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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.