Device-removal bisect switches, Agility SDK fallback, safer stack walks and watchdog tools (ported from VIctory-NVIDIA) #77
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!77
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-77"
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?
@kadiratesdev on GitHub · 2026-12-05 17:32 UTC · original
kadiratesdev:pr/victory-hardening→main· +593 −18 · 15 files · 10 commits · closed without mergingSeveral users hit
exit -2005270523(DXGI_ERROR_DEVICE_REMOVED) minutes into play on NVIDIA, e.g. #42 (idling at Bar 919, <10 min) and an RTX 3080 Ti here, with the log readingno breadcrumbs (... 0x887A0004); device removed: ... (0x887A0005).I have not found the root cause yet. This PR does not claim to fix it. It makes the crash bisectable from a user's machine, fixes a misleading line in the report, and ports some robustness pieces from VIctory-NVIDIA. Everything that changes behaviour is opt-in, except the d3d12.dll delay-load and the stack-walk hardening.
Diagnosis aids
LARP_D3D12_DRED,GetAutoBreadcrumbsOutputreturns DXGI_ERROR_UNSUPPORTED (0x887A0004). That read like the removal's reason, but it is not. The report now says breadcrumbs are off and names the switch. The reason is the 0x887A0005 that follows it.LARP_BYTE_VIEWS=0: every buffer SRV is made by element (CreateShaderResourceView) instead ofID3D12Device15::TryCreateShaderResourceViewbyte-offset views.LARP_AGILITY=0: runs on Windows' own D3D12 runtime instead of the bundled 1.620.D3D12SDKVersionis now writable, andagility::choosesets it first thing inmain.build.rsdelay-loadsd3d12.dllso Windows reads the value set there. As side effects:D3D12\folder falls back to the system runtime instead of failing to make a device;D3D12Core.dllof another version is asked for by its own version, instead of 0x887E0003.Ported from VIctory-NVIDIA 0f0ada19 and e69e39c5.
LARP_SHADER_REPLACE=0: runs with no replacement shaders. Before, the only way was to move the folder, and a missing folder stopslarp run.TdrLevel/TdrDelay/TdrDdiDelay) are logged when the device is made, with a warning for level 0 or 1. Ported from VIctory-NVIDIA 474f949c, tests included.exit -2005270523. Order: DRED first, then each switch alone.Robustness
LARP_STACKSwalked each suspended thread's live stack, andRtlVirtualUnwindcan fault reading through a stale frame register or uncommitted stack pages. In VIctory-NVIDIA that ended the process (43e89ba1). Now:frames_ofcopies the stack withReadProcessMemorywhile the thread is suspended and unwinds the copy;LARP_STACKS_AT_KILL=1: on the title watchdog's write to address 0 (+0x23cf683), dumps every thread's stack to show what the frame loop was stuck in. Ported from VIctory-NVIDIA c6d5c4d7.LARP_TITLE_WATCHDOG=0: sets the watchdog's quit flag (bit 0 at title+0x71b6340), only on 1.0.2.1 and only when the trap bytes match. A 30 s stall outside the pipeline waits that larp already feeds is then not ended as a crash. Opt-in, because a real hang then stays a hang. Ported from VIctory-NVIDIA aee4c45a.Not ported, and why
cardmem/texheap/mipsrewrite has no small-copy regrowth orroom()path to guard. It already aims under budget minus max(budget/16, 256 MB).FOLD_FORCE_MS(930f25ce). larp has no equivalent of VIctory's submit line (queue/behind.rs).HELD_FRAME_MS(62ddb99d). It conflicts with larp's deliberate "wait for every pipeline while feeding the heartbeat" on 1.0.2.1.Testing
84f8870).cargo test --workspace --releaseunder Wine:larp-game prompts::font::...within_its_advance, which needs a host font Wine lacks.LARP_D3D12_DRED=1: the device was removed again after ~19 min, and the DRED report now lands in the log. I will post the analysis and the switch results here.@copilot-pull-request-reviewer[bot] on GitHub · 2026-12-05 17:32 UTC · original · reviewed
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
@Proudnoob4 on GitHub · 2026-12-05 18:29 UTC · original
Data for the
exit -2005270523hunt from an RTX 4080 / i5-13600K / 32 GB / Windows 10 19045, Series X,DLSS, no frame generation:
1. The NVIDIA shader heap
0x001ABC0F = 0x40000000(1024 MiB, the valuelarp nv-profile --mb 1024sets): 4 removals in 4 runs without it, then a 47-minute run with no removal.
0 settings. I read the driver DRS through NVAPI (
NvAPI_DRS_FindApplicationByName+NvAPI_DRS_GetSetting) to see it; writing it back needs admin (NvAPI_DRS_SetSettingreturns-137 otherwise). People reporting "the fix did not work" may never have had it applied.
nvapi_interface.h) can beshared if useful.
larp.exe(profile) vs another name:QueryVideoMemoryInfolocal usage 0.009 GB both) and no commit charge;MaxGPUVirtualAddressBitsPerProcess40, and 768 GB reservablewith
CreateReservedResourceeither way.0x887A0020(DRIVER_INTERNAL_ERROR), not the
0x887A0005larp reports. So it is not plain GPU VA exhaustion.This fits the shader-heap reading: the heap fills as new pipelines are made, and this title makes
95k+ of them.
2. The watchdog end at 30 s.
0xc0000005(write 0x0) at title+0x2215c35, from a threadthat starts at +0x2215ea0, 32 s after frames stopped.
LARP_STALL_S=8gets the every-thread dump (at 3x = 24 s) before the watchdog fires.3. Memory on a 32 GB PC.
This PR merges cleanly onto main (
0f03265) together with #76. We carry it, with the shader heap set,in https://github.com/Proudnoob4/larp and will report the switch and DRED results from this machine.
@kadiratesdev on GitHub · 2026-12-05 18:39 UTC · original
Thanks a lot for the detailed data, this matches what we saw here. Our DRED capture of the removal had empty breadcrumbs and no page fault, which pointed outside larp's command lists, and the shader heap was our main suspect.
On our side (RTX 3080 Ti 12 GB, Windows 11) we applied the heap with
larp nv-profile --mb 2048from an admin shell; its output reported the setting written forlarp.exe. Note that the profile matches by exe name, so a renamed build needs its own--exe. We'll post the long-run result once we have it.The check/apply script you mention would be useful, especially since a profile can be saved with 0 settings and look applied. Also good to know about the +0x2215c35 watchdog end and the memory pressure on 32 GB; we'll try
LARP_STALL_S=8if we hit a stall.@kadiratesdev on GitHub · 2026-12-05 18:41 UTC · original
Interim result from the RTX 3080 Ti 12 GB / Windows 11 machine, Series S profile, DLSS:
LARP_HOST_NAMEchange from #87) has been running for 41+ minutes with no device removal so far; the session is still going. Before, the same machine removed the device (0x887A0005, empty DRED breadcrumbs) at about 19 minutes.nv-profile --mb 2048was applied forlarp.exeandlarp-pr.exe. This run used a renamed exe (larp-tr.exe), and I haven't confirmed the profile covers that name, so take the heap part of this result with that caveat.I'll post the final length and how the session ended once it's over.
@gamingwithhomie on GitHub · 2026-12-05 18:50 UTC · original
Reviewed in detail - the opt-in bisect switches (
LARP_BYTE_VIEWS=0,LARP_SHADER_REPLACE=0), TDR registry log, and DRED-message fix are all excellent and close to zero-risk.Holding merge as a single PR because it also bundles always-on changes to how every Windows user loads D3D12:
d3d12.dlldelay-load (apps/larp/build.rs), theD3D12SDKVersionexport changing toAtomicU32, andagility::choose()silently falling back to the OS runtime when the bundledD3D12Core.dllis missing/mismatched (today thats a loud0x887E0003failure). If that loader assumption is wrong, the failure mode is 'game doesnt start at all' for everyone, and no unit test can cover it.Please split into:
choose()+ Agility fallback (merge after a built-binary startup smoke test),LARP_BYTE_VIEWS=0,LARP_SHADER_REPLACE=0, docs (ready to merge freely),LARP_STACKS_AT_KILL,LARP_TITLE_WATCHDOG(merge after aLARP_STACKSstall-dump sanity run).Happy to merge (b) immediately as its own PR. Thank you!
@Proudnoob4 on GitHub · 2026-12-05 18:54 UTC · original
Built-binary startup smoke test for the (a) part (delay-load,
agility::choose, fallback).Setup: Windows 10 19045, RTX 4080, game driver profile with the 1024 MiB shader heap. Build: main
0f03265+ this PR, release, MSVC, built on the machine itself.bin\D3D12\D3D12Core.dll1.620.2.0 besidelarp.exe, the normal layout):choose()printed nothing, which is the path that keeps the bundled runtime (agility.rs:51speaks only on a fallback).level=default delay=default ddi_delay=default.D3D12\folder (the build run fromtarget\release):larp.exe --helpprintedD3D12 runtime: asking Windows for SDK version 4 (no D3D12\D3D12Core.dll beside larp.exe)and ran.For (c):
LARP_STALL_S=8printed one warning during the loading screen (no frame begun for 8 s (frame 2)). The 3x dump did not fire because frames began before 24 s. So no stall dump has been exercised yet. We'll post one if we hit a freeze.On the "saved with 0 settings" trap:
larp nv-profilewith no arguments already reads the driver's value back forlarp.exe. Here it printsprofile "cnf", shader heap 1024 MiB (0x40000000). That is the check we'd suggest people run after Profile Inspector, so our separate script isn't needed.@kadiratesdev on GitHub · 2026-12-05 19:02 UTC · original
Final result of that session (RTX 3080 Ti 12 GB, Windows 11, Series S profile, DLSS):
title: suspending (window closed)), not a crash. Before, the same machine removed the device at about 19 minutes.larp_gpu::regions"window of title memory ... over a buffer the GPU owns" errors were logged around the 13-14 minute mark, with no visible effect.larp.exeandlarp-pr.exe, and this run used the renamedlarp-tr.exe, which I haven't confirmed the profile covers.@kadiratesdev on GitHub · 2026-12-05 19:17 UTC · original
Part (b) of the split is now up as #126 (TDR log, DRED message fix, LARP_BYTE_VIEWS=0, LARP_SHADER_REPLACE=0, docs). Parts (a) (d3d12.dll delay-load / Agility fallback) and (c) (stack-copy rewrite, LARP_STACKS_AT_KILL, LARP_TITLE_WATCHDOG) will follow as separate PRs after the built-binary startup smoke test and the LARP_STACKS stall-dump run you asked for.
@kadiratesdev on GitHub · 2026-12-05 19:31 UTC · original
Parts (a) and (c) of the split are now up:
The built-binary startup smoke test for (a) and the LARP_STACKS stall-dump run for (c) are in progress; results will be posted on those PRs. #77 stays open.
@kadiratesdev on GitHub · 2026-12-06 00:03 UTC · original
Closing this as superseded by the split you asked for: (b) #126 (merged), (a) #139 and (c) #140, which now have their smoke-test results posted. Thanks for the review.
Pull request closed