Repository navigation
Linux: build leonida.exe and run it under Proton or Wine - #2577
shadowplay711 wants to merge 13 commits into
Conversation
scripts/build-d3d12-linux.sh builds leonida.exe with cargo-xwin and fetches VKD3D-Proton and DXVK's dxgi.dll (scripts/fetch_dxvk.py, DXVK 3.1.1, SHA-256 pinned). play-linux.sh finds leonida.exe in a checkout and runs it under the usable Proton build with the highest version, else under the system's Wine (LEONIDA_PROTON and LEONIDA_WINE choose). Every folder with files/bin/wine and files/lib/wine in the Steam and system folders counts as a usable Proton build. DXVK's dxgi comes from that Proton or, when it has none and under the system's Wine, from LEONIDA_DXVK, the package, the distribution or another Proton. It keeps the prefix in sync with the Wine in use, takes a VKD3D-Proton with the new dxil-spirv structurizer from any installed Proton build, keeps the shader cache out of the repo and can write stderr to a log file (--log). --find-proton prints the Proton or Wine it would use and --list-protons every usable Proton build. The launcher's Proton or Wine setting on Linux lists the usable Proton builds, highest version first and the first as the default, and "System Wine", with Browse for another folder; a line below appears only when that folder cannot be used. Tools runs the Linux build script, and PLAY passes --log on Linux. The present composer and the trainer menu build their root signatures in code, serialized as version 1.1, instead of from a [RootSignature] shader attribute that Wine's d3dcompiler ignores. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The header of scripts/play-linux.sh names the Proton builds it runs under, DXVK's dxgi.dll and the --log, --find-proton and --list-protons options. The SAFETY comment of the trainer pipeline no longer says the root signature is inside the shader blobs, since it is now built in code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lixonik
left a comment
There was a problem hiding this comment.
Reviewed c99f7d131 merged locally with main c1ecf04ed. On Ubuntu 22.04 under WSL2, using synthetic Proton/Wine fixtures, all 70 checks passed across test_play_linux.py (42), test_leonida_launcher.py (21), and test_shell_launchers.py (7). Both shell scripts pass dash -n, and the changed files pass check_no_game_data.py.
One additional fixture reproduced the launch issue below. Coverage here is the launcher and shell paths with stub Wine processes.
AI-assisted.
A Proton build with only files/lib64/wine counted as usable, but its DXVK dxgi.dll and VKD3D-Proton were looked for only under files/lib, and WINEDLLPATH and LD_LIBRARY_PATH named only files/lib. play-linux.sh now looks for both under files/lib and files/lib64 (with and without the x86_64-windows folder), puts files/lib64/wine, files/lib64/vkd3d and files/lib64 first in the paths and checks both for the prefix's vkd3d libraries. Tests cover a Proton with only files/lib64, one with both and the older layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The launcher's settings keep both the new Windows options of main (series_s, dlss_mode, frame_gen, aspect, present_scale, adapter, background) and the Linux proton_dir setting with SYSTEM_WINE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lixonik
left a comment
There was a problem hiding this comment.
Re-reviewed 32ae9bf82 (including f1113352 and the main merge) and re-tested on Ubuntu under WSL2.
Code audit:
scripts/play-linux.sh:proton_dxvk,proton_new_vkd3d,WINEDLLPATH,LD_LIBRARY_PATH, and the prefixlibvkd3d-1.dllcheck now handle bothfiles/libandfiles/lib64(withlib64ordered first and older non-x86_64-windowslayouts supported).tests/test_play_linux.py: the 5 new fixtures cover lib64-only, both-roots ordering, and old-layout DXVK/VKD3D-Proton discovery.
Verification (Ubuntu under WSL2, synthetic Proton/Wine fixtures):
dash -n scripts/play-linux.sh: passed.python3 -I tests/test_play_linux.py -v: 47/47 passed (1.62 s).python3 -I tests/test_leonida_launcher.py -v: 23/23 passed (0.14 s).python3 -I tests/test_shell_launchers.py -v: 7/7 passed (0.09 s).python -I scripts/check_no_game_data.py: passed.
AI-assisted (Antigravity, Gemini).
|
I verified this PR at
One test issue on a system with Proton installed. CachyOS retest at AI-assisted with Codex. |
The test let the normal Proton search run, so a Proton installed on the machine ranked above the proton-5.13-6 fixture, was started instead and failed the test. The test now sets LEONIDA_PROTON to its fixture; the search itself is covered by the other tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Windows 11 + RTX 3090 D3D12 & WARP Verification (
|
|
Verified by OreoFR
AI-assisted (Claude Code, Claude Opus 5.5). |
|
One additional launcher edge case on A synthetic Wine fixture reproduced both cases. Preparing the Leonida cache/data directories unconditionally and calling |
vkd3d-proton reads VKD3D_SHADER_CACHE_PATH=0 as the switch that turns its shader cache off. The launcher created the folder for every value, so with 0 it made a folder named 0 in the working directory, and from a read-only working directory mkdir failed and the launcher stopped before Wine ran. The Leonida cache and data folders are still created; the shader cache folder only when the value is not 0. Wine still gets the 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
timbot103
left a comment
There was a problem hiding this comment.
Static audit of 0299208f3 against 48bae6cad. Both shell scripts passed syntax checks. Real Wine, cross-build, and GPU verification are covered by the earlier reports on their stated revisions.
scripts/play-linux.sh:364— Installing DXGI withcpcan overwrite the target of a prefix DLL symlink or abort on a dangling link. Stage and atomically replace the prefix DLL entry for each of the three DLLs.scripts/play-linux.sh:365— Wine honors the last duplicate override. Appending inherited overrides lets an existingdxgi=bdefeat the required DXVK selection. Put the required native rules last.scripts/build-d3d12-linux.sh:35— Pin the output directory passed to Cargo or resolve its configured path. A custom target directory currently leaves the build check looking at a missing or stale executable.scripts/build-d3d12-linux.sh:60— A failed late license download leaves a DLL that makes the next rebuild skip the fetch. Publish complete DXVK and VKD3D bundles and check completion before skipping.tools/leonida_launcher.py:223— Selecting the first named Proton can still use an inherited runner override. Give automatic selection its own entry and store the actual runner for named choices.scripts/play-linux.sh:206— ClearCDPATHbefore resolving relative paths. A nonempty search entry can put two lines into the Proton path.
AI-assisted.
… last play-linux.sh stages each of d3d12.dll, d3d12core.dll and dxgi.dll beside its prefix entry and renames it into place, so a symlinked entry is replaced instead of its target being overwritten, and a dangling one no longer stops the start. The required native overrides now follow any inherited WINEDLLOVERRIDES, because Wine keeps the last rule for a DLL and an inherited dxgi=b would otherwise win over DXVK. CDPATH is cleared, so a relative LEONIDA_PROTON resolves to one folder. build-d3d12-linux.sh passes --target-dir d3d12/target to Cargo, so a custom CARGO_TARGET_DIR or build.target-dir no longer leaves the check looking at a missing or stale leonida.exe. fetch_dxvk.py and fetch_vkd3d_proton.py fetch every file before writing any and write SOURCE.txt last; the build script fetches again unless the DLLs, the license files and SOURCE.txt are all there. The launcher's Proton or Wine list gets its own "Automatic" entry, and each named Proton stores its folder, so choosing the newest one by name no longer leaves an inherited LEONIDA_PROTON or LEONIDA_WINE in charge. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lixonik
left a comment
There was a problem hiding this comment.
Re-reviewed 628f5bffd (0299208f3 + 628f5bffd).
All follow-up items are cleanly addressed:
scripts/play-linux.sh: leavesVKD3D_SHADER_CACHE_PATH=0untouched without creating a literal0directory, clearsCDPATH, stages and atomically replaces prefix DLLs (install_dll, safe against symlinks and dangling links), and appendsd3d12,d3d12core,dxgi=nafter inheritedWINEDLLOVERRIDES.scripts/build-d3d12-linux.sh: passes--target-dir "$d3d12/target"and checks complete bundle files includingSOURCE.txt.tools/leonida_launcher.py: adds an explicitAutomaticentry and clears inheritedLEONIDA_WINEwhen a named Proton folder is selected.
Local verification (Windows 11, Python 3):
python -I tests/test_leonida_launcher.py -v: 21 tests ran, OK (3 skipped: POSIX shell script tests).python -I scripts/check_no_game_data.py: passed.
AI-assisted (Antigravity, Gemini).
|
I isolated the Series S compositor changes from
AI-assisted with OpenAI Codex (GPT-6). |
|
Tested this branch at 628f5bf on NVIDIA under Proton: it gets into the world. Machine: RTX 3070 8 GB, NVIDIA 610.57.04 (kernel 6.18.65-lts), Ryzen 5 7600X, Arch Linux. Proton Hotfix (hotfix-20261110), picked by play-linux.sh by itself; GE-Proton11-15 and Proton Experimental also installed. Fresh LEONIDA_WINEPREFIX. leonida.exe from build-d3d12-linux.sh (diag, diagnostics,mimalloc) with cargo-xwin.
Not tested: the system-Wine path (LEONIDA_WINE), the distribution-DXVK lookup. AI-assisted (Claude Code). |
|
Independent launcher check at Concurrent-start failure reproduced. Two starts using the same initialized prefix stage These runs used offline synthetic inputs. Headless Gamescope on NVIDIA exited with status 139 during teardown, after the launcher had already returned 0. AI-assisted with OpenAI Codex (GPT-6). |
install_dll copied every DLL to one fixed name beside it in system32 (d3d12.dll.leonida-new) before moving it into place. Two starts on the same prefix shared that name: the second removed or overwrote the first's copy, and the first stopped with "mv: cannot stat" before Wine ran. Each copy now goes into a folder of its own made with mktemp in the same system32, so the move stays a rename on one file system and the folder is removed after it. A test holds the first start inside its copy of d3d12.dll, runs a second start on the same prefix to the end, then lets the first finish: both succeed, the prefix has the current DLLs and no staging entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Small follow-up on c2ffcdc: the DLL staging change looks fine, and tests/test_play_linux.py passes (52, 1 skipped), but only after I moved my build output aside. With d3d12/target/dxvk present in the checkout (left by build-d3d12-linux.sh / fetch_dxvk.py), one test fails: FAIL: test_a_proton_without_dxvk_runs_with_the_dxgi_of_another The Proton tests run the real script (tests/test_play_linux.py:350, SCRIPT = ROOT / "scripts" / "play-linux.sh"), so its $root is the real checkout, and find_dxgi takes "$root/d3d12/target/dxvk" before it looks at other Protons. The tests that copy play-linux.sh into a temporary repo (line 95) don't have this problem. Running the Proton tests from such a copy too, or pointing LEONIDA_DXVK at a temporary folder there, would keep them from depending on what the checkout has built. With d3d12/target/dxvk moved aside: all 52 pass. AI-assisted (Claude Code). |
The Proton tests ran scripts/play-linux.sh from the checkout, so the script looked for its bundled DXVK, VKD3D-Proton and leonida.exe in the checkout's scripts/ and d3d12/target/. A d3d12/target/dxvk left by build-d3d12-linux.sh or fetch_dxvk.py was taken before another Proton's dxgi.dll and made test_a_proton_without_dxvk_runs_with_the_dxgi_of_another fail. Each Proton test now copies the script into its temporary folder, as the other play-linux.sh tests do. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@eodclxvi thanks, your finding 1 is the same bug as #2654, which I opened last night (claim: #2570 (comment)). Same fix: a null blob for the empty library through the raw vtable call, plus a log line where The AI-assisted (Claude Code). |
VKD3D-Proton treats VKD3D_SHADER_CACHE_PATH=0 like VKD3D_CONFIG=pipeline_library_app_cache: it keeps no shader cache of its own, and the D3D12 pipeline library stores the SPIR-V and the driver's pipeline cache. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks. I'll leave finding 1 to #2654. I've kept AI-assisted (Claude Code). |
|
@shadowplay711 the structurizer check in play-linux.sh picks an older VKD3D-Proton over a newer one here.
With the Hotfix build, every start had 7 "stack overflow" lines in the first 10 s of pipeline building (all at the same address, in So the marker seems to have gone with the old structurizer, and the newest builds now look "old" to the check. Reading the build from the Separately, for the RTX 3070 8 GB, NVIDIA 610.57.04, Arch Linux (kernel 6.18 LTS), #2577 at 919c0a9 plus #2654's fix. AI-assisted (Claude Code). |
… newest play-linux.sh took a d3d12core.dll as having dxil-spirv's new structurizer only when it names the legacy_structurizer option. VKD3D-Proton v3.1-97 removed the legacy structurizer and with it that name, so the newest builds, such as the one in GE-Proton11-15, were passed over as too old and an older build of another Proton was taken instead. The check now also reads the build: as v<major>.<minor>-<n>-g<commit> from the DLL or the version file beside it, else as vkd3d-1.1-<n>-g<commit>, the form Proton writes in that file (v3.1 is vkd3d-1.1-5686), else from the release number the DLL carries. A build from v3.1-22 on, where the option first appears, or a release from 3.2 on counts as having it. When the bundled VKD3D-Proton lacks the new structurizer, the newest such build among the Proton in use and the other Protons found is taken, the Proton in use first among equal builds; a build known only by the option name ranks as v3.1-22. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@kuzeyc thanks, that was right: VKD3D-Proton v3.1-97 (71cae091b, "Remove the legacy structurizer entirely") took the The check now reads the build too:
A build counts as having the new structurizer when it still names the option or is When the bundled one lacks it, the script now takes the newest qualifying build among the Proton in use and the other Protons found, not the first one by Proton name, with the Proton in use first among equal builds. With your three builds that is GE-Proton11-15's On |
Wine's builtin d3dcompiler (the vendored vkd3d-shader) refuses our runtime HLSL helpers: RWByteAddressBuffer member methods fail E5005 and the [RootSignature] attribute is dropped, so every world-fill pass dies silently and the composite samples never-written planes - black world, UI fine. Compile through DXC (*_6_0) on refusal or a missing RTS0 chunk, and build the composer/trainer root signatures programmatically through D3D12SerializeVersionedRootSignature v1.1 instead of the HLSL chunk. Same direction as open upstream PRs ProjectLeonida#2642 and ProjectLeonida#2577; carried here so play windows work while they sit unmerged.
Wine's builtin d3dcompiler (the vendored vkd3d-shader) refuses our runtime HLSL helpers: RWByteAddressBuffer member methods fail E5005 and the [RootSignature] attribute is dropped, so every world-fill pass dies silently and the composite samples never-written planes - black world, UI fine. Compile through DXC (*_6_0) on refusal or a missing RTS0 chunk, and build the composer/trainer root signatures programmatically through D3D12SerializeVersionedRootSignature v1.1 instead of the HLSL chunk. Same direction as open upstream PRs ProjectLeonida#2642 and ProjectLeonida#2577; carried here so play windows work while they sit unmerged.
|
Measured Linux play baseline from one month of factory work (CachyOS host, RTX 4090, NVIDIA 620.73.04, host Wine 11.23, cross-build via cargo-xwin Binaries that are load-bearing
Env set that differs from upstream defaults (everything else we keep at upstream defaults, including the ps1's
Discipline that matters more than any switch
Why the remaining 15-20 fps is winnable on CPU: with AI-assisted factory work; happy to upstream the launcher env defaults as a docs page if wanted. |
|
Ran play-linux.sh through system Wine with a real offscreen D3D12 probe at AI-assisted with OpenAI Codex. |
What and why
On Linux, PLAY runs
scripts/play-linux.sh, which only looked forleonida.exebeside itself, and nothing in a checkout built it:./Build.shbuilds the Vulkan loader, notd3d12/. The script also started the system'swinewith Wine's owndxgi.dll(onwined3d), which crashed the game when it created its swap chain;docs/boot.mdrequires DXVK'sdxgi.dll. Under Proton the picture then stayed black: the two-plane composer and the trainer menu took their root signatures from a[RootSignature]shader attribute that Wine'sd3dcompiler_47(vkd3d-shader) ignores (W5302: Ignoring unknown attribute "RootSignature"), soCreateRootSignaturefailed withE_FAIL, the composer was never made and only the base plane was presented. The runtime is now built on Linux, runs under any installed Proton build or the system's Wine with DXVK'sdxgi.dlland a VKD3D-Proton that has dxil-spirv's new structurizer, presents both planes and can write its output to a log file.scripts/build-d3d12-linux.sh(new): cross-buildsleonida.exewith cargo-xwin and fetches VKD3D-Proton and DXVK'sdxgi.dllintod3d12/target/. It stops before any download unlessXWIN_ACCEPT_LICENSE=1accepts Microsoft's SDK licence.scripts/fetch_dxvk.py(new): fetches the 64-bitdxgi.dllof DXVK 3.1.1 with its licence and a source note, checked against pinned SHA-256 sums.scripts/play-linux.sh:d3d12/target/. Its errors name the command that builds or fetches them.LEONIDA_PROTON, elseLEONIDA_WINE, else the usable Proton build with the highest version, elsewineonPATH. Every folder withfiles/bin/winecounts as a Proton build, whatever its name, in the Steam folders (including Flatpak, Snap,libraryfolders.vdfandSTEAM_EXTRA_COMPAT_TOOLS_PATHS) and the system'scompatibilitytools.d; it is usable when it also hasfiles/lib/wine, andLEONIDA_PROTONnaming another one is refused with the reason. Without any Proton or Wine it stops and says what to install.--find-protonprints the Proton or Wine it would use,--list-protonsevery usable build.dxgi.dllfrom that Proton or, when it has none and under the system's Wine, fromLEONIDA_DXVK, the package, the distribution's DXVK or another Proton. Copies it into the prefix and setsdxgi=n.d3d12core.dllhas no new structurizer, uses VKD3D-Proton from the Proton in use or, if that one lacks it too (such as proton-cachyos 11.0-20261015), from another installed Proton build that has one. The start banner names the Wine, the DXVK and the VKD3D-Proton in use.--logwrites the output to~/.local/share/leonida/logs/play-MMdd-HHmmss.log, beside the prefix, and keeps the five newest logs.d3d12/crates/leonida-gpu/src/host.rs:root_signatureserializes a root signature from parameters and static samplers withD3D12SerializeVersionedRootSignatureas version 1.1, the version the HLSL compiler builds for a[RootSignature]attribute, and creates it.d3d12/crates/leonida-gpu/src/compose.rs: the descriptor table of two SRVs att0(pixel stage, range flagDATA_STATIC_WHILE_SET_AT_EXECUTE) and the linear, clamping static sampler ats0are described in code with the values the attribute declared; the attribute and its#defineare removed from the shader source.d3d12/crates/leonida-gpu/src/host/trainer.rs: eight root constants atb0and a descriptor table of one SRV att0, described the same way; the attribute and its#defineare removed.--logwhen chosen. Settings has a Proton or Wine list (Linux only) with the usable Proton builds, highest version first, and "System Wine"; the first entry is the default. Browse picks another Proton folder, and a line below the list appears only when that folder cannot be used. On Linux the logs and captures folders are under~/.local/share/leonida, the same folder as the prefix. Tools, Rebuild the runtime runs the new build script on Linux after a licence confirmation. Windows behavior of the launcher is unchanged.tests/test_play_linux.py(new) runs the script against Proton folders and a Wine it creates;tests/test_leonida_launcher.pycovers the Proton or Wine setting, the list entries, the Linux data folders and the Linux commands.docs/linux.md,docs/launcher.md,docs/boot.md.Tested
python -I tests/test_play_linux.py,python -I tests/test_leonida_launcher.py,python -I tests/test_shell_launchers.py: pass.scripts/play-linux.sh --list-protonslists GE-Proton11-14, Proton Experimental, proton-cachyos 11.0-20261015 and dwproton-11.0-17, and leaves out an incomplete Proton-Wineland folder (nofiles/lib/wine).leonida.exewithscripts/build-d3d12-linux.shand started it from the launcher under GE-Proton11-14 on CachyOS Linux, RX 9070 XT, Mesa 26.3.1-arch3.5: both planes are presented, the trainer menu opens.GPUs tested: n/a (the GPU tests in runtime/test were not run)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a)🤖 Generated with Claude Code