ProjectScarlett menu runs at ~1 fps on Wine because VirtualQuery on XMem section views goes through wineserver; #258 fixes it (AMD) #289
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?
Imported from brcly/TuxBox. Originally posted by Kayotic1337 on 2026-11-27T01:09:20Z.
Setup: RX 9070 XT, Mesa/RADV 26.3.1, GE-Proton11-14, kernel 7.3.6 (CachyOS),
mainat12e4b06, ProjectScarlett 1.0.2.1 viatuxbox.py run.1. Start menu at ~1 fps: wineserver-bound
VirtualQueryOn
mainthe start menu ran at about 1 fps (11 frames per 10 s, warm translations, nothing compiling). Nothing looked busy:wineserveritself, however, was at 90% CPU. Agdbsnapshot of all threads showed the busiest game thread blocked on a server reply:Sampling
/proc/<pid>/task/<tid>/syscallshowed that thread inread90% of the time. On Wine,VirtualQueryon aMEM_MAPPEDview of aSEC_RESERVE-style section asks wineserver for the committed size, so each query is a server round trip. XMem backs physical pages with section views, and d3d12_xs validates ranges withVirtualQueryloops in several places (clwb.rs,clzero.rs,device/heap.rs,device/heap/shadow.rs,survey.rs). I couldn't tell which call site is the hot one: gdb doesn't unwind through the PE frames.With #258 merged on top (XMem backings as
MEM_PRIVATE), the same menu runs at 30–60 fps (300–546 frames per 10 s) and wineserver drops to ~21% CPU. #258 is written for #191, so this looks like an unnoticed side effect worth knowing, and possibly a reason to keepVirtualQueryoff hot paths in general.Refusals for comparison (same title and save; the earlier run was on the main from before #278/#281):
12e4b06Failed to convert functionFailed to remap samplerSo on this setup the 1 fps wasn't caused by refused shaders.
2. Story intro: black screen, then GPU page fault at address 0 (AMD side of #232)
With
12e4b06+ #258, starting story mode plays audio but the screen stays black. About 19 min after launch (title crash log:Game State: Game Running, frame 1688, 978 streaming requests) the GPU faults:Then
VK_ERROR_DEVICE_LOST,PresentX failed planes=1 HRESULT=0x80004005, and the title's breakpoint/crash handler (exit code 3; the crash upload failed offline as intended).Just before it, the log has 14 skipped compute dispatches and 6 skipped draws. Almost all of them say
its root indexes the resource heap directly, with the same guest callers as in #232 (0x248cbc1, 0x2951ba, 0x56bba, 0x4e33f98), plus onedescriptor table refresh (0x80070057)at 0x2495f7d. On NVIDIA this point shows as Xid 109 (context-switch timeout). On RADV it is a scalar-data read of address 0, which fits a later pass reading output a skipped dispatch never wrote, or a descriptor left at 0.I haven't checked whether #258 plays a part in the crash: without it the menu is too slow to reach story mode.
Imported from brcly/TuxBox. Originally posted by NickStallman on 2026-11-27T01:20:25Z.
A data point from NVIDIA, which suggests the 1 fps menu depends on the host. On an RTX 5090 (driver 620.70.10, GE-Proton11-14, game files on local disk), runs without #258 loaded at full speed from launch through the menu. Frames presented per 10 s, first 40–80 s of each run:
e76ff6a+ #23512e4b06+ a local diagnostic probe (two runs, one also with a local d3d12 change)e76ff6a+ #235 + probe (two runs)e76ff6a+ #235 + probe + #258Three other runs did load at exactly 10 frames per 10 s for 7–10 minutes. All three had a local experiment that replaces some of #216's compute programs with no-ops, and the same build without that experiment loaded at full speed, so the slowness came from the experiment, not from #258 or main. (An earlier version of this comment blamed the first launch after moving the game to local disk; a third run ruled that out.) During those slow loads the wineserver ran at about 2,100 switches/s, so it wasn't the
VirtualQuerycase you found.The intro is a different story. The NVIDIA runs that got there all died around
Prestream:I haven't tied that one to a specific skipped dispatch.
Imported from brcly/TuxBox. Originally posted by Kayotic1337 on 2026-11-27T02:02:59Z.
Thanks, that narrows it down: it's the copy path, which only hosts that can't import game memory take. In my two runs on the same build and save, the provider logs:
game memory is copied for the GPU: this host cannot import it directlygame memory is imported through its XMem backing(and… through non-contiguous XMem backings)So on RADV the section-backed game memory couldn't be imported before #258 (the #191 case), the provider copied it for the GPU, and that path is where the
VirtualQuerycalls onMEM_MAPPEDviews piled up in wineserver. An NVIDIA host that imports directly never takes it, which matches your full-speed menus. I'd read the 1 fps as "#191 hosts on the copy path", not as AMD in general.On the intro: on this AMD card the page fault at address 0 went away in 2 of 2 runs once compute roots that have tables and index the heap directly also get the resource index map. Before,
reflected_rootreturnedOriginalfor them, and every dispatch was skipped withits root indexes the resource heap directly. I've got that as a branch with a Lanes scenario that fails without it (bindless-table-compute) and will open a PR. It would be good to know whether your Xid 13 run goes away with it too. After that, both of my runs ended in the #215 label stall (a gfx ring timeout here, which looks like your Xid 109).Imported from brcly/TuxBox. Originally posted by Kayotic1337 on 2026-11-27T02:41:11Z.
Correction to my last comment: the address-0 fault did not go away. In a third run (index-map change + #258 + current main), the intro again ended in a gfx ring timeout, and the amdgpu devcoredump of that hang shows the same fault:
Faulty page starting at address: 0x0, status0x601431(SQC data read, permission fault). The kernel log only showed the ring timeout that time, so my earlier "2 of 2" was based on an incomplete signal. The fault was probably there behind the timeouts as well.The index-map change still fixes a real skip: compute roots with tables that also index the heap directly no longer have every dispatch dropped, and a Lanes scenario fails without it. But it isn't the fix for the intro fault, and some compute dispatches and draws are still skipped there. I'll say so in the PR.