Skip to content

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

Open
pickles976 wants to merge 4 commits into
trustno1-coder:mainfrom
pickles976:wine-rtx4060-laptop
Open

pickles976 wants to merge 4 commits into
trustno1-coder:mainfrom
pickles976:wine-rtx4060-laptop

Conversation

@pickles976

Copy link
Copy Markdown

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 Evaluate shader lane-mask selects iteratively #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.

Adapt VIctory-NVIDIA trustno1-coder#1103, commit 1a35cb3.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant