Under Wine: title pages shown with the host's mmap, and renderer port 1's heap opened in place (VICTORY_WINE_MAP, VICTORY_PORT_HOME) #2455
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2455"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by borntofrag34 on 2026-11-29T13:13:16Z.
Two changes for running under Wine/Proton, each behind its own switch. On Windows nothing changes: both act only when ntdll exports
wine_get_version. They come from borntofrag34/VIctory-7900XTX'slinux-winebranch, where they have been in use since 2026-11-26/27. They are ported here onto this tree'sxmem, which has soft and lazy views, file-backed sections and the batched page mapper.What changes
VICTORY_WINE_MAP(on under Wine;=0brings back today's behaviour)is_valid_view_addr,find_mapped_view). It does that while the calling thread holds ntdll'svirtual_mutex, the lock everyNtProtectVirtualMemory,NtGetWriteWatch, query and fault also takes. (docs/linux-proton.mdalready describes this list, with a patched wineserver as the workaround.)mmap(MAP_SHARED | MAP_FIXED; the descriptor comes fromwine_server_handle_to_fd), then committing the range.MEM_DECOMMIT.VirtualFreeof placeholders (split, coalesce, release) is done on pieces of the reservation that we keep track of.title_view_space, whichwatch'sis_view/readable_view/placeholderandinplace::private_wholeuse.VICTORY_PORT_HOME(on withVICTORY_PORT_CONSTANTS=1andVICTORY_WINE_MAP;=0: off)amdgpu_ttm_tt_get_user_pages) also takes memory by address only as one mapping that the process owns.port.rsopens the heap right there, with no view of ours. It checks through the card that the bytes really arrive, makes up to four attempts, and otherwise gives the stretch up (copied and guarded as before).Side note, not changed here: with
VICTORY_PORT_CONSTANTSunset, the GPU side's port is on by default (except on Ampere), butxmem's half (port_on, which runsarrange) defaults to off. The 32-bit heap is then never in one stretch, the log saysnot one native-import-eligible stretch of a section: Scattered, and nothing is ported. I think the same happens on Windows, but I have not checked.VICTORY_PORT_HOMEonly acts whereVICTORY_PORT_CONSTANTS=1is set explicitly.Measured
victory playsettings with the frame clock at 16.667 ms. A save another player shared (issue 332) in a town, the same scripted walk each time. 300 s per run, read from 150 s on, diagnostics build, one run per setting.main829188e9(+ #2048 to build diagnostics)VICTORY_WINE_MAP=0VICTORY_PORT_CONSTANTS=1VICTORY_WINE_MAPalone does not make the frame shorter here. It takes the Wine server from 6.1 % to 0.4 % of a processor, the write-watch askings from 7.1 to 3.1 ms a frame and the texture refreshes from 9.9 to 5.5 ms. This tree's soft views and section windows already avoid most mapping calls. In the fork, which has neither, the same change took the guards' wait from 171 to 23 ms a frame and protection changes from 48 to 11 ms (first scene, 4K).maintoo.docs/linux-proton.md.Not verified
on_wine(), but nothing was measured there.VICTORY_WINE_MAPis on by default under Wine for every card. Whether NVIDIA's driver imports private memory the same way was not checked; the port's own check through the card guards against zeros.VICTORY_SOFT_VIEWScovering the pool (1orpool), the 32-bit heap is shown lazily and the port finds it uncommitted, so it falls back to copies. The launcher usescopies, which is fine.Tests (under Wine, in a headless gamescope, on the card)
victory-hlexmemandwine_map: 49 passed, 1 failed. The failure,a_read_by_range_waits_only_for_a_remapping_that_meets_it, also fails onmain.maingives 44 passed, 2 failed (that one anda_title_thread_goes_on_using_the_rest_of_a_view).under_wine_the_32_bit_heap_is_shown_as_memory_of_its_own;under_wine_a_stretch_at_home_is_opened_where_it_is_and_a_view_only_if_shared, which runs on the card;pages_at_home_are_never_made_read_only;wine_map's three.victory-gpuwatch::,inplace::,port::: 73 passed, 4 failed. The four aremany_askers_tests×3 andwhat_is_left_alone_is_no_known_hole;maingives 71 passed and the same 4 failed.cargo clippy -D warningsandcargo xtask policyalready fail onmain(victory-shader, victory-loader,heap_sites/frame_users.rs).🤖 Generated with Claude Code
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by borntofrag34 on 2026-11-29T13:40:34Z.
Follow-up on "each protection change still costs about 60 µs here … not explained yet": a run with
VICTORY_AB=10,VICTORY_FAULT_UNLOCKED(run 294, same town walk, 600 s, 22 phases each side) explains it. With unlocked faults (default) protections are 20.4 ms a frame and the faults never wait for the guards' lock. With the locked way they are 6.2 ms, but the faults wait 28.9 ms for the guards' lock, and the frame is the same (45.5 against 46.4 ms). About 310 faults a frame either way. The 55-60 µs is the faults'VirtualProtectcalls queuing on Wine'svirtual_mutexwith each other, so the wait only moves from one counter to the other. Nothing to change there; the gap to the fork is elsewhere (its submitting thread works ~30 ms a frame here against ~40).Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by theotherp on 2026-11-29T20:28:54Z.
A data point for "NVIDIA under Proton: not checked". On NVIDIA this froze the whole system when the game was closed.
Setup: RTX 5080 16 GB, NVIDIA 620.73.04 (open kernel module), CachyOS kernel 7.3.6, Ryzen 9 7950X. Proton Experimental 11.0-20261112 (stock Wine server, run through
umu-run), vkd3d-proton master71cae091bbesidevictory.exe,VKD3D_DISABLE_EXTENSIONS=VK_NV_raw_access_chains,VKD3D_CONFIG=no_descriptor_heap. Build: forkmainf889bb07, plus #2034, #2035, #2160, #2745, #2834 and #2854, plus this PR. Release build, Series X profile, DLSS quality,VICTORY_VRAM_BUDGET_MB=11000.VICTORY_PORT_CONSTANTSwas not set, so onlyVICTORY_WINE_MAP(its default under Wine) was active.What happened: the log showed
title pages are shown with the host's mmap, beside Wine's server, and play was normal for about 4 minutes. 1 to 2 minutes after start, the kernel logged about 40 NVRM errors within two minutes:The game kept running. On Alt+F4 the log reached
title suspended; ending the title, and then the whole desktop froze. Only a hard reset recovered it.Without this PR: in the other runs that day on the same machine (about ten, three of them this build with
VICTORY_WINE_MAP=0), none of these NVRM errors appeared, and closing the game worked. A separate issue: there were three Xid 109 hangs that day, all with a patched Wine server, and none with the stock one used here.It's a single run, so it isn't proof. But the timing points at the mmap'd title pages and the NVIDIA driver's GPU mappings of that memory. It may be worth keeping
VICTORY_WINE_MAPoff on non-AMD adapters until it's checked there.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Kassadd on 2026-11-29T21:41:23Z.
A Wine run on the current tree, and one number that may be worth a look.
Built
mainatcec481f4(the tree of v2026.11.29.03) with this PR merged on top — itapplied with no conflict — plus #2585, and ran it under Proton.
Environment: RTX 4080 SUPER 16 GB, i9-14900K, 62 GB, CachyOS, Hyprland (Wayland),
NVIDIA 620.73.04, Proton Experimental
...-20261128(vkd3d-proton71cae0), Series X1.0.2.1,--res 1080to1440, shader cache emptied first as the release notes ask.The start-up check runs. The log has
wine_map: title pages are shown with the host's mmap, beside Wine's server (VICTORY_WINE_MAP=0: as views), then theVirtualFreelines for reservations that standfor placeholders. Nothing warns and nothing falls back to views.
VICTORY_PORT_HOMEIdid not test separately.
The run: 6m 13s, 19–29 fps, up to 11,795 draws/frame, no
Xidin the kernel log andno
device lost; I stopped it, it did not die. That is the longest run I have had underWine, but I cannot attribute it to this PR. Three runs, one variable apart:
0xc000001dThe difference between the last two is 1m 7s and I did not exercise
VICTORY_WINE_MAP=0to isolate it, so I am not claiming the extra minute as this PR's. What this run does
establish is that the Wine
mmappath works for six minutes of play without a fault ofits own.
The number I think matters. With the camera still, a frame is 51 ms, and the layer's
own breakdown puts 34 ms in
preparing, 18 ms of it incopiesfor 77 MB, with thecard at 3.8 ms (7% busy) and 67,000 list calls a frame. Turning the camera makes it
worse — the frame goes to 8 fps — but I do not have that breakdown for a turning frame,
so I cannot say the 34 ms is what grows. If this PR is meant to help the memory path
rather than to fix a fault, that 18 ms is where I would expect it to show, and on this
one machine and this one measurement I did not see it move. I have no A/B for
copieswithout the PR, so that is an observation to check, not a finding against it.
What I did not do: Windows, a patched wineserver to compare against, or a longer run.
Logs and the exact invocation are available on request.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.