[Bug 60354] New: opengl32: Severe WoW64 slowdown with NVIDIA during repeated Vulkan buffer mapping
http://bugs.winehq.org/show_bug.cgi?id=60354 Bug ID: 60354 Summary: opengl32: Severe WoW64 slowdown with NVIDIA during repeated Vulkan buffer mapping Product: Wine Version: 11.18 Hardware: x86-64 URL: https://www.moddb.com/games/age-of-wonders-2-the-wizar ds-throne/downloads/demo-with-multiplayer OS: Linux Status: NEW Keywords: download, patch Severity: normal Priority: P2 Component: opengl Assignee: wine-bugs@list.winehq.org Reporter: gyebro69@gmail.com Target Milestone: --- Distribution: --- *The analysis and a diagnostic patch in this bug report was made by ChatGPT, and all results were verified through my own testing.* The Age of Wonders II: The Wizard's Throne demo becomes almost unresponsive when entering the tutorial in fullscreen mode with new WoW64 Wine and the NVIDIA proprietary userspace driver. A diagnostic patch which retains the underlying Vulkan memory mapping across OpenGL buffer map/unmap calls restores normal performance. This appears related to bug #55981, but the Vulkan-based mapping path is already active in this case. The captured logs contain no mapped-buffer copy fallback messages. Instead, tracing shows repeated replacement of the same 64 MiB mapping through Wine's WoW64 OpenGL map/unmap functions and the NVIDIA driver. Steps to reproduce: 1. install the demo. First start aow2Setup.exe and make sure that 'UseDirect3D' option is selected and a display mode other than 'windowed' is selected. (the problem doesn't occur in windowed mode). 2. start AoW2.exe, from the menu select 'Tutorial' 3. observe performance when the game scene appears. With vanilla Wine and NVIDIA, the game becomes extremely slow as soon as the tutorial scene appears. Visually, the frame rate appears below 1 FPS and mouse interaction is severely delayed. The fullscreen slowdown also occurs under X11, native Wayland, and XWayland. I compared the results to nouveau/Mesa 26.2.3: * NVIDIA, vanilla Wine, game fullscreen: severe slowdown * NVIDIA, patched Wine, game fullscreen: normal performance * NVIDIA, vanilla Wine, game's own Windowed mode: normal performance * Nouveau/Mesa 26.2.3, vanilla Wine, game fullscreen: normal performance. Tested on: Arch Linux NVIDIA GeForce GTX 1660 SUPER NVIDIA driver 615.71.09, with the open kernel module Wine 11.18, new WoW64 build 32-bit AoW2.exe (PE32, Intel i386) Reproduced under X11/Xfce, native Wayland, and XWayland Nouveau/Mesa 26.2.3 tested as a comparison on the same GPU -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60354 --- Comment #1 from Béla Gyebrószki <gyebro69@gmail.com> --- Created attachment 82141 --> http://bugs.winehq.org/attachment.cgi?id=82141 Mapping logs, strace summaries The archive in the attachment contains the following debug logs: - Unpatched and patched OpenGL mapping logs - Unpatched and patched strace summaries - Symbolized unpatched mmap stack trace. Mapping logs: Both the unpatched and patched runs initialize a Vulkan device and create 37 buffer_storage objects. The filtered OpenGL logs contain: | Message | Unpatched | Patched | | ------------------------------- | --------: | ------: | | created buffer_storage | 37 | 37 | | returning vk mapping | 11,963 | 37 | | reusing vk mapping | 0 | 94,433 | | Doing a copy of a mapped buffer | 0 | 0 | | returning copy buffer | 0 | 0 | The runs have different durations and tracing affects performance, so these counts should not be interpreted as an FPS comparison. In the unpatched log, the same address, 0xa690000, is returned 11,927 times. In the patched log, the frequently used mapping is created once and then reused 94,433 times. System-call tracing: Two nominally 10-second strace samples were taken after the tutorial loaded, with WINEDEBUG=-all: | System call | Unpatched | Patched | | ----------- | --------: | ------: | | mmap | 9,767 | 6 | | ioctl | 23,703 | 10,048 | | mprotect | 5 | 18 | A separate short strace with stack traces shows repeated operations on the same 64 MiB address range: mmap(0xa690000, 67108864, PROT_NONE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, ...) = 0xa690000 mmap(0xa690000, 67108864, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_FIXED, ... /dev/nvidiactl ..., 0) = 0xa690000 The symbolized Wine-side call chains are: wow64_ext_glUnmapBuffer -> wow64_glUnmapBuffer -> wow64_unmap_buffer -> unmap_vk_buffer -> NVIDIA driver -> mmap(PROT_NONE) and: wow64_ext_glMapBufferRange -> wow64_glMapBufferRange -> wow64_map_buffer -> NVIDIA driver -> mmap(PROT_READ|PROT_WRITE) The NVIDIA library in both stacks is libnvidia-glcore.so.615.71.09. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60354 --- Comment #2 from Béla Gyebrószki <gyebro69@gmail.com> --- Created attachment 82142 --> http://bugs.winehq.org/attachment.cgi?id=82142 "diagnostic" patch to improve performance *The patch is provided as diagnostic evidence, not as a proposed production-ready fix. Its correctness across all buffer lifecycles has not been established.* The attached patch changes dlls/opengl32/unix_wgl.c to: - Retain the underlying Vulkan mapping when ending an OpenGL mapping, clearing map_ptr while keeping host_ptr - Reuse host_ptr plus the requested offset on subsequent mapping requests - Use host_ptr to determine whether Vulkan unmapping is needed when freeing the buffer. This restores normal performance in the demo and nearly eliminates the repeated mmap calls in the captured sample. Relationship to bug #55981: Unlike the mapped-buffer copying cases discussed there, this reproducer uses Vulkan mappings successfully. The severe slowdown persists on that path, and retaining the mapping resolves it. The evidence points to repeated Vulkan map/unmap operations being a significant bottleneck with NVIDIA in this configuration. It does not establish that the NVIDIA driver violates the API specification, or that the Vulkan mapping implementation introduced the original slowdown. The same diagnostic patch has substantially improved performance in 12 tested games, including eXperience 112, Half-Life 2, The Testament of Sherlock Holmes, Wings over Europe, Dungeon Lords Steam Edition, Two Worlds Epic Edition and Age of Wonders: Shadow Magic. The detailed mapping analysis in this report concerns the Age of Wonders II demo. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=60354 Béla Gyebrószki <gyebro69@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |performance, wow64 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla