Repository navigation
Conversation
71da6c4 to
47e61bd
Compare
When a program reads an image descriptor as data, descriptor_data rebuilt word 3 from getDimensions' level count even when nothing reads that word. vkd3d-proton turns the query into OpImageQueryLevels, and on a 3D image inside a loop NVIDIA's Vulkan compiler crashes on it (vkCreateComputePipelines, 0xc0000005 under Wine). Query the level count only when word 3's register is read as data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
47e61bd to
e232d3d
Compare
|
Test report on Windows, which the description lists as not tested. Tested
Not tested
AI use
|
…rd 3 is read Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mercuryVM
left a comment
There was a problem hiding this comment.
Tested e232d3d on Windows 11, RTX 5070, MSVC: cargo test --workspace --no-fail-fast passes (264 passed, 0 failed). victory translate <title exe> --validate --pipelines gives the same counts before and after: 12 of 12 programs emitted, 12 validated, 12 pipelines. Not tested under Wine or vkd3d-proton.
- The rebuilt word 3 is only observable when some SGPR written by this load at descriptor word 3 is read as data. When nothing reads it, putting
onethere instead of querying the level count can't change any result, and it removes thegetDimensionslevel query that vkd3d-proton turns intoOpImageQueryLevels. read_as_dataerrs the safe way. A phi use counts as a data read, so a word that flows through a loop still gets the real level count, and only direct resource operands of image, buffer and SMEM instructions are exempt. The worst case is the old behaviour.- The reduction story (3D image, query inside a loop, and
OpImageQueryLevelsall needed for the crash) is well isolated. This narrows the trigger without changing the semantics of shaders that do read word 3. Those can still hit the driver bug, which is outside our control.
No issues found.
AI-assisted (Claude Code).
…ount only when word 3 is read Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A direct eight-word scalar load can supply the resource of an image atomic without exposing any descriptor words as values. Avoid emitting a float-annotated dimension query in that case while retaining reconstruction for scalar reads, PHIs, and other consumers. Refs: Marvisak#48, Marvisak#177, Marvisak#259
…en word 3 is read
…en word 3 is read
…stalls Host::execute waited for each submission with no end. A host that loses its device need not signal the fences of the work it dropped: vkd3d-proton after a GPU fault does not, and by default does not report the device removed either. The title's submit thread then stays in our wait, its render thread blocks on its full submission ring, and 30 s later the title's own watchdog ends the run at image+0x23cf683 (Marvisak#1118), with nothing of ours in crashes.log to say that the GPU faulted. The wait now goes in 250 ms slices: * between slices the device is asked whether it was removed; if so the wait ends and the existing check after the submission reports it; * a submission still running is said so at 10 s and 20 s; * at 25 s it is given up with a report of its own ("has not finished a submission ... and reports no removal"). The limit is below the title's 30 s so the run ends with the cause, not with the title's null write. vkd3d-proton's own source calls a wait of over 5 s a lost device; Windows resets a device after about 2 s. A fence that comes is taken as before; a device that is removed and signals (Windows) is reported by the check after the wait, as before. Tested on Linux only (RTX 5080, driver 620.70, GE-Proton11-6's Wine, vkd3d-proton 30b0eb9), on main + Marvisak#177 + Marvisak#259, where the world faults the GPU in every run (Xid 13, fixed by Marvisak#542): * without this, with or without VKD3D_CONFIG=fault: the title's crash at +0x23cf683 24 to 30 s after the Xid, in 9 of 9 runs, and no report; * with this and VKD3D_CONFIG=fault: "device removed: 0x887A0005" 4 s after the Xid; * with this and vkd3d-proton's defaults: the two warnings, then the stall report 25 s after the submission began. New unit test of the wait (no GPU); cargo test --workspace under Proton: 333 passed, the same ten environmental failures as main; clippy -D warnings with and without --all-features; cargo xtask policy. Not run on Windows. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Automated triage for the maintainers. Merge candidate. In Thanks for the merge with main. It now merges cleanly against CI: passing ( Generated by Claude Code |
# Conflicts: # crates/victory-shader/src/emit/lower.rs
|
Rebased for the triage's "needs rebase": Checked on an RTX 5080 (Linux, proton-cachyos 11.0, vkd3d-proton 3.2.0), |
A title buffer object's copy is, with VICTORY_IN_PLACE=1, the title's memory too: placed from the 64 KiB boundary at or below the buffer (views find their bytes by address), past its end by 256 bytes where the allocation has them. A placed buffer's end only needs to be committed pages, not 64 KiB. A remap drops in-place title buffers over it as well. Buffers over many separately mapped 64 KiB views (MEM_MAPPED, one allocation each) are still copied: one heap cannot span them, and tile mappings into heaps opened over process memory were not reliable under vkd3d-proton here. Measured (RTX 5080, proton-cachyos 11.0, the title loading its world, with Marvisak#259, Marvisak#177 and Marvisak#1849 on top for NVIDIA under Wine): 3,335 title buffers and 2,117 loose windows in place, none refused, no device errors; 8 large buffers (378 MB) over separate views still copied. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…en word 3 is read
…stalls Host::execute waited for each submission with no end. A host that loses its device need not signal the fences of the work it dropped: vkd3d-proton after a GPU fault does not, and by default does not report the device removed either. The title's submit thread then stays in our wait, its render thread blocks on its full submission ring, and 30 s later the title's own watchdog ends the run at image+0x23cf683 (Marvisak#1118), with nothing of ours in crashes.log to say that the GPU faulted. The wait now goes in 250 ms slices: * between slices the device is asked whether it was removed; if so the wait ends and the existing check after the submission reports it; * a submission still running is said so at 10 s and 20 s; * at 25 s it is given up with a report of its own ("has not finished a submission ... and reports no removal"). The limit is below the title's 30 s so the run ends with the cause, not with the title's null write. vkd3d-proton's own source calls a wait of over 5 s a lost device; Windows resets a device after about 2 s. A fence that comes is taken as before; a device that is removed and signals (Windows) is reported by the check after the wait, as before. Tested on Linux only (RTX 5080, driver 620.70, GE-Proton11-6's Wine, vkd3d-proton 30b0eb9), on main + Marvisak#177 + Marvisak#259, where the world faults the GPU in every run (Xid 13, fixed by Marvisak#542): * without this, with or without VKD3D_CONFIG=fault: the title's crash at +0x23cf683 24 to 30 s after the Xid, in 9 of 9 runs, and no report; * with this and VKD3D_CONFIG=fault: "device removed: 0x887A0005" 4 s after the Xid; * with this and vkd3d-proton's defaults: the two warnings, then the stall report 25 s after the submission began. New unit test of the wait (no GPU); cargo test --workspace under Proton: 333 passed, the same ten environmental failures as main; clippy -D warnings with and without --all-features; cargo xtask policy. Not run on Windows. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… when word 3 is read) into the integration The descriptor words are placed by the load's skew on our side, so word 3 is found through the skew instead of the PR's first dword; read_as_data sits next to load_skew. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66
Problem
On NVIDIA under Wine with vkd3d-proton (#144), loading into the world ends the process inside the driver:
vkCreateComputePipelines Exception 0xc0000005 in Unix call, with nocrashes.logentry. On current vkd3d-proton (3.2.0) and with #177 applied, the remaining crashing compute shaders here were9938c251a313fe28,ef05293f6107fc99,a3d1a26ad0c8c2cdandb80cd30e37e3fa05.When a program reads an image descriptor as data,
descriptor_datarebuilds the descriptor words fromgetDimensionsand always extracts the level count for word 3. vkd3d-proton turns that intoOpImageQueryLevels. On a 3D image inside a loop, NVIDIA's Vulkan compiler crashes on it. These shaders load the whole descriptor (s_load_dwordx8) in a loop but never read word 3 as data.How it was found
VKD3D_SHADER_DUMP_PATH). It passesspirv-val. Creating a pipeline from it in a small native Linux Vulkan program (no Wine, no vkd3d-proton) segfaults the NVIDIA driver too.spirv-reduceagainst that native crash leaves a module of a few blocks. It crashes only with all three:OpImageQueryLevels, a 3D image, and the query inside a loop.OpImageQuerySizeLodinstead, a 2D image, or the query moved out of the loop all build.Change
descriptor_dataextracts the level count only when some instruction or phi reads word 3's register as data, not as the resource operand of a memory instruction, which takes the descriptor whole. Otherwise the level count is not queried; word 3's value is then unused. Programs that do read word 3 are unchanged.Testing
victory translate <dir> --pipelineson the four shaders: all crashed before, all create their pipeline after.cargo test -p victory-shaderpasses.What else this was run with
These are separate, and this PR does not include them:
5d113aa6830760b6and the pixel shaders that crashed invkCreateGraphicsPipelines).d3d12.dll,d3d12core.dllfrom Proton Experimental 11.0-20261112) next tovictory.exe. Older vkd3d-proton builds crash on other shaders (8bb272e763f76148,4e296b1885c37b29,6a62009bc6a4146e); see Wine + vkd3d-proton on NVIDIA: the driver crashes in vkCreateComputePipelines while the world loads (0xc000001d / 0xc0000005, earlier stack overflows) #144.Related: #144.
🤖 Generated with Claude Code