Linux/AMD (Wine + vkd3d-proton, RDNA3): findings and patches available #698

Open
opened 2026-11-26 03:49:11 +00:00 by github-bot · 5 comments
Owner

@⁠jtrudeau1530 on GitHub · 2026-11-25 04:46 UTC · original

Hi, thanks for the fork. We're running it under Linux (Wine 11.18 + vkd3d-proton 3.2.0, RADV, RX 7900 XT, 32 GB RAM) and found a few Linux/AMD-specific problems that may be useful to you. Each one below has a local patch on top of your 310c6eb6, with tests, and we can open PRs if you want them.

  1. dxil-spirv recursion (pipelines "being made" forever). Three ray-trace compute programs make dxil-spirv (inside vkd3d-proton's d3d12core) recurse without end in its dominator recomputation (recompute_immediate_dominator / find_common_dominator). This happens on loops that have more than one back edge, before they get merged. Under Wine the stack overflow kills the pipeline-pool thread without unwinding, so the pipeline stays "being made" for good. Every frame then spends its full pipeline-wait budget, and the pool loses a worker each time. Our fixes:
    • (a) run each host compile on its own thread and treat a dead thread as "no host pipeline";
    • (b) when that happens, retry the translation with loops emitted with a single back edge. All three then compile in 27–66 ms.
  2. Pipeline wait cap. As a safety net, we cap the total wait per pipeline (1 s) so one stuck compile can't stall every frame. On our machine this took the world from about 1.6 to 3+ fps, and to about 5 fps on your latest head.
  3. Empty pipeline library on Wine. The empty library was created with a non-null pointer, so nothing was ever saved between runs ("no host pipeline library" on every start). Your own library test fails on RADV because of this.
  4. SQC page faults at VA 0 / 0x20000 (device removed). Heap-indexed scalar loads were always read as constant buffers, whatever the slot held. When the stride table is missing, the root SRV for it was left unset (raw VA 0). We read buffer slots as raw bytes, CB slots as CBs and anything else as zeros, and bind a zero buffer instead of VA 0.
  5. BVH builder memory on Linux. Title-memory windows are shared custom-heap (WB/L0) buffers, which land in GTT outside the process accounting. At world entry they grow by about 4.7 GB. We move windows outside buffers into upload-heap VRAM (ReBAR) when budget allows. Note: VICTORY_INPLACE isn't safe under Wine, because a later VirtualProtect/VirtualFree of an imported page removes the device.

With the builder on (VICTORY_BVH_BUILDER=1), all 52 builder programs translate and compile on RADV. We're now chasing title-thread stack overflows that only appear with the builder.

No game files or captures are included or shared here.

**@⁠jtrudeau1530** on GitHub · 2026-11-25 04:46 UTC · [original](https://github.com/fxceless/victory-fork/issues/698) Hi, thanks for the fork. We're running it under Linux (Wine 11.18 + vkd3d-proton 3.2.0, RADV, RX 7900 XT, 32 GB RAM) and found a few Linux/AMD-specific problems that may be useful to you. Each one below has a local patch on top of your 310c6eb6, with tests, and we can open PRs if you want them. 1. **dxil-spirv recursion (pipelines "being made" forever).** Three ray-trace compute programs make dxil-spirv (inside vkd3d-proton's d3d12core) recurse without end in its dominator recomputation (`recompute_immediate_dominator` / `find_common_dominator`). This happens on loops that have more than one back edge, before they get merged. Under Wine the stack overflow kills the pipeline-pool thread without unwinding, so the pipeline stays "being made" for good. Every frame then spends its full pipeline-wait budget, and the pool loses a worker each time. Our fixes: - (a) run each host compile on its own thread and treat a dead thread as "no host pipeline"; - (b) when that happens, retry the translation with loops emitted with a single back edge. All three then compile in 27–66 ms. 2. **Pipeline wait cap.** As a safety net, we cap the total wait per pipeline (1 s) so one stuck compile can't stall every frame. On our machine this took the world from about 1.6 to 3+ fps, and to about 5 fps on your latest head. 3. **Empty pipeline library on Wine.** The empty library was created with a non-null pointer, so nothing was ever saved between runs ("no host pipeline library" on every start). Your own library test fails on RADV because of this. 4. **SQC page faults at VA 0 / 0x20000 (device removed).** Heap-indexed scalar loads were always read as constant buffers, whatever the slot held. When the stride table is missing, the root SRV for it was left unset (raw VA 0). We read buffer slots as raw bytes, CB slots as CBs and anything else as zeros, and bind a zero buffer instead of VA 0. 5. **BVH builder memory on Linux.** Title-memory windows are shared custom-heap (WB/L0) buffers, which land in GTT outside the process accounting. At world entry they grow by about 4.7 GB. We move windows outside buffers into upload-heap VRAM (ReBAR) when budget allows. Note: VICTORY_INPLACE isn't safe under Wine, because a later VirtualProtect/VirtualFree of an imported page removes the device. With the builder on (VICTORY_BVH_BUILDER=1), all 52 builder programs translate and compile on RADV. We're now chasing title-thread stack overflows that only appear with the builder. No game files or captures are included or shared here.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:49:11 +00:00
Author
Owner

@⁠jtrudeau1530 on GitHub · 2026-11-25 06:46 UTC · original

Update: with VICTORY_BVH_BUILDER=1 VICTORY_BVH_QUARANTINE=1 the structure builder now runs stably on RADV for us (10 min, ~5 fps), and the RT shadow tiles render. Three fixes were needed on top of your tree. Patches are available if useful:

  1. Quarantine leak. Quarantine covered root UAVs and memory-by-address, but not UAVs in descriptor tables. Separately, the builder's stores still reached shared host copies: the next title shader that copied back an overlapping range or window also copied the builder's +inf/-inf fill values over CPU objects, so title threads read all-ones pointers. Our fix keeps every range a quarantined builder may have written out of all later copy-backs. The GPU copies keep the builder's output.
  2. Window explosion. Builder memory-by-address accesses outside any buffer object (scratch/results, plus zero-read pointers) created about 3,000 4 MiB title windows (about 12 GB) that were refreshed and compared every list. Our fix gives non-buffer pages a GPU-only arena (4 MiB cells in 256 MiB buffers, capped). Each cell is filled once and never compared or copied back. Pages below 4 GiB that sit outside buffers are refused.
  3. Stale arena cells. Cells filled once went stale when the title later wrote instance data into them, and the rays walked stale structures, which gave the black 16-px tiles. Our fix write-watches each cell after its fill and recopies only the dirty pages once per list.
**@⁠jtrudeau1530** on GitHub · 2026-11-25 06:46 UTC · [original](https://github.com/fxceless/victory-fork/issues/698#issuecomment-7155140955) Update: with `VICTORY_BVH_BUILDER=1 VICTORY_BVH_QUARANTINE=1` the structure builder now runs stably on RADV for us (10 min, ~5 fps), and the RT shadow tiles render. Three fixes were needed on top of your tree. Patches are available if useful: 1. **Quarantine leak.** Quarantine covered root UAVs and memory-by-address, but not UAVs in descriptor tables. Separately, the builder's stores still reached shared host copies: the next title shader that copied back an overlapping range or window also copied the builder's +inf/-inf fill values over CPU objects, so title threads read all-ones pointers. Our fix keeps every range a quarantined builder may have written out of all later copy-backs. The GPU copies keep the builder's output. 2. **Window explosion.** Builder memory-by-address accesses outside any buffer object (scratch/results, plus zero-read pointers) created about 3,000 4 MiB title windows (about 12 GB) that were refreshed and compared every list. Our fix gives non-buffer pages a GPU-only arena (4 MiB cells in 256 MiB buffers, capped). Each cell is filled once and never compared or copied back. Pages below 4 GiB that sit outside buffers are refused. 3. **Stale arena cells.** Cells filled once went stale when the title later wrote instance data into them, and the rays walked stale structures, which gave the black 16-px tiles. Our fix write-watches each cell after its fill and recopies only the dirty pages once per list.
Author
Owner

@⁠jtrudeau1530 on GitHub · 2026-11-25 10:07 UTC · original

@⁠lajoerkk thanks. We'll share a branch once it's cleaned up and reviewed on our side, probably later today. In the meantime, those three stack overflows on the pipeline worker threads are the dxil-spirv recursion from point 1: three RT compute programs with multi-back-edge loops. On a stock build they cost a pipeline worker each time and leave those pipelines stuck as "being made". That explains part of the frame-rate loss, but not the black world. For the black world, VICTORY_BVH_BUILDER=1 with VICTORY_BVH_QUARANTINE=1 is what eventually got lighting for us, and it needed the builder fixes from the second comment.

**@⁠jtrudeau1530** on GitHub · 2026-11-25 10:07 UTC · [original](https://github.com/fxceless/victory-fork/issues/698#issuecomment-7159254136) @⁠lajoerkk thanks. We'll share a branch once it's cleaned up and reviewed on our side, probably later today. In the meantime, those three stack overflows on the pipeline worker threads are the dxil-spirv recursion from point 1: three RT compute programs with multi-back-edge loops. On a stock build they cost a pipeline worker each time and leave those pipelines stuck as "being made". That explains part of the frame-rate loss, but not the black world. For the black world, VICTORY_BVH_BUILDER=1 with VICTORY_BVH_QUARANTINE=1 is what eventually got lighting for us, and it needed the builder fixes from the second comment.
Author
Owner

@⁠jtrudeau1530 on GitHub · 2026-11-25 10:08 UTC · original

Two things in 9376fd60 that broke rendering for us on top of our stack. Both come from reading the code and aren't confirmed on pure upstream yet:

  • watch::known_view / guard check only the first block of a range. A range that runs past a guarded view into unguarded memory therefore skips GetWriteWatch and misses writes. For us this caused a flat yard and an orange haze in the window. Checking that every block is guarded fixed it.
  • mirror_copied skips any slot a table read recently, whatever the slot holds now, and the mark outlives the texture. So a buffer view, an empty record, or a slot that's only read by index stays stale. For us this caused a missing body and shirt and a strip of tiles. Skipping only slots that hold a texture a draw actually read fixed it.
**@⁠jtrudeau1530** on GitHub · 2026-11-25 10:08 UTC · [original](https://github.com/fxceless/victory-fork/issues/698#issuecomment-7159281878) Two things in 9376fd60 that broke rendering for us on top of our stack. Both come from reading the code and aren't confirmed on pure upstream yet: - `watch::known_view` / `guard` check only the first block of a range. A range that runs past a guarded view into unguarded memory therefore skips GetWriteWatch and misses writes. For us this caused a flat yard and an orange haze in the window. Checking that every block is guarded fixed it. - `mirror_copied` skips any slot a table read recently, whatever the slot holds now, and the mark outlives the texture. So a buffer view, an empty record, or a slot that's only read by index stays stale. For us this caused a missing body and shirt and a strip of tiles. Skipping only slots that hold a texture a draw actually read fixed it.
Author
Owner

@⁠ThomasHFWright on GitHub · 2026-11-25 11:32 UTC · original · edited 2026-11-25 12:00 UTC

Confirmed the compiler-recursion part on RTX 5090 / CachyOS 7.3.6 / NVIDIA 620.73.04 / GE-Proton11-14.

Using victory-fork a26859f plus #20 and upstream #454, three isolated compute shaders (fdd56d97a806bcca, a1b20bc47e3c9597, e8c962358d862e3f) validate as DXIL, then stack-overflow during host pipeline creation and leave the process waiting until its external timeout. The offline translation must set VICTORY_HOST_MAX_WAVE=32 to match this GPU, alongside loop limit32. No command lists or GPU dispatches in these tests.

I then built native dxil-spirv at GE's exact pin 34f0ff845eb7f1ca76ca8df5d1593d6913f19e9c and replayed the same emitted DXIL:

  • fdd: recursive LoopMergeTracer::trace_from_parent at cfg_structurizer.cpp:3250, matching upstream dxil-spirv#380.
  • a1b/e8c: recursive CFGNode::find_common_dominator / recompute_immediate_dominator, matching your point1 and upstream dxil-spirv#376.
  • All three SIGSEGV in under0.5s under gdb, independent of Wine/GPU execution.

The maintainer recommends the legacy-struct-remove branch in both upstream threads:
https://github.com/HansKristian-Work/dxil-spirv/issues/376#issuecomment-7145564419
https://github.com/HansKristian-Work/dxil-spirv/issues/380#issuecomment-7160679798

With its converter library at e084e35c4506210b44f6b7df3bbf31a1026545b8, the same CLI and exact same DXIL all convert successfully (~32ms each including sandbox startup). All three outputs pass spirv-val --target-env vulkan1.3 --scalar-block-layout. Library resolution was verified.

Windows runtime and gameplay follow-up — 2026-11-25

Built isolated Windows x64 d3d12/d3d12core DLLs from vkd3d-proton cae8353ed7959c4 (the revision reported by our GE runtime), replacing its dxil-spirv submodule with e084e35c4506210b44f6b7df3bbf31a1026545b8. This is a local upstream rebuild, not a byte-identical recreation of GE's dirty build. Original runtime preserved.

  • All three Windows host-pipeline probes now exit 0 with pipelines created and no stack overflows. Emitted DXIL is byte-identical to the failing baseline. Runs take 5.62–6.42s including Wine startup; these probes do not dispatch GPU work.
  • Re-ran the shader, loader and GPU unit suites with the rebuilt DLLs: 383 passed / 4 failed / 6 ignored, with exactly the same four failure names as baseline. These concern the stub shader digest and pipeline-library behavior. Integration fixtures were not run.
  • Retried the title offline with the same executable and rendering settings, separate prefix/data and fresh shader/driver caches. All three previously failing host pipelines compiled during this run, and no stack overflows were logged.
  • The separate world-entry failure remains: NVIDIA Xid13/MMU at approximately 112s. The fdd pipeline compiled before the fault; a1b/e8c compiled after it. Captures showed loading artwork followed by blank output, not visible scene geometry. I stopped the failed run at 141.57s; it was not a spontaneous process exit or a user close.
  • Sampled process-group resident peak ~8.98 GiB, swap peak ~8.60 GiB, minimum host available memory ~1.01 GiB; no cgroup OOM events. Memory pressure remains a confounder, not an established cause.

This validates the compiler fix under Wine and in the title, but does not fix our GPU memory fault or establish working gameplay. No unrelated rendering/BVH patches were mixed into this comparison.

No proprietary inputs, generated shader binaries, captures or raw logs attached. AI-assisted: Codex ran and checked these local tests and prepared this aggregate report under the user's instruction to post results.

**@⁠ThomasHFWright** on GitHub · 2026-11-25 11:32 UTC · [original](https://github.com/fxceless/victory-fork/issues/698#issuecomment-7161189617) · edited 2026-11-25 12:00 UTC Confirmed the compiler-recursion part on RTX 5090 / CachyOS 7.3.6 / NVIDIA 620.73.04 / GE-Proton11-14. Using victory-fork a26859f plus #20 and upstream #454, three isolated compute shaders (fdd56d97a806bcca, a1b20bc47e3c9597, e8c962358d862e3f) validate as DXIL, then stack-overflow during host pipeline creation and leave the process waiting until its external timeout. The offline translation must set VICTORY_HOST_MAX_WAVE=32 to match this GPU, alongside loop limit32. No command lists or GPU dispatches in these tests. I then built native dxil-spirv at GE's exact pin 34f0ff845eb7f1ca76ca8df5d1593d6913f19e9c and replayed the same emitted DXIL: - fdd: recursive LoopMergeTracer::trace_from_parent at cfg_structurizer.cpp:3250, matching upstream dxil-spirv#380. - a1b/e8c: recursive CFGNode::find_common_dominator / recompute_immediate_dominator, matching your point1 and upstream dxil-spirv#376. - All three SIGSEGV in under0.5s under gdb, independent of Wine/GPU execution. The maintainer recommends the legacy-struct-remove branch in both upstream threads: https://github.com/HansKristian-Work/dxil-spirv/issues/376#issuecomment-7145564419 https://github.com/HansKristian-Work/dxil-spirv/issues/380#issuecomment-7160679798 With its converter library at e084e35c4506210b44f6b7df3bbf31a1026545b8, the same CLI and exact same DXIL all convert successfully (~32ms each including sandbox startup). All three outputs pass spirv-val --target-env vulkan1.3 --scalar-block-layout. Library resolution was verified. ### Windows runtime and gameplay follow-up — 2026-11-25 Built isolated Windows x64 d3d12/d3d12core DLLs from vkd3d-proton cae8353ed7959c4 (the revision reported by our GE runtime), replacing its dxil-spirv submodule with e084e35c4506210b44f6b7df3bbf31a1026545b8. This is a local upstream rebuild, not a byte-identical recreation of GE's dirty build. Original runtime preserved. - All three Windows host-pipeline probes now exit 0 with pipelines created and no stack overflows. Emitted DXIL is byte-identical to the failing baseline. Runs take 5.62–6.42s including Wine startup; these probes do not dispatch GPU work. - Re-ran the shader, loader and GPU unit suites with the rebuilt DLLs: **383 passed / 4 failed / 6 ignored**, with exactly the same four failure names as baseline. These concern the stub shader digest and pipeline-library behavior. Integration fixtures were not run. - Retried the title offline with the same executable and rendering settings, separate prefix/data and fresh shader/driver caches. All three previously failing host pipelines compiled during this run, and no stack overflows were logged. - **The separate world-entry failure remains:** NVIDIA Xid13/MMU at approximately 112s. The fdd pipeline compiled before the fault; a1b/e8c compiled after it. Captures showed loading artwork followed by blank output, not visible scene geometry. I stopped the failed run at 141.57s; it was not a spontaneous process exit or a user close. - Sampled process-group resident peak ~8.98 GiB, swap peak ~8.60 GiB, minimum host available memory ~1.01 GiB; no cgroup OOM events. Memory pressure remains a confounder, not an established cause. This validates the compiler fix under Wine and in the title, but does **not** fix our GPU memory fault or establish working gameplay. No unrelated rendering/BVH patches were mixed into this comparison. No proprietary inputs, generated shader binaries, captures or raw logs attached. AI-assisted: Codex ran and checked these local tests and prepared this aggregate report under the user's instruction to post results.
Author
Owner

@⁠jtrudeau1530 on GitHub · 2026-11-25 15:02 UTC · original

@⁠lajoerkk the branch is up: https://github.com/jtrudeau1530/victory-fork/tree/linux-amd. It's based on f85101b6 with 5 commits on top. We run it under Linux (Wine + vkd3d-proton 3.2, RADV) with VICTORY_BVH_BUILDER=1 VICTORY_BVH_QUARANTINE=1. On an RX 7900 XT it gives a lit world with RT shadows at about 3.7 fps, and 10-minute runs have been stable. Known issues: some black patches on one wall, and the frame rate is still low. Feedback from RDNA 4 is welcome.

**@⁠jtrudeau1530** on GitHub · 2026-11-25 15:02 UTC · [original](https://github.com/fxceless/victory-fork/issues/698#issuecomment-7166206512) @⁠lajoerkk the branch is up: https://github.com/jtrudeau1530/victory-fork/tree/linux-amd. It's based on f85101b6 with 5 commits on top. We run it under Linux (Wine + vkd3d-proton 3.2, RADV) with `VICTORY_BVH_BUILDER=1 VICTORY_BVH_QUARANTINE=1`. On an RX 7900 XT it gives a lit world with RT shadows at about 3.7 fps, and 10-minute runs have been stable. Known issues: some black patches on one wall, and the frame rate is still low. Feedback from RDNA 4 is welcome.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/fxceless--victory-fork#698
No description provided.