Wine: safe file-backed XMem and compiler fixes for RTX 4060 Laptop #1226

Manually merged
github merged 4 commits from github-bot/gh-1226 into main 2026-11-29 08:21:26 +00:00 AGit
Owner

@⁠pickles976 on GitHub · 2026-11-28 15:59 UTC · original
pickles976:wine-rtx4060-laptop → main · +1104 −82 · 14 files · 4 commits · merged 2026-11-29 08:16 UTC

Summary

Add opt-in, copy-safe disk backing for Wine physical pages, together with two credited compiler prerequisites. On an RTX 4060 Laptop (8 GiB VRAM), 16 GiB system RAM, Linux 6.17 / Wine 11 / NVIDIA 590.48.1, the user observed correctly-looking rendered imagery with this combination. Rendering was very laggy. This is not a claim of controllable gameplay, complete rendering correctness, 30 FPS, or long-run stability.

Tested production source is based on e7d8150defa7713b6f839561c45da9a26aa88620; the four commits separate borrowed compiler changes, Wine backing integration, and documentation. Lab observers, assets, saves and captures are not included.

Changes and attribution

  1. 13bc184ed3: adapt #1103 (1a35cb316a8f3ef8019299d73daa61b9ca3e96a8) to evaluate lane-mask decisions iteratively instead of exhausting the compiler stack. This credits the existing owner proposal, not a new independent discovery; it can be merged separately.
  2. f26bce985d: adapt Marvisak/VIctory#2309, ec845d633b47e4f98789a8f0353c172f3070d942, for single-latch DXIL loops/phi rewrites, preserving normalization through folding. No enlarged worker stacks or shader-acceptance changes.
  3. bc8ce50fc2: adapt the backing policy from Marvisak/VIctory#2519, 646c17cc666f7f92464768cb8de45ac814558820, to this fork's aliases, retained DirectStorage windows and native import paths. Backing is opt-in; default pagefile behavior remains unchanged. Creation failure is an allocation failure, not a silent RAM fallback. File-backed/stale-generation sections cannot be imported natively; eligible handles are duplicated under the registry lock. CPU/GPU copy paths remain available.
  4. 72657763d9: document setup, evidence and limitations in docs/linux-proton.md.

Configuration tested

Fork apps/victory/src/play.rs settings retained, with:

VICTORY_FILE_BACKED_PAGES=1
VICTORY_INPLACE=0
VICTORY_INPLACE_PROBE=0
VICTORY_PORT_CONSTANTS=0
VKD3D_DISABLE_EXTENSIONS=VK_NV_raw_access_chains

Use a real disk filesystem for the configured cache/physical-pages directory, not tmpfs. Optional [paths].physical_pages_dir selects an absolute directory outside the checkout. Final ordinary release deletes the backing; killing the whole Wine scope can leave named files, so never delete files belonging to a live process.

Series S / requested 720p internal and 1080p output, no DLSS/frame generation. The fork's existing BVH-builder disable, ambient-lighting estimates and two shader exclusions remain. No new shader skips, watchdog bypass or safety-limit increases. All title runs retained 9 GiB/512 MiB scope memory/swap limits and external GPU/RAM/disk stops.

Verification

Windows-MSVC builds used Rust 1.98.1 and Wine. Relevant GPU checks and the rendering run used app-local stock assertion-enabled vkd3d-proton 2576c0b4adfae4a, not the installed diagnostic-relaxed pair. Physical NVIDIA adapter selected; no WARP certification.

  • Configuration tests: 14/14 pass; file-section/alias/token/window lifetime tests: 5/5 pass.
  • Structural and loop/readback groups passed; the physical-adapter loop checks cover all 384 output words.
  • Original compute program fdd56d97a806bcca: baseline emitted and SDK-validated but stack-overflowed/timed out during native PSO creation. Modified source emits, SDK-validates and creates the native PSO on stock vkd3d at normal stack size (2.115 s). Original-program dispatch is not claimed.
  • Stock-vkd3d GPU group: 3/3 pass, 0.68 s: production scatter, current eligible section generation, and 128 KiB file-backed alias coherence. The latter checks every word across three CPU-alias → GPU-copy → GPU-writeback rounds. Also passes with the raw-access workaround; a separate native log explicitly confirms that extension is disabled.
  • Fresh diagnostics release succeeded (107 s). Tested executable SHA256: 8b2fc58820110515e878b1e79722bc8e7fa28ae2baca37816aad8be215f3f0f2. Stock d3d12/core SHA256: fc2bbef02509fb11c334cc96dd211f64def94bb7b4eb82082a4808e6e0549543 / 9356501320114773be279506644aabd9a1717ff451d480ac802a4fd4e94b2576.

The opt-in hardware regression is reproducible with VICTORY_TEST_PAGE_DIR pointing to a writable disk directory visible to the Windows process, then the Wine-configured Cargo runner:

cargo test --locked --target x86_64-pc-windows-msvc -p victory-gpu --lib \
  file_backed_aliases_preserve_gpu_copies_and_later_cpu_writes \
  -- --ignored --nocapture --test-threads=1

Remaining bottleneck and limits

The 2026-11-28 15:48:40 UTC trial produced the user's rendering observation. Scheduled screenshots missed that scene. This is not a matched A/B isolating which patch enabled it; caches/input timing differed between runs.

Measured item Result
Scope peak 9,216 MiB (cap reached)
memory.events max / OOM / OOM-kill 114 / 0 / 0
I/O pressure full avg10 at ~200 s 39.27%
Sampled global GPU peak 5,903 MiB
Minimum available system RAM 2,349.6 MiB
Minimum user-available disk 10.904 GiB

Title and DirectStorage threads repeatedly waited in folio_wait_bit_common / balance_dirty_pages. This supports a paging/writeback bottleneck, not inode-specific attribution or a GPU-only explanation. The supervisor stopped the run around 202 s after its kernel-journal query exceeded three seconds; this is not a diagnosed title crash. Exact-interval kernel logs contain no GPU fault/reset or OOM signature. A denied /proc/PID/syscall observer read generated audit messages; removed from the local observer afterward.

Earlier runs stopped on two-second nvidia-smi deadlines and recovered after shutdown. The #1199 / canonical #542 workaround alone did not eliminate that symptom. Do not relax the guards or treat those timeouts as proven GPU execution hangs.

Next useful work is bounded streaming/reclaimable-memory demand, with matched frame/stage measurements—not raising the cap. Raw logs and proprietary captures remain local; this report contains the reproducible methods and measured results only.

**@⁠pickles976** on GitHub · 2026-11-28 15:59 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1226) `pickles976:wine-rtx4060-laptop` → `main` · +1104 −82 · 14 files · 4 commits · merged 2026-11-29 08:16 UTC ## Summary Add opt-in, copy-safe disk backing for Wine physical pages, together with two credited compiler prerequisites. On an RTX 4060 Laptop (8 GiB VRAM), 16 GiB system RAM, Linux 6.17 / Wine 11 / NVIDIA 590.48.1, the user observed correctly-looking rendered imagery with this combination. Rendering was very laggy. **This is not a claim of controllable gameplay, complete rendering correctness, 30 FPS, or long-run stability.** Tested production source is based on `e7d8150defa7713b6f839561c45da9a26aa88620`; the four commits separate borrowed compiler changes, Wine backing integration, and documentation. Lab observers, assets, saves and captures are not included. ## Changes and attribution 1. `13bc184ed3`: adapt #1103 (`1a35cb316a8f3ef8019299d73daa61b9ca3e96a8`) to evaluate lane-mask decisions iteratively instead of exhausting the compiler stack. This credits the existing owner proposal, not a new independent discovery; it can be merged separately. 2. `f26bce985d`: adapt [Marvisak/VIctory#2309](https://github.com/Marvisak/VIctory/pull/2309), `ec845d633b47e4f98789a8f0353c172f3070d942`, for single-latch DXIL loops/phi rewrites, preserving normalization through folding. No enlarged worker stacks or shader-acceptance changes. 3. `bc8ce50fc2`: adapt the backing policy from [Marvisak/VIctory#2519](https://github.com/Marvisak/VIctory/pull/2519), `646c17cc666f7f92464768cb8de45ac814558820`, to this fork's aliases, retained DirectStorage windows and native import paths. Backing is opt-in; default pagefile behavior remains unchanged. Creation failure is an allocation failure, not a silent RAM fallback. File-backed/stale-generation sections cannot be imported natively; eligible handles are duplicated under the registry lock. CPU/GPU copy paths remain available. 4. `72657763d9`: document setup, evidence and limitations in `docs/linux-proton.md`. ## Configuration tested Fork `apps/victory/src/play.rs` settings retained, with: ```sh VICTORY_FILE_BACKED_PAGES=1 VICTORY_INPLACE=0 VICTORY_INPLACE_PROBE=0 VICTORY_PORT_CONSTANTS=0 VKD3D_DISABLE_EXTENSIONS=VK_NV_raw_access_chains ``` Use a real disk filesystem for the configured cache/physical-pages directory, not tmpfs. Optional `[paths].physical_pages_dir` selects an absolute directory outside the checkout. Final ordinary release deletes the backing; killing the whole Wine scope can leave named files, so never delete files belonging to a live process. Series S / requested 720p internal and 1080p output, no DLSS/frame generation. The fork's existing BVH-builder disable, ambient-lighting estimates and two shader exclusions remain. **No new shader skips, watchdog bypass or safety-limit increases.** All title runs retained 9 GiB/512 MiB scope memory/swap limits and external GPU/RAM/disk stops. ## Verification Windows-MSVC builds used Rust 1.98.1 and Wine. Relevant GPU checks and the rendering run used app-local **stock assertion-enabled vkd3d-proton `2576c0b4adfae4a`**, not the installed diagnostic-relaxed pair. Physical NVIDIA adapter selected; no WARP certification. - Configuration tests: 14/14 pass; file-section/alias/token/window lifetime tests: 5/5 pass. - Structural and loop/readback groups passed; the physical-adapter loop checks cover all 384 output words. - Original compute program `fdd56d97a806bcca`: baseline emitted and SDK-validated but stack-overflowed/timed out during native PSO creation. Modified source emits, SDK-validates and creates the native PSO on stock vkd3d at normal stack size (2.115 s). Original-program dispatch is not claimed. - Stock-vkd3d GPU group: 3/3 pass, 0.68 s: production scatter, current eligible section generation, and 128 KiB file-backed alias coherence. The latter checks every word across three CPU-alias → GPU-copy → GPU-writeback rounds. Also passes with the raw-access workaround; a separate native log explicitly confirms that extension is disabled. - Fresh diagnostics release succeeded (107 s). Tested executable SHA256: `8b2fc58820110515e878b1e79722bc8e7fa28ae2baca37816aad8be215f3f0f2`. Stock d3d12/core SHA256: `fc2bbef02509fb11c334cc96dd211f64def94bb7b4eb82082a4808e6e0549543` / `9356501320114773be279506644aabd9a1717ff451d480ac802a4fd4e94b2576`. The opt-in hardware regression is reproducible with `VICTORY_TEST_PAGE_DIR` pointing to a writable disk directory visible to the Windows process, then the Wine-configured Cargo runner: ```sh cargo test --locked --target x86_64-pc-windows-msvc -p victory-gpu --lib \ file_backed_aliases_preserve_gpu_copies_and_later_cpu_writes \ -- --ignored --nocapture --test-threads=1 ``` ## Remaining bottleneck and limits The 2026-11-28 15:48:40 UTC trial produced the user's rendering observation. Scheduled screenshots missed that scene. This is not a matched A/B isolating which patch enabled it; caches/input timing differed between runs. | Measured item | Result | |---|---:| | Scope peak | 9,216 MiB (cap reached) | | `memory.events max` / OOM / OOM-kill | 114 / 0 / 0 | | I/O pressure `full avg10` at ~200 s | 39.27% | | Sampled global GPU peak | 5,903 MiB | | Minimum available system RAM | 2,349.6 MiB | | Minimum user-available disk | 10.904 GiB | Title and DirectStorage threads repeatedly waited in `folio_wait_bit_common` / `balance_dirty_pages`. This supports a paging/writeback bottleneck, not inode-specific attribution or a GPU-only explanation. The supervisor stopped the run around 202 s after its kernel-journal query exceeded three seconds; this is not a diagnosed title crash. Exact-interval kernel logs contain no GPU fault/reset or OOM signature. A denied `/proc/PID/syscall` observer read generated audit messages; removed from the local observer afterward. Earlier runs stopped on two-second `nvidia-smi` deadlines and recovered after shutdown. The #1199 / [canonical #542](https://github.com/Marvisak/VIctory/pull/542) workaround alone did not eliminate that symptom. Do not relax the guards or treat those timeouts as proven GPU execution hangs. Next useful work is bounded streaming/reclaimable-memory demand, with matched frame/stage measurements—not raising the cap. Raw logs and proprietary captures remain local; this report contains the reproducible methods and measured results only.
Adapt VIctory-NVIDIA #1103, commit 1a35cb316a.
Preserve memoized decisions without recursive stack growth; include the owner regression.
Adapt Marvisak/VIctory #2309, commit ec845d633b47e4f98789a8f0353c172f3070d942.
Preserve single latches through loop/phi rewrites and folding. The original fdd56d97a806bcca pipeline now validates and creates on stock vkd3d without increasing worker stacks.
Adapt the backing policy from Marvisak/VIctory #2519, commit 646c17cc666f7f92464768cb8de45ac814558820.
Retain backing ownership across aliases, page tokens and DirectStorage windows. Reject file-backed and stale-generation native imports; keep default allocation behavior unchanged.
Add fail-closed configuration/lifetime regressions and real-GPU scatter and file-alias copy coherence checks.
Document stock-vkd3d checks and user-observed rendered imagery with explicit fork rendering limitations.
Record cgroup reclaim/writeback stalls, telemetry stops, diagnostic effects and unverified gameplay/FPS stability.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 16:04:37 +00:00
github manually merged commit 8c9ad53151 into main 2026-11-29 08:21:26 +00:00
Author
Owner

@⁠pickles976 on GitHub · 2026-11-29 11:05 UTC · original · edited 2026-11-29 13:51 UTC

Safety follow-up from our custom local performance integration, not clean current main and not an established regression of this Wine-support PR.

At2026-11-29T10:42:51Z the Intel display GPU reported:

i915: Resetting rcs0 for preemption time out
Xwayland[5583] context reset due to GPU hang
GPU HANG: ecode12:1:859ffffb

The forcewake warning/call trace was in the error-capture path. The failed GPU context was Xwayland on Intel Raptor Lake-P UHD8086:a7a8; the game was rendering on the RTX4060 Laptop. Platform: Ubuntu kernel6.17.0-40, GNOME/Wayland, Xwayland2:23.2.6-1ubuntu0.8, Mesa25.2.8-0ubuntu0.24.04.4, Mutter46.2-1ubuntu0.24.04.18, NVIDIA590.48.1, Wine11, stock app-local vkd3d2576c0b4adfae4a. No kernel/driver setting changed.

This run used saved rendereraba888182c (SHA2562e1d7c3138bd9aa26cb37bbe3b73072e7753c8c72ba40496e92daa32f8978a9e); local source77b8fe08 adds tests/docs/comments only. The changed setting was the existing registered-copy allowance768MiB, after a real quota-exhaustion/disk-alias coherence gate passed. That does not establish that this setting caused the Intel hang. Texture/shader/resolution policies and all external guards stayed unchanged.

The kernel-fault monitor stopped the scope; launcher155.13s/137. NVIDIA peak5119MiB, availableRAMminimum3722.5MiB, diskminimum11.939GiB, scopepeak9GiB/max1103/oom0. All152 native guard queries completed(max800.62ms), independent observermax525.49ms; this was not the NVIDIA memory cutoff or a native telemetry deadline. Last150s image was a rendered cutscene, not gameplay/FPS proof. Scope is inactive/dead, and only four snapshot/inode-matched unheld generated backing files were reclaimed.

All GPU/title experiments on this host are now parked. A previous trial with another runtime also recorded an Intel desktop hang, but shared causality is unproved. No unchanged reproduction, higher limit, shader bypass, or display-stack stability claim. The root-only GPU error state could not be captured without user authorization; raw GPU dumps may contain private contents and will remain local. Exact kernel/desktop metadata/resources/stop evidence: nvidia-fork-trial-20261129T104020Z/{kernel-final.log,desktop-driver-metadata.json,verified-summary.json,error-capture-attempts.json,backing-cleanup.json}.

Subsequent private error-state inspection

The user has now captured the root-only i915 error state locally. Raw dump, decoded buffers and images remain private; no GPU workload was restarted. Offline decoding ran with device nodes hidden and network disabled.

The saved active context is Intel rcs0 / Xwayland, not a NVIDIA title-shader instruction pointer. The captured batch head is at an end-of-batch PIPE_CONTROL cache flush/post-sync write following a rectangle draw. A flush can wait for preceding work: this does not identify the initiating shader, memory or driver defect. The old IGT decoder mislabels some Gen12 packet fields; the relevant packet lengths/fields were checked against Mesa25.2.8 Gen120 definitions, not accepted from those legacy annotations.

The dump also confirms the pre-existing boot setting i915.enable_guc=0 and execlists submission. No boot/driver setting was changed by this trial or investigation. The dump capture timestamp is45ms after the last x11grab PNG modification; kernel hang logging follows later. This temporal association is not proof that screenshot capture caused the fault. Another Raptor Lake-P report has failures with both GuC enabled and disabled (different hardware/signature): https://github.com/ublue-os/bazzite/issues/6029 . Do not treat a GuC toggle as a verified remedy.

The performance/gameplay safety hold remains. Further work belongs in Intel/Mesa/Xwayland driver triage with the private dump, not another unchanged title trial or a higher memory limit.

**@⁠pickles976** on GitHub · 2026-11-29 11:05 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1226#issuecomment-7254875954) · edited 2026-11-29 13:51 UTC Safety follow-up from our **custom local performance integration**, not clean current main and not an established regression of this Wine-support PR. At2026-11-29T10:42:51Z the Intel display GPU reported: ``` i915: Resetting rcs0 for preemption time out Xwayland[5583] context reset due to GPU hang GPU HANG: ecode12:1:859ffffb ``` The forcewake warning/call trace was in the error-capture path. The failed GPU context was Xwayland on Intel Raptor Lake-P UHD8086:a7a8; the game was rendering on the RTX4060 Laptop. Platform: Ubuntu kernel6.17.0-40, GNOME/Wayland, Xwayland2:23.2.6-1ubuntu0.8, Mesa25.2.8-0ubuntu0.24.04.4, Mutter46.2-1ubuntu0.24.04.18, NVIDIA590.48.1, Wine11, stock app-local vkd3d2576c0b4adfae4a. No kernel/driver setting changed. This run used saved rendereraba888182c (SHA2562e1d7c3138bd9aa26cb37bbe3b73072e7753c8c72ba40496e92daa32f8978a9e); local source77b8fe08 adds tests/docs/comments only. The changed setting was the existing registered-copy allowance768MiB, after a real quota-exhaustion/disk-alias coherence gate passed. That does **not** establish that this setting caused the Intel hang. Texture/shader/resolution policies and all external guards stayed unchanged. The kernel-fault monitor stopped the scope; launcher155.13s/137. NVIDIA peak5119MiB, availableRAMminimum3722.5MiB, diskminimum11.939GiB, scopepeak9GiB/max1103/oom0. All152 native guard queries completed(max800.62ms), independent observermax525.49ms; this was not the NVIDIA memory cutoff or a native telemetry deadline. Last150s image was a rendered cutscene, not gameplay/FPS proof. Scope is inactive/dead, and only four snapshot/inode-matched unheld generated backing files were reclaimed. All GPU/title experiments on this host are now parked. A previous trial with another runtime also recorded an Intel desktop hang, but shared causality is unproved. No unchanged reproduction, higher limit, shader bypass, or display-stack stability claim. The root-only GPU error state could not be captured without user authorization; raw GPU dumps may contain private contents and will remain local. Exact kernel/desktop metadata/resources/stop evidence: nvidia-fork-trial-20261129T104020Z/{kernel-final.log,desktop-driver-metadata.json,verified-summary.json,error-capture-attempts.json,backing-cleanup.json}. ### Subsequent private error-state inspection The user has now captured the root-only i915 error state locally. Raw dump, decoded buffers and images remain private; no GPU workload was restarted. Offline decoding ran with device nodes hidden and network disabled. The saved active context is **Intel rcs0 / Xwayland**, not a NVIDIA title-shader instruction pointer. The captured batch head is at an end-of-batch PIPE_CONTROL cache flush/post-sync write following a rectangle draw. A flush can wait for preceding work: this does not identify the initiating shader, memory or driver defect. The old IGT decoder mislabels some Gen12 packet fields; the relevant packet lengths/fields were checked against Mesa25.2.8 Gen120 definitions, not accepted from those legacy annotations. The dump also confirms the pre-existing boot setting `i915.enable_guc=0` and execlists submission. No boot/driver setting was changed by this trial or investigation. The dump capture timestamp is45ms after the last x11grab PNG modification; kernel hang logging follows later. This temporal association is not proof that screenshot capture caused the fault. Another Raptor Lake-P report has failures with both GuC enabled and disabled (different hardware/signature): https://github.com/ublue-os/bazzite/issues/6029 . Do not treat a GuC toggle as a verified remedy. The performance/gameplay safety hold remains. Further work belongs in Intel/Mesa/Xwayland driver triage with the private dump, not another unchanged title trial or a higher memory limit.
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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/trustno1-coder--VIctory-NVIDIA!1226
No description provided.