Linux/Proton on AMD (RX 7900 XT, RADV): in-game like on Windows; what it takes (wineserver view list, d3dcompiler, AMD faults) #184
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork#184
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@datingesp-hash on GitHub · 2026-11-24 22:18 UTC · original
Thank you for the fork. It's the first build that renders the world on my machine. Under Linux/Proton it now gets into the game the same way it does on Windows. Below is what it took and what I measured along the way, so others on Linux can get there too.
Setup: RX 7900 XT (RDNA3, Navi31), Mesa 26.3.1 RADV, Ryzen 9 9900X, 30 GB, CachyOS kernel 7.3.5. GE-Proton11-14 (wine-11.0 staging; vkd3d-proton v3.1-83-gcae8353ed-GE), its
winerun directly, withVKD3D_CONFIG=descriptor_heap. Series X files, 1.0.2.1. Fork at4e17478(earlier004bf69,1684989), release build, unmodified except where noted. My launcher is a script that builds the fork with cargo-xwin and runs it under bwrap, with the game folder read-only.Where it stands now: with the points below it behaves like the fork on Windows. The opening cutscenes play, and the prison prologue renders with textures and sunlight: the yard, the buildings, inmates, Lucia's hair and clothes. The player can move the camera and walk. Faces and skin are missing (only teeth and lashes show), some walls are missing, and shadowed areas are black, as the README describes.
In short, on Linux it needs:
d3dcompiler_47, or a DXC fallback (section 2). Without it the world is black.VKD3D_CONFIG=descriptor_heap. Without it vkd3d-proton caps the view heap at 1,000,000; the title asks for 1,245,184, and the GPU faults about 45 s in.VICTORY_SKIP_PIPELINES=fc5e66f8f873d3bb, and not the late-wait switches (sections 3-4).1. wineserver walks a list of every mapped view on each map and unmap (the main Linux-only problem)
In the world, texture refreshes cost 0.2-3 s per frame. Almost all of that was the line "waiting for title memory to hold still (the runtime remapping it)", meaning the
title_memory_remappingwrite lock. I timedxmem.rswith counters aroundmap,unmapand the lock:map_alias(the GPU page-mapping copies). Each is one 64 KiB page: I tried merging consecutive pages into runs, and the average run was 1.0 pages.MapViewOfFile3cost 450-900 µs and eachUnmapViewOfFile2300-500 µs. The remap lock was held 460-930 ms of every second.memfd:wine-mappingviews (/proc/PID/maps).perfon wineserver: 54.7 %is_valid_view_addr, 44.3 %req_unmap_view. Both walkprocess->views, a linked list, on everymap_viewandunmap_viewrequest (server/mapping.c).So this is O(views) per call, inside a single-threaded server. On Windows these calls take microseconds, which is probably why it never showed up there.
I patched wineserver to also index views in a red-black tree keyed by (process, base), using
wine/rbtree.h, which the server already uses.find_mapped_view,find_mapped_addrandis_valid_view_addrbecome O(log n). The patch is about 85 lines inserver/mapping.c, with no protocol change, and it falls back to the list if two views of a process ever share a base. I built it from GE-Proton11-14's own wine tree, so the protocol matches. Same scene, same settings:map/unmapWith it, the world runs like it does on Windows. Nothing needs to change in the fork. I mention it because anyone testing under Proton will see this as "VIctory is slow" or "the world doesn't load", and from Windows it looks like a different program. I'd also like to send the patch to Wine. One possible relief on the fork's side: fewer, larger views for the tiled-heap aliases, if the console's page granularity allows it.
2. Runtime
D3DCompileunder Wine (confirming #6)Same as the reports in #6, on AMD too. Wine's builtin
d3dcompiler_47fails withE5005: Method 'InterlockedMax' is not defined on type 'RWByteAddressBuffer'. Thenno argument clamp: indirect execution dropped, and the world is black except subtitles and credits (max ~1,500 draws/frame). Microsoft'sd3dcompiler_47.dll(winetricks d3dcompiler_47) fixes it: about 7,000 draws/frame, and the world renders. A DXC fallback as proposed in #6 would make that step unnecessary.3. AMD: the late-wait switches fault the GPU as the loading screen ends
With the patched wineserver, I compared configurations from the same start:
VICTORY_LATE_WAIT=3 VICTORY_WIDE_BACK=1 VICTORY_CARD_BUFFERS_MIN_MB=1 VICTORY_CARD_BUFFERS_MB=1024VICTORY_RELAY=2(withVICTORY_LATE_WAIT=3)The faults are RADV
GPUVM faults. The kernel shows a[gfxhub] page faultwithFaulty UTCL2 client ID: TCP (0x8)(a texture read) at a mapped-looking address, for example0x8002e9631000. The log hashost GPU device removed after 1 submissions sent ahead (VICTORY_LATE_WAIT=1) of 1 lists; device removed: 0x887A0005, about 50 s after launch with a warm cache. My guess, which I haven't verified: work in flight reads tiled-heap pages that the title remaps (map_alias) before the flight lands. With the wineserver fix those remaps now happen in microseconds, so the window is much wider than it was. A diagnostics build withVICTORY_D3D12_DEBUG=1could name the command; I haven't run one yet.4. AMD:
fc5e66f8f873d3bb(as in #3)Without
VICTORY_SKIP_PIPELINES=fc5e66f8f873d3bb, one run in the world lost the device about 9 minutes in. That was aGPUVM fault at address 0x00000000, kernelFaulty UTCL2 client ID: SQC (data). That run also had the late-wait switches, so the two are confounded. With the skip andVICTORY_NO_WATCHDOG=1I have walked around the prologue without a fault.5. Where the frame goes now (default switches, patched wineserver)
This is in case it helps the speed work. As far as I can tell it matches Windows, so it isn't a Linux problem:
Your lines: preparing ~100-130 ms (copies ~50-60 ms for ~150-190 MB; textures 15-35 ms); GPU 75-105 ms; copying back ~50 ms for ~70-100 MB. Host copies in the card's memory: ~1,100-1,300 hash passes per frame and ~1,370 pieces fetched (~89 MB).
the card's clock per frame: nothing of ours queued 410-470 ms (the card about 25-28 % busy). Of that, 55-75 ms was while the submitting thread was working, and the rest while the title had not submitted.CPU (
perf, user space, whole process, 20 s): about 1.1 cores busy in total out of 24. 67 % is PE code (title + VIctory). Wine is ~15 %, mostlyRtlQueryPerformanceCounterpolling and heap allocation, plusvirtual_check_buffer_for_writeandNtGetWriteWatchat ~3.5 %. RADV is 2.5 %.Title waits: I timed the title's
WaitForSingleObject(Ex),WaitForMultipleObjects(Ex),Sleep(Ex),WaitOnAddressandSleepConditionVariable*by caller and thread, with an HLE override. None of the waits are on events passed toSetEventOnCompletion, so the title isn't waiting for our fences. What I saw:title+0x4e7f358, for 620-700 ms per second.title+0x2215eca; the busiest work 30-60 % of the time.Title threads that aren't in those waits mostly sit in
ntsyncwaits or futexes, which suggests directntdllwaits or our locks.So the frame looks like a serial chain: the title, then our prepare, wait and copy-back, then the GPU. Nothing in it is saturated.
6. Shaders that don't translate in the prologue (8)
The two "descriptor read only as data" pixel programs may be the skin and face materials: Lucia shows only teeth and lashes. In the world, 350-400 draws per frame are dropped "without a host pipeline".
7. Smaller notes
VICTORY_TEXTURE_NO_WAIT=1(before the wineserver fix) moved the time from "textures" to "copying back" (1.4-2.9 s) and the screen went black. I didn't dig further, since the wineserver fix removed the need for it.perfabout 40 % of the CPU was RADV compiling. It's expected, but worth knowing when comparing runs.I'm happy to run a diagnostics build, test
VICTORY_INPLACE, or try anything else on AMD/Linux.AI-assisted: Claude Code ran the builds and measurements on my machine, wrote the wineserver patch, and drafted this report. No game data, screenshots or names beyond hashes and offsets.
@UwUCammie on GitHub · 2026-11-25 00:12 UTC · original · edited 2026-11-25 06:36 UTC
Independent reproduction of section 1, plus a second wineserver patch and a few facts that may save others time. No game data below, only counters.
Setup: RX 7900 XT, Mesa 26.3.1, CachyOS, the distro's stock Wine 11.22 (not GE/Proton), official dxvk
dxgiplus GE-Proton11-14's vkd3d-proton (cae8353ed, needed forVKD3D_CONFIG=descriptor_heap), Microsoft'sd3dcompiler_47. Fork2119b0e+ upstream #454 (VICTORY_NO_WATCHDOG).1. The stock server is the bottleneck here too. With the opening cutscene running (3,000-6,000 draws/frame): stock
wineserverclimbed to an average of ~75 % of a core over a 5-minute run and world frames took 5-20 s (preparing5-17 s: copies 1-16 s, textures 2-10 s). With a patched server (below), wineserver sits at ~3 % and frames take 580-650 ms (preparing~250 ms, GPU ~210 ms,copying back~120 ms). That matches the 410-470 ms in this report on the same card.2.
WINESERVER=/path/to/patchedis ignored by Wine 11.22.exec_wineserver()indlls/ntdll/unix/loader.ctriesbin_dir/wineserverfirst and only then$WINESERVER, so the system server always wins and a patched build looks like it does nothing (it cost me two runs). Start the patched server for the prefix before the client, and clients connect to whichever server owns the prefix socket:It must be built from the same Wine version as the client (I built it from the
wine-11.22tag;./configure --enable-win64 ... && make server/wineserveris enough).3. My patch (same idea as the one described above: views also indexed in a red-black tree by base; the views of a process never overlap, so
find_mapped_view,find_mapped_addrandis_valid_view_addrbecome O(log n); no protocol change; a view whose base is already in the tree, which cannot happen while views do not overlap, stays list-only and is found by a walk). 196 lines of diff againstwine-11.22:wineserver-views-rbtree.patch
4. Differential test. A small program maps, overlaps, unmaps and remaps views at fixed addresses with a fixed random sequence and prints every result (including the error codes of overlapping maps). The output of the stock and the patched server is identical over 45,970 results (20,000 slots, ~10,000 live views at the end, overlap-same/inside/tail all fail with the same codes on both). Time for the same run: 1,232 ms stock vs 404 ms patched (client-side cost remains; the server's share grows with the number of views, a game with ~22,000 views is the case above). I can post the test source if it is useful.
I have not sent this to Wine; the report above mentioned wanting to, so I left it to its author.
@slauko on GitHub · 2026-11-25 14:01 UTC · original
A third data point, on NVIDIA and on Proton Experimental's own Wine, with a tree-indexed wineserver (the same idea as the patch above, written independently).
RTX 3080 Ti, driver 595.112.07, Proton Experimental
experimental-11.0-20261112(Wine 11.0), vkd3d-protonmaster@ec20719, this fork's line at 1.3–2.5 fps in the intro. Medians over all world frames, machine to itself:wineserver sits at 2.8 % of a core with the tree.
For those on Proton Experimental rather than a distro Wine: its Wine is
ValveSoftware/wine, branchexperimental_11.0, at5b557605b4e5— the tip of 2026-11-11, the last commit before that build, so a server made from it speaks the client's protocol. This tree still hasautogen.sh:./autogen.sh,mkdir build && cd build && ../configure --enable-win64 …,make server/wineserveris enough.WINESERVERis ignored there as well (UwUCammie's note above): the server has to be started for the prefix before the client.@UwUCammie on GitHub · 2026-11-25 22:00 UTC · original
Another RX 7900 XT result on RADV 26.3.1 and Wine 11.22. A local experimental build averaged 10.15 FPS at 4,805 draws/frame in the first room over seconds 150–225, then lost the device about 246 seconds into the run. RADV reported a GPUVM fault and vkd3d returned DXGI_ERROR_DEVICE_REMOVED. Gamescope exited with status 0, so status alone missed the failure.
This build used asynchronous submission and relay copy-back, with grouped refresh and a clean-page read optimization alternating during the run. I don’t have evidence attributing the loss to either setting. I’m keeping it out of the stable results.
@UwUCammie on GitHub · 2026-11-25 22:51 UTC · original · edited 2026-11-25 23:24 UTC
I put the first-room measurements and sampling tools on my fork. The log reader counts successful presents over complete intervals, and the optional release sampler records viewport sizes and host read call sites. The branch also has a synthetic benchmark that runs the actual worker-pool code from two Git revisions.
On the RX 7900 XT, the best completed run so far was 752 presents in 74.31 seconds (10.12 FPS, 4,829 draws/frame). Most graphics binds sampled a 2560×1440 viewport. The 1920×1080 display setting still gave a 3840×2160 swapchain and the same dominant viewport. Sampling confirmed that refreshing previously copied buffer pages was the largest host read cost in the measured scene.
The readback-size tests are in #1164 and the copy-worker fix is in #1172. I also published the scratch-reuse experiment. It passed 31 shadow tests. Its synthetic merge benchmark was slower in the first eight pairs (64.06 vs 59.20 ms); that result doesn’t justify changing the default.
The same 16 KiB baseline repeated at 538 presents in 73.74 s (7.30 FPS, 4,867 draws/frame). The 10.12 figure is the fastest run. With reusable scratch, the parent/worker-pool builds measured 7.96 and 9.32 FPS in one run each. The renderer trial sources include the readback command experiment, a revision-checked buffer lookup cache and the integer-hash descriptor benchmark. No default change is proposed from those timings.
A separate trial of the 100 ms unmapped-block cache from
44bff61b, on the same RX 7900 XT integration build, reported device removal and a GPU VM fault around 81 s. The process returned zero. I excluded it from the FPS table and have kept the setting off. The isolated run does not identify the cause. The system enumerated the same physical Vulkan adapter afterward.@Alm0stSurely on GitHub · 2026-11-26 07:06 UTC · original
I reproduced the view-index result on an RTX 5080, NVIDIA 620.73.04 and GE-Proton11-6, using a ZTRX-derived build. I ported the per-process tree approach from this thread to the Wine server sources for that GE release. The client DLLs stayed stock.
First I compared two locally built servers on the same toolchain, alternating stock/index/index/stock in fresh prefixes. With 4,096 live 64 KiB views of one section, the median unmap + remap cost was 23.0 / 10.2 / 11.5 / 24.7 µs per pair. With 64 views all four runs were around 9 µs. The benchmark checked the contents after each remap. I verified the live server executable in each prefix.
In the title, one run with the distributed server and one with the rebuilt index, same executable, initial shader-cache seed, settings and inputs. At the Written By credit:
Over capture seconds 153–288, the server alone averaged 68.6% vs 2.9% of one CPU core. The runs were at different points in the sequence during that interval. The indexed run got past more credits and drew a daytime character and a night scene before our local VRAM reserve stopped it (5,110 MiB free, limit 5,120 MiB). No verified movement or gameplay FPS from this pair.
AI-assisted with OpenAI Codex (gpt-6.2-astra).
@Alm0stSurely on GitHub · 2026-11-26 07:28 UTC · original
Follow-up to the indexed wineserver test on the RTX 5080. I kept the same ZTRX-derived executable, GE-Proton11-6 server, shader-cache seed and menu inputs, and lowered
VICTORY_TEXTURE_BUDGET_MBfrom 3072 to 2560. At the same “Additional Score” credit, the sandbox processes used 8,549 MiB of GPU memory, down from 8,977 MiB. One run per setting.The 2560 run reached the prison prologue. Opposite right-stick inputs moved the camera from the bunks towards the tower and back. With forward, neutral, then backward input, the character approached the bunk, held position, then moved away. The next prompt was “Approach a cellmate to interact with them.” I did not test that interaction.
The prologue was visible for 6 min 53 s before the 900 s test timeout. Across 76 complete sampling windows in that scene, the host presented 795 frames in 404.626 s (1.96 fps). During a turn, the capture showed 18 distinct visual changes over 20 presents in 10.226 s. Some floors and other surfaces were still missing. The lowest sampled free VRAM was 5,129 MiB, just above the 5,120 MiB local cutoff.
AI-assisted with OpenAI Codex (gpt-6.2-astra).