http://bugs.winehq.org/show_bug.cgi?id=35655
Bug ID: 35655 Summary: Wined3d performance drop Product: Wine Version: 1.7.13 Hardware: x86-64 OS: Linux Status: NEW Severity: normal Priority: P2 Component: directx-d3d Assignee: wine-bugs@winehq.org Reporter: wylda@volny.cz
In between 1.7.13 and wine-1.7.13-27-ge610713 i noticed performace drop in 3Dmark 2000.
In overall score it makes -14%, but as the CPU tests and MTexels/s & KTriangels/s remained cca the same, some FPS tests dropped to -20% ("8MB Texture Rendering Speed").
Since 1.7.13 there were not too much 3d changes, but anyway i bisected to:
4c4552c5a1910a9d5adf8eccff0ac62d89ffe376 is the first bad commit commit 4c4552c5a1910a9d5adf8eccff0ac62d89ffe376 Author: Ken Thomases ken@codeweavers.com Date: Wed Feb 19 16:14:53 2014 -0600
wined3d: Restore the pixel format of the window whose pixel format was actually changed.
http://bugs.winehq.org/show_bug.cgi?id=35655
Wylda wylda@volny.cz changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, regression URL| |http://www.computerbase.de/ | |downloads/software/benchmar | |ks/futuremark_3dmark2000/ CC| |ken@codeweavers.com Regression SHA1| |4c4552c5a1910a9d5adf8eccff0 | |ac62d89ffe376
http://bugs.winehq.org/show_bug.cgi?id=35655
--- Comment #1 from Ken Thomases ken@codeweavers.com --- Yes, I can confirm this.
The problem is the code added to context_enter(). In the ideal case, the outermost context_enter() will find that the wined3d context is still current, and its OpenGL context is the still the current OpenGL context. (That is, the app is neither using WGL nor working with multiple wined3d devices or swapchains on the same thread.) For that ideal case, context_enter() used to just call context_get_current() to query the current wined3d context and wglGetCurrentContext() to query the current OpenGL context. After my commit, it also calls GetPixelFormat(). That additional call is relatively expensive and it's being called a lot, at least for some of the 3DMark 2000 benchmarks.
Unfortunately, it's necessary for correctness. Admittedly, the problem it's solving is relatively uncommon, so the performance hit probably outweighs the correctness.
However, there are already plans[1] to further change how wined3d works and they will remove the need to call GetPixelFormat() so often. I think the best solution is to move forward on that. (Those plans, though, won't help for when wined3d is used on Windows. Then again, the performance characteristics of GetPixelFormat() may be radically different on Windows.)
Speaking of, the other thing we could do is investigate why Wine's GetPixelFormat() is expensive and make it faster.
[1] The WGL_WINE_surface extension proposed in http://www.winehq.org/pipermail/wine-devel/2014-January/102637.html
http://bugs.winehq.org/show_bug.cgi?id=35655
Béla Gyebrószki gyebro69@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.winehq.org/show | |_bug.cgi?id=35705
http://bugs.winehq.org/show_bug.cgi?id=35655
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |morcant.221@gmail.com
--- Comment #2 from Dmitry Timoshkov dmitry@baikal.ru --- *** Bug 35791 has been marked as a duplicate of this bug. ***
http://bugs.winehq.org/show_bug.cgi?id=35655
Luke Bratch l_bratch@yahoo.co.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |l_bratch@yahoo.co.uk
https://bugs.winehq.org/show_bug.cgi?id=35655
--- Comment #3 from Ken Thomases ken@codeweavers.com --- Since I won't be working on the proper solution for this in the foreseeable future, I have submitted reverts of the original problem commit and some related commits:
http://source.winehq.org/patches/data/106532 http://source.winehq.org/patches/data/106534 http://source.winehq.org/patches/data/106533 http://source.winehq.org/patches/data/106535 http://source.winehq.org/patches/data/106536
https://bugs.winehq.org/show_bug.cgi?id=35655
--- Comment #4 from Wylda wylda@volny.cz --- Still in wine 1.7.27. Just for futer comparisons: * wine-1.7.13 ~ 18'735 marks * wine-1.7.27 ~ 15'657 marks
https://bugs.winehq.org/show_bug.cgi?id=35655
mrdeathjr28@yahoo.es changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mrdeathjr28@yahoo.es
https://bugs.winehq.org/show_bug.cgi?id=35655
Michael Stefaniuc mstefani@redhat.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mstefani@redhat.com Target Milestone|--- |1.8.0
https://bugs.winehq.org/show_bug.cgi?id=35655
Linards linards.liepins@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |linards.liepins@gmail.com
--- Comment #5 from Linards linards.liepins@gmail.com --- (In reply to Wylda from comment #4)
Still in wine 1.7.27. Just for futer comparisons:
- wine-1.7.13 ~ 18'735 marks
- wine-1.7.27 ~ 15'657 marks
Offtopic, but I was wondering if Phoronix Test Suite could provide more detailed results than just plain 3DMark numbers? For me as *nix user (for home office) it does not tell much...
https://bugs.winehq.org/show_bug.cgi?id=35655
--- Comment #6 from mrdeathjr28@yahoo.es --- (In reply to Wylda from comment #4)
Still in wine 1.7.27. Just for futer comparisons:
- wine-1.7.13 ~ 18'735 marks
- wine-1.7.27 ~ 15'657 marks
This is video tests in wine 1.7.13 and 1.7.42 with same values for both test
Wine 1.7.13
https://www.youtube.com/watch?v=waYTC-ab4W0
Wine 1.7.42
https://www.youtube.com/watch?v=QsKQkOC5ggg
In results are this
Wine 1.7.13: 30243
Wine 1.7.42: 30114
However this test is only for 3DMark2000 maybe in other apps still affected
https://bugs.winehq.org/show_bug.cgi?id=35655
--- Comment #7 from Linards linards.liepins@gmail.com --- (In reply to mrdeathjr28 from comment #6)
(In reply to Wylda from comment #4)
Still in wine 1.7.27. Just for futer comparisons:
- wine-1.7.13 ~ 18'735 marks
- wine-1.7.27 ~ 15'657 marks
This is video tests in wine 1.7.13 and 1.7.42 with same values for both test
Wine 1.7.13
https://www.youtube.com/watch?v=waYTC-ab4W0
Wine 1.7.42
https://www.youtube.com/watch?v=QsKQkOC5ggg
In results are this
Wine 1.7.13: 30243
Wine 1.7.42: 30114
However this test is only for 3DMark2000 maybe in other apps still affected
As far as I understand, 3DMark2k5 is not used because Windows XP Infrastructure is not efficiently implemented in wine codebase?
https://bugs.winehq.org/show_bug.cgi?id=35655
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.winehq.org/sho | |w_bug.cgi?id=35950
https://bugs.winehq.org/show_bug.cgi?id=35655
Wylda wylda@volny.cz changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |matteo.mystral@gmail.com
--- Comment #8 from Wylda wylda@volny.cz ---
(In reply to mrdeathjr28 from comment #6)
Thanks mrdeathjr28 for re-test. I did the same and took me a lot of time.
So numericaly this seems to be fixed, but this is thanks to Matteo's optimizations.
These two Matteo's patches did significant improvement. Note: first number is total score gain in % (because cpu benchmarks remain the same, increased FPS bechmarks change total score just partly), second number shows FPS gain in % for "64MB Texture Rendering Speed":
* wine-1.7.41-95-g978fe23 1st ... +15.5% (against wine-1.7.41 - comparable with 1.7.14 and above) 2nd ... +26.3% (against wine-1.7.41)
* wine-1.7.44-249-g4189d29 1st ... +2.9% (+18.6% against wine-1.7.41) 2nd ... +11.4% (+40.6% against wine-1.7.41)
So these two patches makes this bug numericaly fixed. But when i also revert Ken's patches (this bug is about these patches, not Matteo's) it gives _nice_ boost: 1st ... +38.9% (wine-1.7.45 + revert against wine-1.7.41) 2nd ... +69.2% (wine-1.7.45 + revert against wine-1.7.41)
Gain nearly 70% is awesome, if fixed. (sure 70% is the best value, other tests shows gain between +19% to 56%).
https://bugs.winehq.org/show_bug.cgi?id=35655
--- Comment #9 from Linards linards.liepins@gmail.com --- (In reply to Wylda from comment #8)
(In reply to mrdeathjr28 from comment #6)
Thanks mrdeathjr28 for re-test. I did the same and took me a lot of time.
So numericaly this seems to be fixed, but this is thanks to Matteo's optimizations.
These two Matteo's patches did significant improvement. Note: first number is total score gain in % (because cpu benchmarks remain the same, increased FPS bechmarks change total score just partly), second number shows FPS gain in % for "64MB Texture Rendering Speed":
- wine-1.7.41-95-g978fe23
1st ... +15.5% (against wine-1.7.41 - comparable with 1.7.14 and above) 2nd ... +26.3% (against wine-1.7.41)
- wine-1.7.44-249-g4189d29
1st ... +2.9% (+18.6% against wine-1.7.41) 2nd ... +11.4% (+40.6% against wine-1.7.41)
So these two patches makes this bug numericaly fixed. But when i also revert Ken's patches (this bug is about these patches, not Matteo's) it gives _nice_ boost: 1st ... +38.9% (wine-1.7.45 + revert against wine-1.7.41) 2nd ... +69.2% (wine-1.7.45 + revert against wine-1.7.41)
Gain nearly 70% is awesome, if fixed. (sure 70% is the best value, other tests shows gain between +19% to 56%).
Great. Waiting for changes to land in pustream in my lifetime. :)
https://bugs.winehq.org/show_bug.cgi?id=35655
Jonas Jelten jj@stusta.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jj@stusta.net
https://bugs.winehq.org/show_bug.cgi?id=35655
Michael Müller michael@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |STAGED CC| |michael@fds-team.de, | |sebastian@fds-team.de Staged patchset| |https://github.com/wine-com | |pholio/wine-staging/tree/ma | |ster/patches/wined3d-Revert | |_PixelFormat
https://bugs.winehq.org/show_bug.cgi?id=35655
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |focht@gmx.net Summary|Wined3d performance drop |3Dmark 2000 shows | |considerable performance | |drop after Wine 1.7.13 | |(expensive GetPixelFormat() | |called too frequently)
https://bugs.winehq.org/show_bug.cgi?id=35655
--- Comment #10 from Matteo Bruni matteo.mystral@gmail.com --- This should be fixed now (and this bug looks like a duplicate of bug 35718), can you retest to confirm?
https://bugs.winehq.org/show_bug.cgi?id=35655
--- Comment #11 from mrdeathjr28@yahoo.es --- (In reply to Matteo Bruni from comment #10)
This should be fixed now (and this bug looks like a duplicate of bug 35718), can you retest to confirm?
Hi in my case up but i up cpu since last test before have pentium G3220 3.0Ghz but now have pentium G3258 at 4.1Ghz
However at now shows 38624
More later upload video with this test
https://bugs.winehq.org/show_bug.cgi?id=35655
--- Comment #12 from mrdeathjr28@yahoo.es --- (In reply to mrdeathjr28 from comment #11)
(In reply to Matteo Bruni from comment #10)
This should be fixed now (and this bug looks like a duplicate of bug 35718), can you retest to confirm?
Hi in my case up but i up cpu since last test before have pentium G3220 3.0Ghz but now have pentium G3258 at 4.1Ghz
However at now shows 38624
More later upload video with this test
As commented before this is video with 3dmark 2000 test on wine 1.7.55
System Specs
Nvidia Drivers 358.09 Linux Mint 17.2 Raffaela XFCE Edition 64Bit - Kernel 4.0.0-040000-generic (ubuntu mainline) CPU: INTEL Pentium G3258 (Haswell 22nm) 4.1Ghz + Artic Cooling Alpine 11 Plus MEM: 8GB DDR3 1333 (2x4) Patriot value (dual channel: 21.3 gb/s) GPU: Zotac Nvidia Geforce GT630 (GK208 28nm: 384 Shaders / 8 ROPS) Zone Edition Passive Cooling 2GB DDR3 1800Mhz 64Bit (14.4Gb/s) MAINBOARD: MSI H81M E33
https://www.youtube.com/watch?v=S4gCfXuh-HI
https://bugs.winehq.org/show_bug.cgi?id=35655
--- Comment #13 from Wylda wylda@volny.cz --- I tried to re-test 1.7.55, but unfortunately during 3Dmark's test phases i randomly get "Benchmark aborted: window lost focus", so i'm unable to finish this in one run. I will come back to this during this weekend and try other systems than Debian Testing (per above YouTube, not everyone is affected).
https://bugs.winehq.org/show_bug.cgi?id=35655
Wylda wylda@volny.cz changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|STAGED |RESOLVED Resolution|--- |FIXED
--- Comment #14 from Wylda wylda@volny.cz ---
Fixed in wine-1.8-rc1.
Not only lost performace is back, but it is even faster than used to be original 1.7.13 (+11.7%). Both Wine version measured on currnet system several times.
Thank you Henri.
Sebastian, this can be probably dropped from staging?? https://github.com/wine-compholio/wine-staging/tree/master/patches/wined3d-R...
https://bugs.winehq.org/show_bug.cgi?id=35655
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #15 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 1.8-rc2.