Linux: build leonida.exe and run it under Proton or Wine #2577
Closed
leonida/mandy
shadowplay711 wants to merge 0 commits from
fix/linux-install-and-launch into main
pull from: fix/linux-install-and-launch
merge into: leonida:main
leonida:main
leonida:github-pr/3295
leonida:beta
leonida:docs/changelog-3483-3500
leonida:github-pr/3294
leonida:github-pr/2975
leonida:github-pr/2815
leonida:feat/gate-driver-start
leonida:feat/skip-pipelines-release
leonida:perf/lazy-compare
leonida:perf/mwaitx-wait
leonida:test/prio-ceiling-main
leonida:fix/ab-cpu-stdout
leonida:fix/gate-old-crashes
leonida:diag/ab-cpu
leonida:test/main-0312
leonida:github-pr/3291
leonida:diag/indirect-clamp-census
leonida:feat/barrier-enhanced
leonida:perf/texture-frame-ceiling
leonida:perf/dstorage-threads
leonida:fix/console-queue-dma-tables
leonida:fix/port-descriptors-record-parts
leonida:fix/frame-waits-fence
leonida:fix/console-sampler-words
leonida:fix/graphics-userdata-spill
leonida:fix/xg-reserved-layout-rotation
leonida:fix/barrier-console-flags
leonida:fix/switches-wait-test-child
leonida:test/list-value-waits
leonida:test/lot-gxdk-0412
leonida:fix/bvh-compacted-size
leonida:docs/i18n-quickstarts
leonida:feat/native-pipeline-slots
leonida:fix/clippy-leonida-gpu
leonida:fix/list-value-producers
leonida:fix/descriptor-page-straddle
leonida:fix/xmem-low-window
leonida:fix/ffx-jitter-never-zero
leonida:fix/run-stdout-closed
leonida:github-pr/2892
leonida:github-pr/2896
leonida:feat/warm-save-every
leonida:github-pr/2980
leonida:github-pr/2994
leonida:github-pr/3005
leonida:github-pr/3010
leonida:github-pr/3136
leonida:github-pr/3303
leonida:github-pr/3220
leonida:github-pr/3143
leonida:github-pr/3330
leonida:github-pr/3226
leonida:github-pr/3187
leonida:carry/3395
leonida:github-pr/2946
leonida:github-pr/2947
leonida:github-pr/2945
leonida:github-pr/2983
leonida:github-pr/3001
leonida:github-pr/3372
leonida:github-pr/3128
leonida:github-pr/3296
leonida:github-pr/2588
leonida:github-pr/3119
leonida:github-pr/3378
leonida:fix/crash-diagnostics
leonida:feat/dlss-mip-bias
leonida:fix/retired-out-of-order
leonida:fix/dxr-postbuild-barrier
leonida:fix/amd-relay-default
leonida:fix/removed-report-wait
leonida:feat/heap-twin
leonida:feat/vram-margin
leonida:github-pr/2472
leonida:github-pr/3123
leonida:github-pr/3088
leonida:assets/annonce-v1
leonida:github-pr/2794
leonida:github-pr/3300
leonida:github-pr/3304
leonida:github-pr/3308
leonida:github-pr/3367
leonida:github-pr/3369
leonida:fix/launcher-dlss-diagnostics
leonida:github-pr/3269
leonida:github-pr/2957
leonida:github-pr/3205
leonida:fix/crash-zero-guard
leonida:github-pr/3185
leonida:github-pr/3099
leonida:github-pr/3104
leonida:github-pr/3348
leonida:github-pr/3379
leonida:github-pr/3377
leonida:perf/darner-title-priority-ceiling
leonida:github-pr/3376
leonida:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
leonida:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
leonida:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
leonida:github-pr/3373
leonida:github-pr/3368
leonida:github-pr/3198
leonida:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
leonida:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
leonida:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
leonida:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
leonida:github-pr/3346
leonida:github-pr/3375
leonida:github-pr/2958
leonida:github-pr/3151
leonida:github-pr/3307
leonida:github-pr/3278
leonida:github-pr/3374
leonida:fix/runtime-test-conservative-fixtures
leonida:github-pr/3366
leonida:ci/shard-semantic-linux
leonida:github-pr/3354
leonida:docs/fg-limit-fps-switch
leonida:github-pr/3365
leonida:fix/read-file-hard-link
leonida:github-pr/3364
leonida:fix/book-slot-heap-never-read
leonida:github-pr/3361
leonida:github-pr/3263
leonida:github-pr/3360
leonida:github-pr/3353
leonida:github-pr/3331
leonida:fix/alias-later-queued-submissions
leonida:github-pr/3352
leonida:github-pr/3228
leonida:github-pr/3349
leonida:claude/gallant-sagan-aamatr
leonida:github-pr/3200
leonida:github-pr/3132
leonida:github-pr/3323
leonida:github-pr/3332
leonida:github-pr/3340
leonida:github-pr/3311
leonida:github-pr/3334
leonida:github-pr/3297
leonida:github-pr/3256
leonida:github-pr/2567
leonida:github-pr/2851
leonida:d3d12/agility-sdk-621
leonida:github-pr/3164
leonida:github-pr/3114
leonida:github-pr/3050
leonida:github-pr/3113
leonida:github-pr/3326
leonida:github-pr/3144
leonida:github-pr/2642
leonida:github-pr/3072
leonida:github-pr/2789
leonida:github-pr/2643
leonida:github-pr/3009
leonida:github-pr/3035
leonida:github-pr/3031
leonida:github-pr/2686
leonida:github-pr/2834
leonida:github-pr/3321
leonida:github-pr/3325
leonida:github-pr/3290
leonida:github-pr/3324
leonida:github-pr/3130
leonida:claude/fervent-curie-m19lnr
leonida:github-pr/3309
leonida:github-pr/3305
leonida:github-pr/3306
leonida:github-pr/3302
leonida:github-pr/3301
leonida:github-pr/3345
leonida:github-pr/3211
leonida:github-pr/3027
leonida:github-pr/3286
leonida:github-pr/3235
leonida:github-pr/3265
leonida:github-pr/3275
leonida:codex/skip-no-hit-ray-passes
leonida:github-pr/2823
leonida:github-pr/2911
leonida:github-pr/3262
leonida:github-pr/3125
leonida:github-pr/3206
leonida:github-pr/3250
leonida:github-pr/3238
leonida:github-pr/3188
leonida:github-pr/2952
leonida:github-pr/3217
leonida:github-pr/3168
leonida:t3/preserve-fsr-sdk-restart-path
leonida:t3/propagate-host-failure-hresult
leonida:github-pr/3209
leonida:t3/launcher-custom-parameters
leonida:github-pr/3207
leonida:github-pr/3183
leonida:github-pr/3160
leonida:github-pr/3201
leonida:ci/less-to-run
leonida:github-pr/2930
leonida:github-pr/2797
leonida:github-pr/2999
leonida:perf/native-compute-shader-forms
leonida:github-pr/3191
leonida:github-pr/3011
leonida:github-pr/3019
leonida:github-pr/2996
leonida:gh-readonly-queue/main/pr-2789-45dc41f95c1cd0dcc29c2c50582e0e9af8a77259
leonida:claude/blissful-franklin-ukp7ag
leonida:github-pr/3141
leonida:github-pr/3156
leonida:github-pr/3150
leonida:github-pr/3153
leonida:github-pr/3163
leonida:github-pr/3142
leonida:github-pr/3139
leonida:github-pr/2841
leonida:github-pr/3069
leonida:github-pr/3098
leonida:github-pr/3107
leonida:github-pr/3071
leonida:github-pr/2774
leonida:github-pr/2889
leonida:github-pr/3075
leonida:github-pr/2661
leonida:github-pr/3064
leonida:github-pr/3054
leonida:github-pr/3049
leonida:github-pr/2855
leonida:github-pr/2943
leonida:github-pr/3016
leonida:github-pr/2887
leonida:github-pr/3006
leonida:github-pr/3003
leonida:github-pr/2993
leonida:notes/card-time-and-plant-flicker
leonida:github-pr/2989
leonida:feat/vulkan-rs
leonida:github-pr/2985
leonida:github-pr/2951
leonida:github-pr/2982
leonida:github-pr/752
leonida:github-pr/792
leonida:github-pr/2877
leonida:github-pr/2654
leonida:github-pr/2893
leonida:github-pr/2948
leonida:github-pr/2944
leonida:github-pr/2919
leonida:github-pr/2915
leonida:archive/ci/less-to-run/20261202T1121Z
leonida:github-pr/2800
leonida:github-pr/2822
leonida:github-pr/2833
leonida:github-pr/2840
leonida:github-pr/2831
leonida:github-pr/2832
leonida:github-pr/2801
leonida:github-pr/2890
leonida:github-pr/2891
leonida:github-pr/2664
leonida:github-pr/2807
leonida:rt-call-trace
leonida:github-pr/2755
leonida:perf/ahead-split
leonida:github-pr/2587
leonida:github-pr/2698
leonida:github-pr/2609
leonida:github-pr/3219
leonida:docs/readme-runtime-proposal
leonida:github-pr/2017
leonida:github-pr/1741
leonida:github-pr/1667
leonida:codex/coord-claim-check-20261124-7e48
No reviewers
Assignees
Clear assignees
No assignees
Labels
Clear labels
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
enhancement
New feature or request
missing claim
Needs a claim in #14
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
Projects
Clear projects
No items
No project
Milestone
Clear milestone
No items
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
leonida/mandy!2577
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/linux-install-and-launch"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Pull request closed
This pull request cannot be reopened because the branch was deleted.
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
Re-reviewed
32ae9bf82(includingf1113352and themainmerge) 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
32ae9bf82bb9fbcc8319f2762e5f2e2dcdb068fbon a desktop RTX 4070 SUPER (12 GiB), NVIDIA 620.73.04, CachyOS (kernel 7.3.6-3), and system Wine 11.22. Both offline Series S runs used vkd3d-proton71cae091and DXVK DXGI3.1.1-97-ga78a467cadb22be-pcosfrom the distro's Proton-CachyOS. Mandy, vkd3d, and driver caches started cold in separate state directories.27130ea23and only DXVK DXGI added, the 1920 × 1080 host swapchain opened and the original Wine DXGI crash was gone. The two-plane compositor failed withE_FAIL, leaving the base-plane fallback.One test issue on a system with Proton installed.
test_an_old_layout_proton_dxvk_under_lib64_is_usedlets normal discovery run, so the system-wide Proton-CachyOS outranks theproton-5.13-6fixture and starts its ownwineboot. I reproduced the failure with just this test. The complete file passed with the system Proton directory hidden (46 passed, 1 skipped). Explicitly selecting the fixture withself.run_script(str(self.game), LEONIDA_PROTON=str(proton))also made the focused case pass on the same machine. Other tests already cover automatic discovery. Affected testCachyOS retest at
7ff494f3c. I kept the system Proton-CachyOS installation visible. The old-layout DXVK case still failed at32ae9bf82, and it passed at7ff494f3c. The full launcher file improved from 36 passed, 1 failed, 10 skipped to 37 passed, 0 failed, 10 skipped.test_leonida_launcher.pyhad 22 passed and 1 skipped, andtest_shell_launchers.pyhad 7 passed. This confirms the fixture-selection fix on the affected host. The retest used temporary launcher fixtures offline.AI-assisted with Codex.
Windows 11 + RTX 3090 D3D12 & WARP Verification (
7ff494f3cf)Verified commit
7ff494f3cf345c523738a46edded871d23fe9632merged cleanly ontomain(1bc055e6c2) on Windows 11 (x86_64-pc-windows-msvc) with physical NVIDIA GeForce RTX 3090 (Ampere, D3D12 driver610.88) and WARP under the D3D12 debug layer (LEONIDA_D3D12_DEBUG=1).Red -> Green Summary
main1bc055e6c2):python -I tests/test_leonida_launcher.py->FAILED (failures=2, errors=5, skipped=3).7ff494f3cf+main1bc055e6c2):compose.rs,host.rs::root_signature,host/trainer.rs):LEONIDA_D3D12_DEBUG=1 cargo test --locked -p leonida-gpu --features diagnostics --lib -- --nocapture --test-threads=4 compose:610.88):3/3passed (D3D12 display-plane readback RGBA: [127, 0, 0, 255, 64, 127, 0, 255, 0, 0, 255, 255],0D3D12 debug-layer errors).LEONIDA_D3D12_WARP=1):3/3passed (D3D12 display-plane readback RGBA: [128, 0, 0, 255, 64, 128, 0, 255, 0, 0, 255, 255],0D3D12 debug-layer errors).LEONIDA_D3D12_DEBUG=1 cargo test --locked -p leonida-gpu --features diagnostics --lib -- --nocapture --test-threads=4 trainer:610.88):4/4passed (the_overlay_draws_the_menu_offscreenrendered cleanly,0D3D12 debug-layer errors).LEONIDA_D3D12_WARP=1):4/4passed (0D3D12 debug-layer errors).cargo clippy --locked -p leonida-gpu --features diagnostics --lib --tests:0warnings in touched files.python -I tests/test_leonida_launcher.py:20passed,3POSIX/bin/shtests cleanly skipped (OK (skipped=3)).python -I tests/test_play_linux.py:47Linux-host tests cleanly skipped (OK (skipped=47)).python -I tests/test_ci_registration.py(18 OK),python -I tests/test_runner_calls_all_tests.py(3 OK),python -I tests/test_docs_encoding.py(1 OK),python -I tests/test_text_write_line_endings.py(3 OK),python -I scripts/check_no_game_data.py(0issues), andgit diff --checkall passed cleanly.No Windows regressions found.
AI-assisted.
Verified by OreoFR
54d27d988+ PR headf1113352a(tested atf1113352a, head is now7ff494f3c)AI-assisted (Claude Code, Claude Opus 5.5).
One additional launcher edge case on
7ff494f3c(tested merged witha9e247cd6; the merge also resolves cleanly againste1d87a4a). vkd3d-proton documentsVKD3D_SHADER_CACHE_PATH=0as the switch to disable its internal shader cache. The newmkdir -ptreats it as a path and creates a literal0in the caller's directory. From a read-only working directory it exits 1 before Wine is invoked.A synthetic Wine fixture reproduced both cases. Preparing the Leonida cache/data directories unconditionally and calling
mkdir -p "$VKD3D_SHADER_CACHE_PATH"only when its value differs from0fixed both. Wine still received the literal0, and the default directory and an explicit path containing spaces still worked. With a regression case added,test_play_linux.pyran 48 tests with one skip in the isolated fixture environment. No game files used. AI-assisted with Codex.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
628f5bffdon main7b907de52, using only the changes tocompose.rsand its root-signature helper inhost.rs. Both offline Series S starts used the same launcher, copies of the same warm caches, Wine 11.22, VKD3D-Proton71cae091, and DXVK DXGI on an RTX 4070 SUPER (NVIDIA 620.73.04, CachyOS).E_FAILwhile creating the two-plane compositor (2,649 fallback messages). Sampling the D3D12 readback before Present showed the same black or nearly uniform image as Gamescope.AI-assisted with OpenAI Codex (GPT-6).
Tested this branch at 628f5bffd 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.
Independent launcher check at
628f5bffdmerged locally ontoc22a0a732. I ran the unchangedplay-linux.shagainst a synthetic Windows x64 client with System Wine 11.22 andcachyos-11.0-20261015-slr, each on AMD Raphael (RADV 26.3.1) and RTX 4070 SUPER (620.73.04). In all four runs with initialized prefixes, the client received the path containing spaces, the Series S profile, andVKD3D_SHADER_CACHE_PATH=0from a read-only working directory. The three native prefix DLLs matched their sources,--logcaptured stderr, and a fenced D3D12 copy returned 1,024/1,024 expected words each time. Two extra RADV warm starts on tmpfs covered file, dangling, and directory symlinks and preserved their targets.Concurrent-start failure reproduced. Two starts using the same initialized prefix stage
d3d12.dll.leonida-newunder a shared name. With a controlled overlap between the two copies, the second start failed withmv: cannot stat ...d3d12.dll.leonida-newbefore reaching Wine. Private staging directories let both starts finish in the regression test. The fork diff includes the fix and the test. The new test fails on this PR head, and all 82 tests pass with the fix.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).
Small follow-up on c2ffcdc97: 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
AssertionError: "with DXVK's dxgi of GE-Proton98-30" not found in "... with the bundled DXVK's dxgi (DXVK 3.1.1) ..."
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).
Re-verified by OreoFR at head
919c0a9e2on main4364a4fa6(still merges cleanly oneedd72e30): READY — red 11 fail → green 30 OK; ctest/link n/a (noruntime/change; the Rust side isleonida-gpu); head changed since the earlier verification https://github.com/ProjectLeonida/mandy/pull/2577#issuecomment-7246484467 (that was CONFLICT atf1113352a; this head merges cleanly). Windows 11, RTX 4070 Laptop 8 GB, NVIDIA 621.40. AI-assisted (Claude Code, Claude Opus 5.5).test_build_d3d12_linux.py1 failure + 2 errors,test_leonida_launcher.py2 failures + 6 errors.git merge --no-ff):test_build_d3d12_linux.py6 OK (3 skipped, POSIX shell),test_leonida_launcher.py24 OK (3 skipped),test_play_linux.py52 skipped (Linux host only, not run here).cargo test --locked -p leonida-gpu --lib544 passed, 0 failed; with--features diagnosticsandLEONIDA_D3D12_DEBUG=1,compose3/3 (including the GPU readback of the scaled premultiplied plane) andtrainer4/4 pass. These pass on main too (checked on the previous main91bab934d), so there is no Rust red on native Windows/NVIDIA: the compositor fix is for the Wine/VKD3D-Proton path, which this machine cannot run.Ready to merge per the maintainers' plan.
Linux follow-up at
919c0a9e2merged locally ontoeedd72e30, complementing the native Windows recheck above. CachyOS, Python 3.14.10.c2ffcdc97passes with an empty checkout target and fails whend3d12/target/dxvk/dxgi.dllcontains the installed CachyOS-Proton x64 DLL. At919c0a9e2, the test passes with that same file in place.628f5bffd. Both launches reach it onc2ffcdc97and on the current head.test_play_linux.py52/52,test_build_d3d12_linux.py6/6,test_leonida_launcher.py24/24 andtest_shell_launchers.py7/7. With the system tools visible, 78 passed and 11 skipped.Launcher fixtures only. AI-assisted with OpenAI Codex.
RUN: PR #2577 (Linux: Proton/Wine launch, Python scripts + D3D12 root signatures)
Heads: PR 18b72a362, main 377c45a33. Merged locally with
git merge --no-ff(clean, 14 files, nothing pushed). Since the earlier run at 919c0a9e2 the PR only changeddocs/linux.md(LEONIDA_DXVK is checked before the Proton's dxgi.dll).git merge-treeof the merged tree with #2566 (head 7b5cb2941): no conflict.Touches d3d12/ Rust (
compose.rs,host.rs,host/trainer.rs: root signatures built by hand instead of embedded in HLSL) plus Python/shell scripts, docs and three test files. The PR adds no Rust test, so there is no Rust red.Commands:
cargo test -j 6 -p leonida-gpu --lib,cargo check -j 6 -p leonida-gpu --tests.python -I -B tests/<file>.pyfortest_build_d3d12_linux,test_play_linux,test_leonida_launcher,test_docs_links. The first three skip their POSIX-shell tests on Windows (3, 52 and 3 skipped), so they were also run withpython3 -I -Bin WSL Ubuntu.Results:
tools/leonida_launcher.py; the three test files kept; Rust left as is): behavioural plus missing-file failures. WSL:test_build_d3d12_linux1 failure + 5 errors (new build and fetch scripts missing),test_play_linux58 failures + 1 error (52 tests),test_leonida_launcher2 failures + 9 errors. On Windowstest_leonida_launcheralone: 2 failures + 6 errors.test_build_d3d12_linux6 OK,test_play_linux52 OK,test_leonida_launcher24 OK. Windows: 6 OK (3 skipped), 52 skipped, 24 OK (3 skipped);test_docs_links18 OK.cargo check -p leonida-gpu --testson the merged tree: clean (warnings only).--libsuite: merged tree 544 passed, 0 failed, 47 ignored; plain main 544 passed, 0 failed, 47 ignored. No difference.Not checked: the real Proton/Wine run, and that the hand-built root signatures behave like the HLSL-embedded ones on a device (no test covers them).
Machine: RTX 3090 24 GB, NVIDIA 621.40, Windows 11 (native D3D12 target).
Tested
18b72a362merged (no commit) withmain060c47160: Windows 11, Rust toolchain fromd3d12/rust-toolchain.toml, CPU only, no game run.cargo test -p leonida-gpu --locked:main549 passed, 47 ignored; with this PR 549 passed, 47 ignored, 0 failed.cargo clippy -p leonida-gpu --locked -- -D warnings: 10 findings onmainand the same 10 with the PR (all inleonida-luaandleonida-shader); this PR adds none.mainand does not force a rebase of #2566.AI-assisted (Claude Code).
Tested
18b72a362merged withmain060c47160(tree4e1db58b3) in game on Linux, in two runs that differ only ind3dcompiler_47.dll. Setup: Radeon RX 9070 XT 16 GB (RADV GFX1201, Mesa 26.3.1), Ryzen 7 9800X3D, 30.5 GiB RAM, CachyOS, kernel 7.3.6, GE-Proton11-14 found by--find-proton. Built withscripts/build-d3d12-linux.sh, VKD3D-Proton 3.1, DXVK 3.1.1, Series X profile, 2560x1440 window,LEONIDA_DEVICE_FAULT=1.DEVICE_LOST,DEVICE_REMOVEDor0x887Alines, and dmesg shows no GPU reset, timeout or fault. Neither run has root-signature or pipeline-layout errors.d3dcompiler_47.dll(fresh prefix): the run went on for about 18 min after the world loaded, about 7 min of it with player control, and the world stayed black. Only subtitles, hints and a red dot were drawn. The log hasargument clamp: E5005: Method 'InterlockedOr' is not defined on type 'RWByteAddressBuffer'and thenno argument clamp: indirect execution dropped. Frame rate in the world: median 11.9 frames/s (1.0 to 13.9).d3dcompiler_47.dllin the prefix withd3dcompiler_47=n: the intro and the playable scene are drawn, and the run went on for 451 s in the loaded world with no crash. There are no E5005 lines.indirect execution droppedappears once, as an INFO line on the first frame. Frame rate in the scene: median 20.6 frames/s (15.6 to 22.5) at 4,400 to 5,600 draws. Also seen: purple patches on one wall, and the lighting on the character jumps once.The DLL for the second run was copied in by hand.
9a737660b, now on this branch, hasplay-linux.shinstall it (fromLEONIDA_D3DCOMPILER, ad3dcompiler/folder ord3d12/target/d3dcompiler/, else fetched byscripts/fetch_d3dcompiler.pyfrom a pinned NuGet package). The fetch was run separately and matches the pinned SHA-256 for the package and the DLL, but that path has not been run in game. #2642 addresses the same E5005 another way, with an app-local DXC.AI-assisted (Claude Code).
Linux results with the D3D12 runtime under Wine, and four findings from a weekend on it. AI-assisted (Claude Code); all measurements below are from runs on the machine named here.
Machine: RTX 4070 12 GB, NVIDIA 615.78, i7, Arch Linux, kernel 7.2. GE-Proton 11-14's Wine, VKD3D-Proton master
71cae091b(its dxil-spirv b540c8a fixes the stack overflows that left 38 pipelines unbuilt with 3.2.0), DXVK'sdxgi.dll.leonida.execross-built (clang-cl + lld-link + xwin), diag withdiagnostics,mimalloc. Series S profile, render scale 0.5. Checkout:mainat95bc33f6eplus the changes below.Where it stands here: 17-20 fps rendered in the prison gameplay, about 34 shown with DLSS frame generation (2x). Faces drawn. The opening cutscene and the bank scene are still 1-2 fps (see 4).
1. No pipeline library was ever kept under VKD3D-Proton (fixes the in-game "waiting for pipelines" and the faceless characters)
library.rsopenasks for an empty library withCreatePipelineLibrary::<_>(&[]). The windows crate passes an empty slice's dangling, non-null pointer; Microsoft's D3D12 takes that, but VKD3D-Proton refuses a non-null blob of length 0 withE_INVALIDARG(libs/vkd3d/cache.c,d3d12_pipeline_library_init:if (!blob_length && blob) return E_INVALIDARG;). Under Wine every start loggedno host pipeline library: pipelines are not kept, the early list stayed empty, and ~1,200-1,400 pipelines were made one by one when the first cutscene began (30+ s of sound over a black or frozen picture: the 0.1 fps "waiting for pipelines" reported above).Fix (null blob when empty):
With VKD3D-Proton's own shader cache on, an application's library is a dummy (its README, "Behavior of ID3D12PipelineLibrary"), so the launcher also needs
VKD3D_CONFIG=pipeline_library_app_cache. After both: the second start loaded a 448 MB library, 1,926 of 1,947 early pipelines started during the loading screen, and the cutscene played.It also fixed faces here (eyes and teeth only, head skin missing), which the LDS exemption in 804280d80 did not, even widened to all 74 programs of
compute_graph_ops,ped_standard_head_csandped_morphable_model_cs.CS_ComputeBlendshapeMappingsruns once, when a character is made; its pipeline sat behind the ~1,200 in the queue, the dispatch was dropped afterLEONIDA_PIPELINE_WAIT_MS, and the head's mapping table kept the CPU's-1s for the rest of the session. With the pipeline built during loading, faces are drawn from the first frame.2. Frame generation took a probe's motion vectors at render scale 0.5
fg.rsgbuffer_submittedkeeps the largest G-buffer pass of a frame. At render scale 0.5 the view is 960x540, smaller than the 1024x1024 square probe pass, so from the probe's first frame every generated frame used the probe's depth and motion vectors: heavy ghosting. Square passes ranked last:The log then shows
another G-buffer pass of the frame, no larger than the one kept, passed over n=1 size=[1024, 1024] kept=[960, 540], and the ghosting is gone but for some on fast turns (14-20 rendered frames a second is a low base for DLSS-G).DLSS-G itself works under Wine: Streamline 2.14.16's plugins pass their signature checks, status 0. It needs GE's
nvapi64.dll/nvofapi64.dlland the driver's/usr/lib/nvidia/wine/nvngx.dll,_nvngx.dllin the prefix's system32,HKLM\SOFTWARE\NVIDIA Corporation\Global\NGXCoreFullPath=C:\Windows\System32, andDXVK_ENABLE_NVAPI=1. ThesetDynamicMFGParamsandSetReflexSyncerrors it logs on an RTX 40 card are harmless.LEONIDA_FG_LIMIT_FPS=28would cap a PC rendering ~20 at 14; I run it at 0.3. The frame recorder crashed VKD3D-Proton
LEONIDA_RECORD'sgocalled the originalExecuteCommandListswith the shimmed lists, and VKD3D-Proton read their vtables (crash ind3d12core). Restoring each list's original vtable around that one call (replay::hook::bare, thenrecord.rsexecutewraps the call in it) makes recording work under Wine. Happy to open a PR for this one.4. Why the heavy scenes are slow under Wine (measurements, not fixes yet)
VirtualProtecttakes one lock for the whole address space (the one its fault handler andVirtualQuerytake). A test program under GE-Proton: protect + unprotect a page, 2.6 us with one thread, 64 us with eight; a guard fault opened by it 4.4 us against 78 us. In the opening cutscene the guards fault 400-570 times a frame and make 1,100-1,700 blocks read-only (A/B of 4 s phases:GUARD_HOT,PORT_GUARD,PAGE_ASKmade no measurable difference there).LEONIDA_FAULT_BOOK): most blocks taken once or twice in 40 frames (streamed data, not hot blocks). The runtime's own most frequent fault site wasdescriptor::record(the title's thread creating views of streamed textures, writing 12 bytes into the guarded heap). I now write it throughwatch::put_beside, which leaves about one fault per heap block a frame (the 32-share limit). The rest are the title's own stores andmemcpy.syscallnever reaches Linux under GE-Proton: Wine dispatches it as an NT system call (syscall10 returnsSTATUS_INVALID_HANDLE). So I built a small Wine unixlib (a builtin-marked DLL with a.so) to call Linux directly, and tried two kernel paths in place of the guards: userfaultfd async write-protect withPAGEMAP_SCAN(0.16 us a page written against 4.3-4.8 for a guard fault in a test program, but asking it per query cost ~200 ms a frame, and batching by time loses writes), and synchronous userfaultfd write-protect with our own handler thread (same semantics as the guards). Both work in the game and passwatch::tests; neither beat the guards in the heavy scenes. What is left there is the kernel's own cost of taking write access away from pages in a ~300-thread process (TLB shootdowns:native_flush_tlb_one_user,smp_call_function_many_condin a perf profile) and the threads waiting on the guards' lock meanwhile, whatever does it. The next thing I am trying: fewer protection changes (in batches, outside the lock, and not guarding freshly streamed blocks until they are used again).Notes for the Linux launcher: precompiling (
leonida shaders+leonida warm) before play took the in-game builds from minutes to seconds here;VKD3D_DISABLE_EXTENSIONS=VK_EXT_descriptor_heapwas faster on NVIDIA (15.5-17.5 fps against 10-13 with the new heap path); and the title's hang watchdog (+0x2215c35) fires during long first-run stalls unless disarmed.@eodclxvi thanks, your finding 1 is the same bug as #2654, which I opened last night (claim: https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7263775300). Same fix: a null blob for the empty library through the raw vtable call, plus a log line where
make(&[]).ok()?used to drop the error. merzleckeier's A/B there (RTX 4070 SUPER and RADV) showsa_rejected_blob_gives_an_empty_library,depth_bounds_pipeline_loads_and_filters_drawsanda_mesh_pipeline_loads_from_the_libraryfailing on main and passing with it. If you'd rather your own version went in, say so there, so we don't end up with two.The
VKD3D_CONFIG=pipeline_library_app_cachepoint isn't in #2654: that's launcher territory, so it would fitplay-linux.shhere, @shadowplay711, if you want it in this PR. On my RTX 3070 (NVIDIA 610.57.04, Proton Hotfix) the null-blob fix alone gave a library that saves and reloads (loaded=34 made=0on the second start), but I haven't measured with and without that setting, so I can't say yet how much it adds.AI-assisted (Claude Code).
Thanks. I'll leave finding 1 to #2654.
I've kept
pipeline_library_app_cacheout ofplay-linux.sh. In VKD3D-Proton it sets the same flag asVKD3D_SHADER_CACHE_PATH=0(PIPELINE_LIBRARY_APP_CACHE_ONLYindevice_workarounds.c, andvkd3d_pipeline_library_init_disk_cachereturns early on it). That turns off VKD3D-Proton's own cache, which the script keeps in<LEONIDA_CACHE_DIR>/vkd3d-proton. With that cache on, the pipeline library is the dummy one from the VKD3D-Proton README, and yourloaded=34 made=0shows it already saves and reloads with #2654. If you want the app-cache-only mode, setVKD3D_SHADER_CACHE_PATH=0. The script passes it through, and 78ce620 documents this indocs/linux.md.AI-assisted (Claude Code).
@shadowplay711 the structurizer check in play-linux.sh picks an older VKD3D-Proton over a newer one here.
vkd3d_new_structurizer(scripts/play-linux.sh:120) looks for the stringlegacy_structurizerin d3d12core.dll. On this machine:files/lib/wine/vkd3d-proton/version): no longer has it, so it is passed over, also whenLEONIDA_PROTONnames GE-Proton11-15. The start line then reads "under GE-Proton11-15 … with … the VKD3D-Proton of hotfix-20261110".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
watch::install::on_writeper leonida.pdb, the vectored handler that runs once the stack is already gone) and the overlay stuck at "7 LEFT", like your "6 LEFT" run.RUST_MIN_STACK=16777216didn't help: the threads had 16 MB and still used all of it. WithLEONIDA_VKD3Dpointing at GE-Proton11-15'sx86_64-windowsfolder: 0 stack overflows, nothing stuck, 57-60 fps in the world. That matches eodclxvi's note that 71cae091b's dxil-spirv fixes these overflows.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
versionfile, or a marker only newer builds carry, might hold up better.Separately, for the
pipeline_library_app_cachequestion: I triedVKD3D_CONFIG=pipeline_library_app_cachewith Proton Hotfix's VKD3D-Proton, and the first start crashed invkCreateComputePipelines(0xc0000005) on a compute shader that built fine twice in the default mode. So leaving it out of the script was right here.RTX 3070 8 GB, NVIDIA 610.57.04, Arch Linux (kernel 6.18 LTS), #2577 at 919c0a9e2 plus #2654's fix. AI-assisted (Claude Code).
@kuzeyc thanks, that was right: VKD3D-Proton v3.1-97 (71cae091b, "Remove the legacy structurizer entirely") took the
legacy_structurizername out with the legacy structurizer, so the check took the newest builds for old ones.The check now reads the build too:
v<major>.<minor>-<n>-g<commit>fromd3d12core.dllor theversionfile beside it (GE-Proton writesv3.1-83-gcae8353ed-GE-Protoninto the DLL),vkd3d-1.1-<n>-g<commit>, the form Proton writes intofiles/lib/wine/vkd3d-proton/version; on VKD3D-Proton's masterv3.1isvkd3d-1.1-5686, so Proton Hotfix'svkd3d-1.1-5729-g00b6ef057isv3.1-43and 71cae091b isvkd3d-1.1-5783,A build counts as having the new structurizer when it still names the option or is
v3.1-22or later (the option came in with 3f6a2c71,v3.1-22), or is a release from 3.2 on. VKD3D-Proton 3.1 still does not.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
v3.1-97whetherLEONIDA_PROTONis unset, GE-Proton11-15 or Proton Hotfix. The tests cover each version form and that choice, and docs/linux.md says how it works.On
pipeline_library_app_cache: thanks for trying it, it stays out of the script.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
--target x86_64-pc-windows-msvc): the D3D12 runtime now plays the title at a stable 15-20 fps driving through towns and the highway with no fps drops. What it took, so others can skip the month:Binaries that are load-bearing
vkCreateComputePipelines(Wine receipts0xc000001d) at world entry; dxil-spirv's structurizer rewrite71967a38ais the fix and no release contains it yet. (Symptom family matches vkd3d-proton#2872.)dxcompiler.dll(DXC 1.9.2609) next toleonida.exe— Wine's builtin d3dcompiler_47 refuses the runtime HLSL helpers; see my comment on #2642 for the black-world consequence, and #2642 itself makes this obsolete when it lands.(NULL, 0)fix (PR incoming from us; see #2766 comment for the sibling sampler finding).Env set that differs from upstream defaults (everything else we keep at upstream defaults, including the ps1's
LEONIDA_PAIRED_FOR/LEONIDA_SKIP_PIPELINESsets from804280d80/0bc6e21a1verbatim)LEONIDA_PIPELINE_WAIT_MS=100withLEONIDA_PIPELINE_WAIT_ONCE=0— after the library loop works, the 500 ms default wait IS every remaining drop (spikes 300-590 ms = one first-encounter make each); 10000 froze frames into the title watchdog, 500 is stuttery.WAIT_ONCE=0re-arms the wait every frame, which is what lets the world light as soon as the backlog drains (ONCE mode was a black-world cause).LEONIDA_NULL_SAMPLER_LINEAR=1— character faces (see my #2766 comment).LEONIDA_STATIC_SAMPLERS_LINEAR=PS_Composite— older face-channel fix.LEONIDA_ASYNC_SUBMIT=1andLEONIDA_COPY_SCOPED=1set once for the whole run (measured -15.4 % mean frame time, 6/6 mirror pairs negative); never flip either mid-window — only the mid-run ON->OFF flip poisons a run.LEONIDA_CARD_RESERVE_BUDGETS=1(#2589 family, weak positive),LEONIDA_MAP_THREADS=1,LEONIDA_DYNAMIC_SLOTS=524288,LEONIDA_D3D12_DRED=faults,LEONIDA_CARD_SPANS=1measurement-only.Discipline that matters more than any switch
vkCreate); starting through the opening cinematic is free compile time. The library compounds per clean window: 448,760 -> 605,624 -> 641,336 bytes, and drops thin with it.nvngx_dlss.dllinit refuses (0xbad00001, no NVAPI surface); interim arm is staging dxvk-nvapinvapi64.dll.Why the remaining 15-20 fps is winnable on CPU: with
LEONIDA_CARD_SPANS=1, even 3 fps frames show 32-44 ms of card work and 136-166 ms of card idle between ~18 submissions — the GPU waits on us, not the reverse.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
202b9652b+ed867d7b2. The actual shell entry point updated a disposable prefix, installed the selected DLLs, then launched a small Win64 probe with a synthetic path containing a space. The probe opened that placeholder path and created a real D3D12 device on AMD RADV (default Series S) and RTX 4070 SUPER (explicit Series X). It also verified that explicitLEONIDA_COPY_SCOPED=0survived whileLEONIDA_PORT_DESCRIPTORSdefaulted to1. All four installed DLLs matched the input files byte for byte. Across the three Python launcher/build suites there were 72 passes and 19 skips. The executed binary was a probe supplied viaLEONIDA_RUNTIME, so the full runtime build and gameplay are outside this run.AI-assisted with OpenAI Codex.
@shadowplay711 could you say why this was closed? It had an approval, and several of its fixes still apply to
main(a917c54d6) under system Wine on NVIDIA: DXVK'sdxgi, the VKD3D-Proton structurizer check, and the cache path. If it was superseded or there was a problem with the approach, knowing which would keep others from redoing it. D3D12-LINUX-PLAY-PROTON and D3D12-LINUX-WINE-TUNING on #2570 now claim parts of the same script.AI-assisted (Claude Code, Claude Opus 5.5).
I deleted my fork of the Main repo. Unfortunately i didn't know that when also the PR will be closed.
At least all commits and File changes are still recorded under this PR, even when it's closed. Feel free to use these..