Linux + NVIDIA: world load fails right after the 4th mid-list Wait-after-Write64 split (vkQueueSubmit2 AV / device lost / stuck fence) #916
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl#916
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?
@oeirughrepuiohg on GitHub · 2026-11-24 08:12 UTC · original
Linux (Wine + vkd3d-proton) + NVIDIA: every world load fails right after the 4th "split command list around mid-list Wait after Write64"
Setup: RTX 4070 Ti 12 GB (620.70.06), Fedora 45 kernel 7.3, GE-Proton11-14 Wine, vkd3d-proton
cae8353e+scripts/linux/vkd3d-proton-xcl.patch(-Db_ndebug=true),VKD3D_CONFIG=ignore_shared_fence. Settings:XCL_PAGE_BUDGET_MB=4096(#640),XCL_PSO_WAIT_MS=50(#891),XCL_BIG_COMPILES=1,XCL_COHERENT_MB=1024; the title's stall watchdog disarmed locally so the runs do not end on it.In three back-to-back runs that reach the world load (menus and loading at ~28-30 fps), the log shows exactly four
split command list (type 2) around mid-list Wait after Write64 (#1..#4)(the #797 path), and what goes wrong starts after#4every time. (Correction: the log prints splits #1-#4 and then only powers of two, so "after #4" means after the 4th split and before an 8th; no run reached #8, so the failure comes within splits 5-7 or right after #4.)main1ec4c98+ #793 #820 #759 #640 #889 #891 #826err:vulkan:vkQueueSubmit2 Exception 0xc0000005 in Unix call, process endsmain09940bb+ same set1 allocator resets so far with recordings still held or on the GPU – another PC allocator took …, thenvkWaitSemaphores failed, vr -4(device lost)sparse: the queue has not reached fence value N after 5 s (at N-2), frames stop (0 fps), no device lossAround them:
Wait64BitValueX … bridged to GPU queue.Wait (… wait-before-signal, after_write64=false)on several queues waiting on one producer queue. Video memory is ~11.9 of 12.3 GB at that point (page budget active), host RAM fine.So on vkd3d-proton the mid-list split around a Write64→Wait seems to leave either a list or an allocator in use after it is handed back, or a wait the producer never signals. #708 looks aimed at the same area but does not merge with current
main. Next I am running the same route withXCL_SPLIT_MIDLIST_WAIT=0and will add the result here.AI-assisted (Claude Code). No game data attached.
@oeirughrepuiohg on GitHub · 2026-11-24 08:15 UTC · original
Result with
XCL_SPLIT_MIDLIST_WAIT=0(run 2 build + #541, same route and settings): no splits are logged, and the world load still ends in device loss (d3d12_command_queue_execute: Failed to submit queue(s), vr -4) at about the same point. So the split is not the cause on its own; it most likely only happens to sit next to whatever faults the GPU in the first world frames. I will try vkd3d-proton breadcrumbs next to find the faulting command.AI-assisted (Claude Code).
@oeirughrepuiohg on GitHub · 2026-11-24 08:20 UTC · original
Narrowed down: the world-load failures here are GPU MMU faults in shader code, not the split. Kernel log during each device loss (runs with and without
XCL_SPLIT_MIDLIST_WAIT=0, withVKD3D_CONFIG=breadcrumbsand=fault):NVRM: Xid 13 … Graphics SM Warp Exception: MMU Fault(22 warps in the last run), plus onceIllegal Instruction Encoding. vkd3d-proton reports no fault address under Wine (VK_EXT_device_faultinfo does not come through), and breadcrumbs print nothing with an-Db_ndebug=truebuild.This looks like the same class as VIctory #542 (Marvisak/VIctory): there, under Wine + vkd3d-proton on NVIDIA, every world run lost the device with Xid 13, and the fault address was a title buffer plus exactly
0x1_0000_0000– 32-bit offset arithmetic in translated buffer loads/stores wrapping past 4 GiB. Their fix bounds raw/structured/typed buffer offsets below 2 GiB in the translated shaders. If XCL's translated buffer accesses compute offsets in 32 bits the same way, the same bound may apply. Happy to test a build.AI-assisted (Claude Code). No game data attached.
@oeirughrepuiohg on GitHub · 2026-11-24 13:00 UTC · original
Correction to my comments above: neither the mid-list split nor a 32-bit offset wrap is the cause. What I measured since, with breadcrumbs naming the program that runs during the stall, is in #505: https://github.com/ivall/xcl/issues/505#issuecomment-7132207920
AI use: Claude Code, Claude Opus 5.5 wrote this comment.
@Royalflamejlh on GitHub · 2026-11-24 14:51 UTC · original
Data from a second Linux + NVIDIA machine, on a 12 GB and a 16 GB card: the
vkQueueSubmit2exception came here on a tree frombeaa245and in none of 14 runs on09940bband later, and the stuck sparse fence came in 4 of 7 runs onmainwithXCL_PSO_WAIT_MS=50. The kernel logged no Xid in any of these runs.Setup: Fedora 44 (kernel 7.2.9), Wine 11.21 Staging, vkd3d-proton v3.1-90-g30b0eb9b with the relaxed-vtable patch from #175,
VKD3D_CONFIG=ignore_shared_fence, NVIDIA driver 615.71.09, RTX 4070 12 GB or RTX 4060 Ti 16 GB as marked. Title 1.0.2.1 from a saved profile (first-run screens done once), one A press throughXCL_PRESS_AT. No page budget, the watchdog left armed. Counts are of runs that reached the world load.The exception. Tree:
beaa245+ #684 + #533a966993+ #267043d1f7(both since closed), default preload. With #267's limit for a draw at 1 ms, 6 runs:err:vulkan:vkQueueSubmit2 Exception 0xc0000005 in Unix call: at 106.5 s on the 12 GB card and at 90.3 and 109.4 s on the 16 GB card, with 9.5 and 14.6 GB of video memory in use.winevulkan.dll; Wine's error channel was off, so the line itself is not shown.0x887a0005) and the watchdog, and one was ended by its 140 s limit.With both limits at their 4 s default: 0 of 4 (2 per card). With only #533's compute limit at 1 ms: 0 of 1.
On later trees, all on the 16 GB card and with
XCL_PSO_PRELOAD=0, it did not come in any of 14 runs:09940bb+ #684 + #533001e37d+ #751 withXCL_COMPUTE_PSO_WAIT_MS=1, which bounds draws too at that head (4 runs);47efa2e+ #684 withXCL_PSO_WAIT_MS=1(3);384f7f7or47efa2e+ #684, 4 of them with #751, #850, #851 and #906 as well, with 50 ms (7). All 14 still stopped presenting and ended at the title's watchdog (#662). Both the code and the preload setting differ from the runs that faulted; I have not separated them.The sparse fence.
sparse: the queue has not reached fence value N after 5 s (at N-2)repeated every 5 s to the end in 4 of the 7 runs at 50 ms and in 0 of the 3 at 1 ms. In the 3 of those 4 that have a thread dump, the thread that submits the title's command lists was insparse::State::upload_dirty.Not tested:
XCL_SPLIT_MIDLIST_WAIT=0; the page budget;VKD3D_CONFIG=breadcrumbs; the older tree withXCL_PSO_PRELOAD=0; native Windows; thecargo testsuite.AI use: Claude Code (Claude Fable 5.2) merged the pull requests locally, ran the title, read the logs and thread dumps and drafted this comment.
@tylerstraub on GitHub · 2026-11-24 23:23 UTC · original
Heads-up for Linux + NVIDIA runs on vkd3d-proton with dxil-spirv
53aac41: two tests of the lib suite that use 64-bit atomics time out the GPU (Xid 109, CTX SWITCH TIMEOUT) and remove the device, which then fails every later GPU test in the same process.Setup: as in my #505 comment (RTX 5090, NVIDIA 595.99.02, Ubuntu 26.04.1, Proton Experimental 11.0-20261112, tree
c4d37be+ #751 + #822 + #1435).gpu::dxil::ops_tests::raw_and_structured_buffer_atomics_runandgpu::recomp::tests::gpu_more_atomics_sub_dword_scratch_valu: fence still pending after 10 s, Xid 109 in the kernel log. Same result with 1 and 4 test threads.dx.op.atomicBinOp.i64) alone times out.53aac41both time out. Another local vkd3d-proton build, whose dxil-spirv revision I did not record, passes both tests on the same card and driver. The integrated Radeon (RADV) passes with the53aac41build.Not tested: which dxil-spirv change introduces it (I have one passing and one failing build, not a bisect), stock Proton vkd3d-proton, other NVIDIA drivers, Windows.
AI use: Claude Code (Claude Fable 5.2) ran the tests and the bisect on the machine above, and wrote and posted this comment at my request.
@oeirughrepuiohg on GitHub · 2026-11-24 23:47 UTC · original
Some data for narrowing this down offline, in case it saves a bisect.
A known-revision build to compare against: GE-Proton11-14's vkd3d-proton (
cae8353e) pins dxil-spirv34f0ff84(2026-11-20). Between it and53aac418there are only six commits, all structurizer traversal rewrites (5bb6460a,3d98ce0b,4fc48777,3007d9a8,e6cff0bb,e74ef38c); none touches atomics.Those six commits don't change 64-bit atomic code here. I built the dxil-spirv CLI at both revisions and converted every translated shader one Xbox title's cache holds (VIctory translations, 6,778 programs,
--bindless --ssbo-uav --ssbo-srv). 63 of them declareInt64Atomics, and all 63 come out byte-identical under34f0ff84and53aac418. That's real-world programs rather than your two test kernels, but it points away from the structurizer commits and towards something else that differs between your passing and failing builds (vkd3d-proton's options, or the driver: 595.99.02 there).Not the raw access chains, for the atomic itself: dxil-spirv emits 64-bit raw atomics through a plain
OpAccessChainon the storage buffer (emit_atomic_access_chain), notSPV_NV_raw_access_chains. The loads and stores around it in the same kernel do use raw access chains when the device offers them, soVKD3D_DISABLE_EXTENSIONS=VK_NV_raw_access_chainsis still a one-line check, but I wouldn't expect it to change the atomic.Not tested: your two kernels themselves, and running anything on the GPU with either revision. RTX 4070 Ti, NVIDIA 620.70.06 here.
AI use: Claude Code (Claude Opus 5.5) built and ran these comparisons on my machine and drafted this comment.
@humsterbumster on GitHub · 2026-11-25 02:57 UTC · original
Three world-load runs on a 32 GB card with the split workaround, and the two things that stop it here are not VRAM pressure.
Setup: RTX 5090 32 GB, NVIDIA 620.70.06, Arch/CachyOS kernel 7.3.5, Proton 11 (Wine 11.0), vkd3d-proton
4522cc1a8b1347f+(the patched build, from the startup+vkd3dline),VKD3D_CONFIG=ignore_shared_fence, XCLmainaa9ab8alocal release build,XCL_PSO_WAIT_MS=50,XCL_PSO_PRELOAD=0, retail title 1.0.2.1 with a saved first-run profile.XCL_PSO_DISK_CACHE=0+__GL_SHADER_DISK_CACHE=0had to be on or the run dies earlier with #2003 (vkCreateComputePipelines Exception 0xc0000005 in Unix call), so no driver blobs and a cold NVIDIA cache in all runs below.XCL_SPLIT_MIDLIST_WAIT=0unhandled exception 0xc0000005 in msvcrt.dll+0xa4c9 (write at address 0x8074f5c40)XCL_PAGE_BUDGET_MB=4096 XCL_COHERENT_MB=1024process ends with status 0x3at 200 s, stackwinevulkan.dll+0x12eb2 .. d3d12core.dll+0x4d7cb <- xcl.exe+0x1531daWINEDEBUG=err+allvkCreateComputePipelines Exception 0xc0000005 in Unix call) - Wine logging changes the timing enough to bring that one back, so the call name of the submit abort is still uncapturedRun 1 details, from the title's own crash report: game time 4m38s, frame 5520, 2227 streaming requests outstanding, tile heap 3296 of 6236 MB,
Current SRL State: Prestreamfor the story intro, and the fault is a 2 KiBmemcpy(rsi 0x15aaf7070, rcx/rdi 0x8074f5c40, rbx 0x800) into an address 2 GB above the 32 GiB boundary of this card. Video memory at the time: 12.7-12.9 GB local, 4.5 GB non-local, so not the 9.5-14.6 GB-limited case from the 12/16 GB reports - there is plenty of VRAM left here.Takeaways for the split theory: with the mid-list split turned off the split count is 0 in all three runs, and the submit-path abort still arrives during world-load streaming (run 2/3) - so on this tree the mid-list
Wait after Write64split is not the only trigger (and #2003 is timing-sensitive: the same build/settings that run clean at full speed abort invkCreateComputePipelineswhen Wine's logging slows the PSO threads down) of thewinevulkan/d3d12coreabort; a queue submit during the prestream dies on its own. The prestream itself runs (draws and dispatches go out, ~4 fps).AI-assisted (omp / DeepSeek V4.1 Flash 1017). No game data attached.
@pr1sm-dev on GitHub · 2026-11-25 19:32 UTC · original
On this machine the
vkQueueSubmit2"Exception 0xc0000005 in Unix call" at the world's first indirect mesh draws goes away withVKD3D_CONFIG=…,retain_psos: 3 of 3 world starts passed with it, 4 of 5 died without it. It looks like pipelines get destroyed while a recorded command list that binds them has not been submitted yet.Setup: RTX 3070 8 GB, NVIDIA 595.91.07, Linux 6.17, Wine 11.22, vkd3d-proton master
30b0eb9b+ #257's patch + the two dxil-spirv dominator patches from #1269. This is a local tree, not cleanmain: upstream06c9f55+ #2092 (two-pass mesh draws) + our own commits. Cleanmaindoes not run the two-pass mesh draws, so I could not check it there.Measured (same command line, warm caches, 240 s each; the only change is
retain_psos):vkQueueSubmit2on vkd3d's queue thread, each within the first 512–2,048 two-passExecuteIndirect(DispatchMesh)callsWhy (from the source; the fix itself is not tested yet):
retain_psosis set (libs/vkd3d/command.c, ind3d12_command_list_SetPipelineState:if (VKD3D_CONFIG_FLAG_IS_SET(RETAIN_PSOS) && state) d3d12_command_allocator_retain_pipeline_state(...)). Otherwise the lastReleaserunsvkDestroyPipelineat once (state.c,d3d12_pipeline_state_dec_ref).real.rspso_release→pso_async::released)forget_psodrops theTwoPassPsoentry; itsDropreleasescompute)alloc_pool), so a titleReleasethat would be safe on the console can come before a recording that binds the pipeline has been submitted.late_release.rsholds only resources, and only until the queues pass a fence signalled at release time. That does not cover a recording that has not been submitted yet.Workaround on vkd3d-proton: add
retain_psostoVKD3D_CONFIG. Native D3D12 on Windows has no such switch. There, an XCL-side fix would keep a reference to each pipeline XCL binds on a PC list, held by that list's PC allocator and let go whenalloc_poolreally resets it (like the per-allocator memory in #1422). I can write that if it is wanted. Not done or tested yet.AI use: found, measured and written up with Claude Code (Claude Opus 5.5); the runs are real runs on the machine above.
@anon31-006459 on GitHub · 2026-11-25 22:12 UTC · original
RTX 3070 Ti 8 GB / Linux, with #795 in: two stall forms before the title's watchdog write, from 6 runs that reached the world load.
Setup: NVIDIA 595.104.02, Proton Experimental's Wine, vkd3d-proton
2576c0b(vtable checks relaxed),VKD3D_CONFIG=ignore_shared_fence,retain_psos,XCL_PSO_WAIT_MS=50. Local tree:00cf258+ the ideas of #793 / #684, a #640 rebase, #495 and a local sync diagnostic. Retail 1.0.2.1, Series X.1. A CPU fallback left in
try_gpu_wait(1 run without the switch below: 4 × 2 s)Wait64BitValueX timed out … want 0x882; memory holds 880; sync=Some((882, 882, false, …)): the fence has completed, but the CPU's view of the word lags, socompleted >= w.value && !w.is_satisfied()falls back to the CPU and blocks the submit thread while compute queues wait on GPU for>= 0x882.Handledthere (local switch, 5 runs): when it acted (2 runs) there were no CPU-wait timeouts and no new errors. It does not change the end. A CPU-side counter reset would also pass this test, so trusting the fence only when memory is a few steps behind would be safer.2. GPU waits on Write64s that are recorded but never signalled (5 of 6 runs)
GPU queue.Wait at 0x70417f980 >= 0x946 … recorded=0x946, submitted=0x0, completed=0x0. The write was recorded into a compute list, closed at 139.2 s, and its Signal was still not submitted 42 s later.0x1541c10(done=0x0/sig=0x1)). The title seems to hold back the producing submission until its own fence completes, while the work behind that fence waits on the write. This matches thesubmitted = completed + 1releases in #795's review.End:
+0x23cf683in 5 runs (186–254 s),+0x2215c35in 1 (239 s).retain_psosdid not change it, and there were no Vulkan errors (err+vulkan).Not tested: Windows, AMD, clean
main, #2057; which queue owes the0x1541c10Signal.AI use: Claude Code (Claude Opus 5.5) wrote the diagnostic, ran the title and drafted this; I reviewed it before posting.
@pr1sm-dev on GitHub · 2026-11-25 22:24 UTC · original
I'm taking the XCL-side fix for this, so that it no longer depends on vkd3d-proton's
retain_psos(and does not rely on driver behaviour on Windows either).On
maine1d84b7, when the title releases a stand-in pipeline for good, XCL releases the real pipeline behind it at once (real.rspso_release/standin_released, andTwoPassPso::dropfor the two-pass compute pipeline). PC command lists bind that real pipeline, so a list that was recorded but has not run yet can still bind a destroyed pipeline.Plan: hold one reference to each pipeline bound on a PC list with that recording's allocator (
alloc_pool), and release it when that allocator is reset or forgotten. That is the same ruleretain_psosfollows. Switch:XCL_RETAIN_PSOS=0. Comes with a unit test that the real pipeline behind a released stand-in lives until its recording's allocator is reset, and Linux/Wine runs withoutretain_psos. One small PR.AI use: Claude Code (Claude Opus 5.5) wrote this comment.
@pr1sm-dev on GitHub · 2026-11-25 22:54 UTC · original
Update to my comment above: #2417 (@fixgep, opened before it) already covers this. It keeps the resolved background-built pipelines referenced by the command lists that bind them and puts their final release behind queue retirement. So I'm not opening a separate PR for the same thing.
For comparison only, in case the smaller shape is useful there: what I wrote locally holds one reference per pipeline bound on a PC list (in the adopted list's
SetPipelineState/ClearStatehooks), keyed by the PC allocator the recording is on (alloc_pool::recording_backing), and drops them wheredispatch_chain::allocator_resetalready runs (allocator reset or final release). That is about 100 lines outside its tests (mostly the new module and its comments), onmaine1d84b7. Its unit test of the stand-in flow (title releases the stand-in, the recording still binds the real pipeline, then the allocator is reset) fails with it switched off (asmainbehaves) and passes with it. Measured only under Wine + vkd3d-proton on an RTX 3070 (Linux).AI use: Claude Code (Claude Opus 5.5) wrote this comment.