Crashen when injury happening (player or npc's) on amd 6000 cards #40
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/iceboerg00--larp-amd#40
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@jessejoeyjames on GitHub · 2026-12-05 22:55 UTC · original
Build
v2026.12.05-amd-4.1
Graphics card and driver
Rx 6800 newest driver Adrenalin
CPU, RAM, Windows version
Ryzen 5900x Windows 11
Console
None
What happens
rx6800-crash-logs.zip
Title: RX 6800 (RDNA 2): device removed on damage/death effects — RGD shows compute shader sampling a texture through a stale heap descriptor
System
f6954fc) = same code as amd-4.2 (257438a, only CHANGELOG differs), built from source. Series X, 60 fps cap, no frame generation,LARP_D3D12_DRED=1.What happens
After test build 3 the crash right after entering the world is gone (thanks!), but the game still ends with device removed (0x887A0005, sometimes 0x887A0006) after 1–5 minutes, always at a damage/death moment:
Long fist fights with blood on the player did not crash; light car or player damage did not crash either. Other RX 6000 players report the same (taser hit, Donny mission, shooting; RX 6700 XT exit -2005270523).
Radeon GPU Detective capture (attached
rgd-crash-analysis.txt)0x1c1de7000, no resource associated with that VA.0x5520e2c2cb0b8567, DXIL hashb818455565b02003ac4b6d3a80763305, small dispatches (3/2/1/1 groups).image_sample_lz v47, [v48, v46], s[84:91], s[32:35] dmask:0x8 dim:2D→ the image descriptor points to unmapped memory.rgd --all-disassembly): The index is scalar (one constant-buffer load), so lanes can only differ between "that index" and 0:heap_first_lanedoes not pick a different texture here. Conclusion: the descriptor in that heap slot points to texture memory that is gone, i.e. a descriptor/texture lifetime problem (texture freed, moved or re-placed while the slot still names its old address), triggered by the damage/death effects.shaders/05/91fc62…,shaders/90/78d9a4…); an RX 6600 XT tester found the same hash in their cache independently.Already ruled out on this card (each still crashed the same way, fault always in larp's own VA range, DRED finds no live or recently freed allocation)
LARP_GPU_TIMING=1), 14 fps instead of 17.6 — still crashesLARP_RT_WHOLE=1(no tiled/reserved buffers) — crashed after 44 squad_liveoff (amd-4) — crashed soonerLARP_SKIP_PIPELINESover 7 runs — still crashes (skipping mesh0a2ea81ca59d6510= car paint stopped the NPC-kill crash once, but car impacts and dying still crashed)Attached logs (paths/PC name redacted)
larp-log-test3-first-crash.log— first test3 crash; DRED stopped inside ExecuteIndirect[mesh 0a2ea81ca59d6510, pixel 19acd330dacc8f32], command 1322/2285larp-log-relay-off-crash.log— relay offlarp-log-car-impact-crash.log— car impact, 0a2ea81c skippedlarp-log-rgd-capture-run.log— the run the RGD capture belongs torgd-crash-analysis.txt— RGD 1.6.3 text analysis (raw .rgd, 310 MB, available on request)Next on our side: a diagnostics build with
LARP_HEAP_CHECK=1to see whether the card's heap differs from what the title wrote at the crash. Happy to test any build with a switch for this; the crash is reproducible within a few minutes.options.ini
logs\play.log
rx6800-crash-logs.zip
@jessejoeyjames on GitHub · 2026-12-05 23:23 UTC · original
Update: more data, and a correction
Correction: if you read the first version of this issue, the heap_first_lane guess was wrong. The full RGD disassembly shows the texture index comes from one scalar constant-buffer load (s_buffer_load_dword), clamped to 0x9423e, then v_cndmask (index or 0) → v_readfirstlane → s_load_dwordx8 from the view heap → image_sample_lz faults. Lanes can't pick different slots there, so first-lane is not the cause. The descriptor in that heap slot is stale.
Second RGD capture: the same compute shader (PSO 0x5520e2c2cb0b8567) faulted again, this time on several VAs at once (0x1f3409000, 0x349749000…0x3497ea000) and on buffer descriptors too (buffer_load via s[40:43], s_buffer_load via s[56:59]). So everything this dispatch reads through its descriptors points to freed memory.
Diagnostics build with LARP_HEAP_CHECK=1 (same test3 code):
At every flip ~24–29 KB of the fed graphics heap differ from what went up, in ~490–500 pages of 4 KiB, all "elsewhere in the heap" (none in the card's own ranges, none in the transient pool).
At list submissions ~105 ranges (~1.8 MB) per frame of what binds read differ from what went up.
The differing bytes are mostly the first two bytes of 32-byte slots, card copy 00 00 vs a value in title memory, e.g. 0x40450120 00>16, 0x40450121 00>1a, 0x404503f0 a8>0e, 0x40450d50 70>fd, 0x40450f30 00>22, 0x404511d0 00>fb. Descriptors (re)written by the title without an announcement the feed catches, so the card keeps the old or empty descriptor.
At ~3 fps NPC kills did not crash, but dying still crashed instantly: timing-dependent, as expected for late or unannounced writes.
Background from Xbox Series research:
The title's descriptor heap is a reused ring: 32-byte slots, a buffer descriptor uses only 16, and old data stays because the ring isn't cleared. Missing one rewrite means the GPU reads the slot's previous occupant.
On the console, CPU writes become GPU-visible at ExecuteCommandLists, not earlier. A title can write descriptors after recording a list, right up to submission. Writes after (or without) an announcement never reach the card here.
The fault VAs (about 6.5–13 GB) lie in the console's ordinary graphics range (4–159 GB), and larp reports "no title memory copy below it": most likely old or untranslated title addresses.
Frame heaps 4 and 5 are written by the GPU itself; if some descriptors come from a compute pass, the CPU side never sees them.
Updated logs zip attached (heap-check run included; PC name and paths redacted). Happy to test any build with a switch for this.
@jessejoeyjames on GitHub · 2026-12-05 23:32 UTC · original
Tried a local fix, negative result: a switch that, before each submission, re-sends every write-watched fed-heap page the title wrote since the last look (watch::writes, transient pool and card-own ranges skipped). It ran at ~22 fps but still crashed instantly on an NPC car hit, and it introduced tree flickering (presumably pages sent mid-rewrite). So unannounced CPU writes alone don't explain the fault; remaining suspects are GPU-written descriptors (frame heaps 4/5) or a title address that never gets a host copy.
Updated logs zip attached (heap-check run included; PC name and paths redacted). Happy to test any build with a switch for this.
@jessejoeyjames on GitHub · 2026-12-05 23:45 UTC · original
Confirmed workaround (RX 6800): the faulting shader (DXIL b818455565b02003ac4b6d3a80763305) is larp's compute shader 3e28ebd6128bd351 (matched by an RX 6700 XT tester via LARP_SHADER_SAVE). With LARP_LEAVE_OUT=3e28ebd6128bd351 the player death ("Wasted"), which crashed instantly every time before, plays through without a crash on our RX 6800 (~17 fps, nothing obviously missing). Please consider skipping it by default on AMD RDNA 2, like the glass prepass cad3ecfdcdcf2a7d, with a switch to keep it.
@jessejoeyjames on GitHub · 2026-12-05 23:47 UTC · original
What it does for certain (from the full instruction list in the RGD dump):
It's a small compute shader: per frame a handful of dispatches of 1 to ~30 groups. So it handles a small number of items, not the whole screen.
It reads a lot of parameters (115 constant reads), including the table positions of its textures.
It samples about 10 2D textures, each a single channel (8× red, 2× alpha) and always at full resolution without mip levels (sample_lz). Those are masks or lookup maps, not colour textures.
It reads some per-item data from buffers, and writes its results to a buffer (3 stores), not to an image. So it draws nothing itself: it computes values that another pass uses later.
What it probably is: a "damage/hit" calculation per character or vehicle. At a hit, a death or a car impact it looks up values in mask textures (for example where a body or car part is damaged, or how strongly an effect applies) and passes them on as parameters for drawing. That fits:
when it runs: car impacts, NPCs hit or killed, your own death, and certain cutscenes;
the small number of items: only the characters and cars involved;
why you miss nothing visible: blood and damage are drawn by other shaders. At most some secondary refinement of the effect drops out.
But the game contains no names, so "damage effect" is a well-founded guess, not a certainty.
Why it crashes: one of the texture slots it reads sometimes holds a view that isn't a valid texture. The other player's guess is a buffer view, or another kind of view, read as a texture. On the Xbox that just gives junk values; on an RX 6000 the card reads a non-existent address and crashes. Newer cards apparently tolerate it better. The proper fix (check the view type, or substitute a null texture) is iceboerg's job, and our issue gives him the exact shader.
@Triple3jcode on GitHub · 2026-12-05 23:57 UTC · original
The shader reads a table position from the game's data and samples whatever sits there as a texture.
Sometimes the game has put something else in that slot, probably a buffer view (a different descriptor type).
On the Xbox that's harmless: the hardware reads the bytes as if they were a texture, comes up with an address, and that address happens to be in memory the game owns. You get junk values, which the game apparently doesn't care about.
On the PC larp has put a real D3D12 buffer view in that slot. On an RX 6000 its bytes, read as a texture, give an address that doesn't exist, and the card crashes. RX 7000/9000 use a different descriptor layout and apparently cope with it.
What a real fix looks like (larp code, so iceboerg's area):
Keep a slot-type table. larp already tracks per slot what it puts there ("as a buffer view", "as a texture"); a diagnostics feature uses that. It could also keep a small bit table on the card: 1 bit per slot, "is a texture".
Make the shader check it. larp's translator already has per-shader rules (by_hash/rules.rs). A rule for this shader could make each texture read first check that bit, and use a null texture when the slot isn't one. A null texture safely reads 0, which is close to the Xbox's "junk, but no crash".
Then the shader runs and does its job, except for exactly those wrong slots.
Toward a real fix (suggestion): skipping the shader is only a workaround. Likely mechanism: the shader samples a heap slot as Texture2D that sometimes holds another view type (probably a buffer view). On the console the V# bytes read as a T# just give junk from memory the title owns; on the PC the slot holds a real D3D12 buffer view, whose bytes read as an image descriptor on RDNA 2 give an unmapped address. Possible fix: larp already tracks what it writes per slot (shows::wrote, "as a buffer view" / texture); keep a GPU-visible bit per slot ("is a texture") and add a by_hash rule for 3e28ebd6128bd351 that checks it before each sample and uses a null texture otherwise (reads 0, close to the console's harmless junk). Worth confirming first with a diagnostics build: which view kind larp last wrote into the faulting slot.