docs: building and running this fork on Linux (cross-compile script and notes) #396

Closed
github-bot wants to merge 1 commit from gh-pr/396/head into gh-pr/396/base
Owner

@⁠Aruku448 on GitHub · 2026-11-26 22:57 UTC · original
Aruku448:docs/linux-build → main · +232 −0 · 2 files · 1 commits · closed without merging

Adds scripts/linux-cross-build.sh and docs/linux-build.md. Both are additive: no code, no behaviour change for Windows.

Why

The fork builds on Linux and runs under Wine with vkd3d-proton, and on one AMD machine it lands near the Windows reference numbers. Getting there involved several things that are not written down anywhere, and the first three cost hours.

The script

Two environment details break a plain cargo build --target x86_64-pc-windows-msvc on a Linux host:

  1. cc-rs clears INCLUDE — for the C dependencies the SDK include paths only reach clang-cl as -imsvc arguments; exporting the variable does nothing. First failure: libudis86/types.h(44,11): fatal error: 'stdio.h' file not found.
  2. Library names are case-sensitive — lld-link asks for kernel32.lib, an SDK unpacked with Windows casing holds KERNEL32.lib, and on a case-sensitive filesystem those differ. The script copies the library directories to a lowercase tree and points lld-link at it with /LIBPATH.

The script takes an xwin splat directory, generates both wrappers into target/linux-cross-tools, and runs the cargo build. Verified here end to end (--profile diag --features diagnostics → 16 MB victory.exe, 1m15s).

The notes

docs/linux-build.md records the runtime pieces: vkd3d-proton from master (the 3.0.1/3.1 releases fault inside vkCreateComputePipelines on this title's compute programs, and the 3.2.0 builds recurse without end in dxil-spirv and leave pipelines "being made" for the rest of the run), DXVK's dxgi, Microsoft's d3dcompiler_47.dll with d3dcompiler_47=n,b (Wine's builtin fails the layer's own cs_5_1 compare shader, after which nothing settles), d3d12core in the override list, and a wineserver carrying the rbtree views fix (bug 60868) — the server climbed from 31% to 71% of a core during a run without it and sits at 4-6% with it.

It also records two traps in that wineserver patch: the server must be built from the wine-staging tree of the matching version (11.22-staging expects protocol 980, upstream 11.22 generates 979, and forcing the constant hangs the title in its intro), and in a tree where process->views still holds every view, free_memory_view() must keep removing from the list unconditionally or the server walks freed memory and dies mid-run.

Measurements on that stack (RX 7800 XT, RADV 26.3.1, Wine 11.22-staging)

Prologue prison scene, world frames above 3,000 draws, median of the last 40:

Configuration median frame copies textures
play.ps1 -Safe 154.0 ms (6.5 fps) 74.2 ms 9.3 ms
-Safe + VICTORY_PORT_DESCRIPTORS=1 106.3 ms (9.4 fps) 53.5 ms —
with the patched wineserver 103.9 ms (9.6 fps) 48.0 ms —
no switches at all 2,140 ms 528.6 ms 839.5 ms
play.ps1 default set (THIN=1 …) 1,371.7 ms 425.6 ms —
-Safe + PORT_GUARD + PORT_JOURNAL 505.7 ms 236.3 ms 40.2 ms

PORT_DESCRIPTORS transfers and is worth 1.45x there; THIN is 9x slower on this stack (not memory pressure — the machine was not swapping); PORT_GUARD costs 150-370 ms rather than saving 2; PORT_JOURNAL is neutral to slightly worse; PORT_CONSTANTS black-screens on RADV (#163).

These are also in comments on #240.

Not in this PR

No attempt to fix the Linux-specific regressions above — this is only the recipe and the numbers, so that the next person does not start from zero.

**@⁠Aruku448** on GitHub · 2026-11-26 22:57 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/396) `Aruku448:docs/linux-build` → `main` · +232 −0 · 2 files · 1 commits · closed without merging Adds `scripts/linux-cross-build.sh` and `docs/linux-build.md`. Both are additive: no code, no behaviour change for Windows. ## Why The fork builds on Linux and runs under Wine with vkd3d-proton, and on one AMD machine it lands near the Windows reference numbers. Getting there involved several things that are not written down anywhere, and the first three cost hours. ### The script Two environment details break a plain `cargo build --target x86_64-pc-windows-msvc` on a Linux host: 1. **cc-rs clears `INCLUDE`** — for the C dependencies the SDK include paths only reach `clang-cl` as `-imsvc` arguments; exporting the variable does nothing. First failure: `libudis86/types.h(44,11): fatal error: 'stdio.h' file not found`. 2. **Library names are case-sensitive** — `lld-link` asks for `kernel32.lib`, an SDK unpacked with Windows casing holds `KERNEL32.lib`, and on a case-sensitive filesystem those differ. The script copies the library directories to a lowercase tree and points `lld-link` at it with `/LIBPATH`. The script takes an `xwin splat` directory, generates both wrappers into `target/linux-cross-tools`, and runs the cargo build. Verified here end to end (`--profile diag --features diagnostics` → 16 MB `victory.exe`, 1m15s). ### The notes `docs/linux-build.md` records the runtime pieces: **vkd3d-proton from master** (the 3.0.1/3.1 releases fault inside `vkCreateComputePipelines` on this title's compute programs, and the 3.2.0 builds recurse without end in dxil-spirv and leave pipelines "being made" for the rest of the run), DXVK's `dxgi`, **Microsoft's `d3dcompiler_47.dll`** with `d3dcompiler_47=n,b` (Wine's builtin fails the layer's own `cs_5_1` compare shader, after which nothing settles), `d3d12core` in the override list, and a **wineserver carrying the rbtree views fix** (bug 60868) — the server climbed from 31% to 71% of a core during a run without it and sits at 4-6% with it. It also records two traps in that wineserver patch: the server must be built from the **wine-staging** tree of the matching version (11.22-staging expects protocol 980, upstream 11.22 generates 979, and forcing the constant hangs the title in its intro), and in a tree where `process->views` still holds every view, `free_memory_view()` must keep removing from the list unconditionally or the server walks freed memory and dies mid-run. ### Measurements on that stack (RX 7800 XT, RADV 26.3.1, Wine 11.22-staging) Prologue prison scene, world frames above 3,000 draws, median of the last 40: | Configuration | median frame | `copies` | `textures` | |---|---:|---:|---:| | `play.ps1 -Safe` | 154.0 ms (6.5 fps) | 74.2 ms | 9.3 ms | | `-Safe` + `VICTORY_PORT_DESCRIPTORS=1` | 106.3 ms (9.4 fps) | 53.5 ms | — | | with the patched wineserver | 103.9 ms (9.6 fps) | 48.0 ms | — | | no switches at all | 2,140 ms | 528.6 ms | 839.5 ms | | `play.ps1` default set (`THIN=1 …`) | 1,371.7 ms | 425.6 ms | — | | `-Safe` + `PORT_GUARD` + `PORT_JOURNAL` | 505.7 ms | 236.3 ms | 40.2 ms | `PORT_DESCRIPTORS` transfers and is worth 1.45x there; `THIN` is 9x slower on this stack (not memory pressure — the machine was not swapping); `PORT_GUARD` costs 150-370 ms rather than saving 2; `PORT_JOURNAL` is neutral to slightly worse; `PORT_CONSTANTS` black-screens on RADV (#163). These are also in comments on #240. ## Not in this PR No attempt to fix the Linux-specific regressions above — this is only the recipe and the numbers, so that the next person does not start from zero.
Adds scripts/linux-cross-build.sh and docs/linux-build.md, both additive:
no code or behaviour changes for Windows.

The script works around two things that break a plain cargo build for
x86_64-pc-windows-msvc on a Linux host: cc-rs clears INCLUDE (the SDK paths
go to clang-cl as -imsvc from a wrapper), and lld-link asks for lowercase
library names while a Windows-cased SDK on a case-sensitive filesystem holds
uppercase ones (the script makes lowercase copies and adds /LIBPATH).

The notes record what running it under Wine takes — vkd3d-proton from master
(the release builds either crash in vkCreateComputePipelines or recurse in
dxil-spirv on this title's compute programs), DXVK's dxgi, Microsoft's
d3dcompiler_47.dll, and a wineserver carrying the rbtree views fix (bug
60868) along with the two traps in that patch — plus the frame times measured
on an RX 7800 XT and what each renderer port did on that stack.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:56:33 +00:00
github-bot closed this pull request 2026-11-27 00:56:33 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.