gpu: isolate AMD driver compiler crashes (crashed.txt) and skip self-CopyResource #2
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2"
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?
Imported from DexNom/VIctory. Originally posted by jmal423 on 2026-11-25T15:34:59Z.
Enables
DexNom/VIctoryto boot and run on AMD RDNA4 (tested on Windows 11 / AMD Radeon RX 9070 XT, Series X target) without crashing insideamdxc64.dll:crashed.txt): installs a Vectored Exception Handler aroundCreate*PipelineStateinpipeline::librarythat logs the failing pipeline hash, records it incrashed.txt(skipped on subsequent runs), and parks the faulting worker thread instead of crashing the process.library::LOSTand spawns replacement workers inpipeline::make::startso the pipeline worker pool never starves (preventing 12s/frame stalls when multiple PSOs fault in one session).CopyResource: skipsCopyResourcewhento == from(same host texture).Tested on Windows 11 / AMD Radeon RX 9070 XT:
amdxc64.dll+0x861b9f(0xc0000005, read0x8).crashed.txtand ran in-game (both raster and experimental RT at1.3-1.5 fps/687-777 ms/framein the prison scene).Imported from DexNom/VIctory. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-25T15:35:08Z.
Review: COMMENTED
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.
Imported from DexNom/VIctory. Originally posted by DiegoStefanini on 2026-11-25T15:45:55Z.
Thanks for this! I merged it locally on top of current
main(921d8d3), together with #1: no conflicts, clippy clean with and without--all-features, and the whole workspace test suite passes (623 passed, 0 failed) on an RTX 4060 Laptop. As expected it changes nothing on NVIDIA, since no driver crash happens there.Two things I noticed while reading it:
WAITINGnever comes back down after a parked worker. The worker that faults never returns fromnext().make(), so theWAITING.fetch_sub(1, …)in the worker loop never runs for that pipeline. After the first isolated crash,WAITINGstays one too high for the rest of the session:drained()no longer fires (no "host pipelines all made" log, no library save on drain), and the pending count on the frame line stays above zero. DecrementingWAITINGincompiler_crashed(next toLOST.fetch_add) before parking would keep the count right. The replacement worker then takes over the queue as it does now.Parking the thread inside the driver. The handler stops the faulting thread in the middle of
Create*PipelineState, so whatever the driver's compiler held at that moment (an internal lock, for instance) stays held for good. If anotherCreate*PipelineStateon a replacement worker needs the same lock, that worker blocks too, and so on. It evidently didn't happen in your RDNA4 run, so this may be fine in practice. Still, a short note in the doc comment would help, and so would a log line when a replacement worker starts, so a stall like that is easy to recognise later.Nothing else from me. The self-
CopyResourceskip and thespawn_workerrefactor look good.Imported from DexNom/VIctory. Originally posted by itsonewi on 2026-11-25T16:12:18Z.
Review: COMMENTED
probe from review endpoint
Imported from DexNom/VIctory. Originally posted by itsonewi on 2026-11-25T16:13:47Z.
Review: COMMENTED
Part 1 of a review of this patch against
main(split up because the API kept failing on the long version).The crashed name is never refused within the same run, so one broken pipeline crashes, parks and replaces in a loop.
crashed()readscrashed.txtonce into aOnceLock<HashSet<String>>;note_crashed()only appends to the file and never touches that set. So in the run where the fault happens,crashed(name)isfalsefor the rest of the run. A title that binds the same broken material pipeline every frame then repeats this:pipeline()-> not crashed ->create()-> the driver faults -> the VEH parks this worker andLOST += 1; the nextmake::startspawns a replacement that pops the next job, not the lost one; the next request for that name arrives and the cycle runs again.Cost per attempt: one access violation, one log line, one permanently parked thread, one new thread. Unbounded over a session.
Fix: record the name in memory on the crash path as well (a
Mutex<HashSet<String>>seeded once from the file, or a secondOnceLock<Mutex<HashSet>>), so the second request in the same run returnsErrimmediately.This is also the fix for the stall the description targets: the parked thread never sets
madeorleft_outon thePendingit popped, so every frame that needs that pipeline waits itswait_budget(12 s per kind by default,pipeline/make.rs) for something that can no longer be made.AI use: read the patch and
crates/victory-gpu/src/pipeline/{make,library}.rsonmainvia the GitHub API; nothing built or run.Imported from DexNom/VIctory. Originally posted by itsonewi on 2026-11-25T16:14:11Z.
Review: COMMENTED
Part 2 of the review (the rest, and one invariant worth writing down).
A parked thread leaves its
Callentry behind.call()inlibrary.rspushes(thread, what, name, since)and removes it inDrop; a parked thread never drops it, soremoval_note()reportsmake <pipeline>as a call running now for the rest of the run — which is exactly the report that diagnostic exists for.crashed.txtnever expires, and the README does not mention it. After a driver update that fixes the compiler the pipeline stays refused forever, and the only way out is finding and editing an undocumented file. A driver version or a date on the line, or one sentence in the README's known-issues list, would make it recoverable.Confirmed on purpose, so that a later edit does not break it by accident:
AddVectoredExceptionHandler(1, ...)returning0for exceptions that are not ours, theExceptionInformation[1] >= 0x10000filter, and the parking itself are free of the runtime's locks becausecreate()runs outside them (// Compiled outside any lock),call()/one_call()/same_name()are scoped before it, andPending::makecompiles insideHostPipeline::newbefore touchingDONE. That invariant deserves a line next toMaking::new: moving any lock acrosscreate()would turn a parked thread into a deadlock that the replacement workers cannot repair.Nothing here was built or run; this is from the patch and
main.AI use: read the patch and
crates/victory-gpu/src/pipeline/{make,library}.rsonmainvia the GitHub API; nothing built or run.Imported from DexNom/VIctory. Originally posted by manoel0810 on 2026-11-25T16:29:33Z.
Estava corrigindo exatamente isso! Estou testando aqui.
Imported from DexNom/VIctory. Originally posted by jmal423 on 2026-11-25T17:22:19Z.
Thanks for the thorough review @itsonewi! Updated the PR to address this:
OnceLock<HashSet<String>>withOnceLock<Mutex<HashSet<String>>>(crashed_set()), andnote_crashed()now inserts into it in-memory viatry_lock()as well as appending tocrashed.txt, so repeated requests for a broken pipeline in the same run returnErrimmediately without re-faulting or parking more threads.Making::newso future edits don't move any runtime lock acrosscreate().Imported from DexNom/VIctory. Originally posted by andrewDoing on 2026-11-27T00:24:21Z.
I checked the follow-up's same-run blacklist update at
13bad93and found a contention case. Using the exactcrashed_set,note_crashed, andcrashedfunctions on Windows, one thread held the set lock while a second callednote_crashed("contended"). The name was present on disk, but after the lock was releasedcrashed("contended")returned false for the remainder of that process. An uncontended control returned true; a second process reloading the same file returned true forcontended.The
try_lockfailure appears to lose in-memory registration for the session; an ordinary concurrentcrashed()lookup can hold that lock. Deferring failed registration for reconciliation outside the exception path, or documenting same-run updates as best effort, may be worth considering. No driver fault was induced and this makes no AMD-specific claim.Verification was AI-assisted with GPT-6.2 Astra.
Pull request closed