Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Framerate is similar or lower with AMD (Mesa) on Guild Wars 2 #11

Closed
yaomtc opened this issue Feb 27, 2018 · 80 comments
Closed

Framerate is similar or lower with AMD (Mesa) on Guild Wars 2 #11

yaomtc opened this issue Feb 27, 2018 · 80 comments

Comments

@yaomtc
Copy link

yaomtc commented Feb 27, 2018

Using a Radeon RX 580 with an Intel i5 4690k, with Linux 4.15.6, Mesa 17.3.6, and the pba-2.21 build from Lutris 0.4.14. With a static camera angle and position, performance is right around 36-40 fps in unpatched 2.21, in pba 2.21, and in Wine 3.1. All options in Lutris are set to the default, except Lutris runtime is disabled.

@yaomtc yaomtc changed the title Slight fps decrease with AMD (Mesa) on Guild Wars 2 Framerate is similar or lower with AMD (Mesa) on Guild Wars 2 Feb 28, 2018
@shmerl
Copy link

shmerl commented Feb 28, 2018

Can you try with Mesa master for comparison too?

@yaomtc
Copy link
Author

yaomtc commented Feb 28, 2018

The latest version of Mesa available on Solus currently is 18.0 RC4. Having installed that, the fps is about the same.

Also tested WoW just now. Getting about a third of the framerate I do with regular wine-staging 2.21.

Would there be any logs I could provide that would help?

@jrugia
Copy link

jrugia commented Feb 28, 2018

Can you try my build from a few days ago? Link: https://drive.google.com/open?id=1rKlHUTgNEBEzbkgmuRoV-Krf6k-UVW5-

I'm currently running that, and the performance with Nvidia is amazing, no more stutters, Tequatl event keeps it's cool with 25-40fps. You can find my complete settings in this GoL thread: https://www.gamingonlinux.com/forum/topic/3199/post_id=14579

Unless you're running Wine-Gallium-Nine, don't bother with anything higher than Wine Staging 2.0 for GW2, the game took a nose dive since Wine 2.1 onwards, by as much as 15-30 fps. This is the picture I took some time ago as posted in the WineHQ bugs report: https://bugs.winehq.org/attachment.cgi?id=60162

For the record I tested the above theory on my laptop with Intel HD and the result has been the same, So the improvements don't seem to be limited to Nvidia. Tomorrow I will try it again on that laptop with PBA and report back.

Tequatl tonight:
leeerrroooyyy

@Espionage724
Copy link

Espionage724 commented Feb 28, 2018

@Armored87 Hi, I'm a bit curious about your Staging 2.0 note. I noticed a long time ago that when I was using laino's Wine patches, GW2 was fantastic on 2.0, but I also noticed that applying the same patches on anything newer wasn't quite as-nice (performance was a bit lower).

Question about the build at that GDrive link; is it Wine 2.21 with just the pba patches and Staging? Any other patches?

And on the same note, do you (or anyone else) know if the current pba patches apply or do anything useful for Wine + Staging 2.0?

@IngeniousDox
Copy link

Wine Staging 2.0 has is much faster for DX9 + CSMT then any version of Wine afterwards. This was for every DX9 game I have. I have even maintained a branch for WoW2.0 with the ntdll patches myself for this very reason. But now at least for Nvidia pba is now faster.

I haven't tested applying pba to Staging 2.0, since I just want DX11 now. Let us know your results if you try though.

@jrugia
Copy link

jrugia commented Feb 28, 2018

@Espionage724

The build is Wine 2.21 Source + Staging 2.21 Patches + PBA from a few days ago, built on Debian 9.3. I run the game though on Mint 18.1.

EDIT:

I tested the game on my laptop: i3-5005U, 16GB Ram, Debian 9. Framerate is the same and it seems to me that with 2.21 PBA it stutters a bit more.

There's a long time question I never had the chance to ask to a GW2 Linux user with AMD: Does the game run if you set UseGLSL to "disabled" in Wine regedit?

With Nvidia I can run the game with this disabled but with Intel Mesa the game refuses to run unless it's enabled.

I will be running a few more tests today with GW2, particularly on systems with 8GB RAM and desktop i5 CPU's.

@Espionage724
Copy link

@Armored87 With GLSL off on NVIDIA (at least in the past with several Wine versions and Staging 2.21), one strange bug I noticed is that grass and plants spin and move when they shouldn't; pretty noticeable in Queensdale. I don't believe I've seen any notable performance improvement with GLSL off.

@IngeniousDox Hmm, which ntdll patches were you referring to? laino's?

@yaomtc
Copy link
Author

yaomtc commented Feb 28, 2018

@Armored87 With that build, Guild Wars 2 actually does get a noticeably lower fps (~22 fps) than the regular Wine Staging 2.21 (~37 fps). Was standing in the same spot in Metrica Province.

EDIT: Just redownloaded the pba build from Lutris, that version also gets ~37 fps in that spot.

@jrugia
Copy link

jrugia commented Feb 28, 2018

@Espionage724 I never noticed that in Queensdale, can you tell me in which particular area you've seen it? Also I seem to have missed your question about PBA and Staging 2.0.

I never tried but I guess I could check, right now I'm in the process of migrating my compiling environment to a better system, building both 32 and 64bit Wine with my current (Core 2 Q6600) system takes me over an hour.

I will also be running the aformentioned test on the i5 / 8GB system.

@yaomtc Is the build from Lutris using the latest PBA?

@IngeniousDox
Copy link

@Espionage724 awesies (to counter Blizzard DRM) and a couple of others so WoW worked with staging 2.0.

@yaomtc
Copy link
Author

yaomtc commented Feb 28, 2018

There's a long time question I never had the chance to ask to a GW2 Linux user with AMD: Does the game run if you set UseGLSL to "disabled" in Wine regedit?

Forgot to answer this, @Espionage724. "Use GLSL" is actually available under "runner options" in Lutris. The GW2 wiki recommends disabling that option, but personally I don't notice a difference. Disabling it might give it 1-2 extra fps, maybe. That advice might be outdated, or might be Nvidia specific. (A lot of Linux gaming advice is Nvidia specific, unfortunately...)

@Armored87 I don't know what build Lutris provides, I can only tell you I deleted it and downloaded it again less than an hour ago with about the same fps as the unpatched 2.21.

@IngeniousDox
Copy link

IngeniousDox commented Feb 28, 2018 via email

@jrugia
Copy link

jrugia commented Feb 28, 2018

Long Post Beware:

I Ran the test with GW2 on an i5-4590 / 8GB Ram / GTX 960 384.111 / Using latest PBA. Didn't notice any performance loss compared to my previous build. To say I went from 16 threads Ryzen 1700X to a quad core, the fps difference was minimal, in action areas such as fractals it did quite well at keeping that 42+. I'm very happy with the results.

I've also did Tequatl tonight with the i5 system, the frame rate was pretty good considering the amount of players during that event. I didn't experience any stutters even when the fps was down to 20, average 25-30 during the event.

Usages throughout the tests:

CPU: About 45% on 3 cores, 100% on the 4th.
GPU: 57% Peak, with about 31% Memory used (2GB Card)
RAM: (about 45mins Including Tequatl) game was only occupying 3.3GB

The Highlight of this build: The ram usage went down by at least 1GB and the at the end of the test the total difference compared with the old one was 1.4GB, meanwhile the performance remained the same for the most part (I did notice a slight fps increase with the Ryzen build though). The cores are also being utilized better, before with Staging 2.0 it was 2 cores at like 100% while the other 2 relaxed.

So without further ado, here's the new build: https://drive.google.com/open?id=1TdFwaZ7juoiPawa9d2TCz3i7xZ9vswmR

@Espionage724
Copy link

The patches don't apply as-is on Staging 2.0 for anyone interested; could probably rebase them to apply though.

I have a new wine-pba build going up on my Fedora Copr with commit 68de8e9

@Espionage724
Copy link

@Armored87 Here's a video of the grass at Vale Waypoint with GLSL disabled: https://hooktube.com/watch?v=COwIQ63-ZwU (or YT)

@jrugia
Copy link

jrugia commented Mar 1, 2018

@Espionage724 Thanks for the video, I get what you mean now. It's as if the grass animations move about 2-3 times as fast. GLSL enabled brings them to normal speed however I noticed some stutters, more noticeable when moving the camera, particularly in LA where it's CPU heavy.

This might be the answer why some animations in other games appear too fast. For GW2 however the stutter is a bit annoying, I'll have to leave it disabled and pretend it's a windy day in Tyria.

@yaomtc
Copy link
Author

yaomtc commented Mar 1, 2018

It's good to have more data, y'all, but this report is about performance with Mesa, not with Nvidia. Or should we really just treat this as a general Guild Wars 2 Performance Thread?

@shmerl
Copy link

shmerl commented Mar 1, 2018

Performance with Mesa is one major use case, so this bug is about it.

@acomminos
Copy link
Owner

It would be helpful to get the following data to better understand the issue, as I don't have an AMD card:

  1. A log of game execution with WINEDEBUG=d3d_perf
  2. Text output from a profile during execution (using perf record)

@yaomtc
Copy link
Author

yaomtc commented Mar 6, 2018

I did do the former (included WoW and Deus Ex HR too for the heck of it, both of which were very heavily impacted in fps), but I don't know how to use perf. It just gives me a segfault when I try to run wine with it.
dxhr-pba-output.txt
gw2-pba-output.txt
wow-pba-output.txt

@yaomtc
Copy link
Author

yaomtc commented Mar 6, 2018

Realized I had to run perf record as root. Then I realized I couldn't get past the Guild Wars 2 launcher hang, despite having it working as a normal user... I could try it with WoW instead, but first I'd have to figure out how to get text output from perf report, or do I use perf annotate?

@acomminos
Copy link
Owner

Thank you very much! Your logs indicate that we're going through the right code paths for persistently mapped buffers- I suspect either fence testing or issuing is slow here, since those are the only new driver calls introduced by this patch (after PBA initialization, of course). If it's not that, then it's likely to be buffer storage issues (i.e. mesa/gallium isn't putting our persistent buffer where we want it to be).

Can you try revision 27fc725 when you get a chance? That should greatly reduce the volume of fences, and normalize behaviour across games. It'll likely improve performance for NVIDIA users as well.

@yaomtc
Copy link
Author

yaomtc commented Mar 6, 2018

Sure, but I've just been grabbing the latest build Lutris provides, since it's an easy way to get the pre-patched binaries. On the downside, I have no idea what revision I'm getting from it, or how long it would take for their build to be updated.

@acomminos
Copy link
Owner

Whoops, you're likely going to want to try 34a2a05 instead.

how to get text output from perf report, or do I use perf annotate?

If that doesn't fix your issue, you're going to want to use perf record -p <wow-pid> to get a trace, and perf report --stdio to get a readable plaintext output of the trace.

@acomminos
Copy link
Owner

Additionally, if anyone could test 1bc7015 on radeon, that would be great.

A brief look at the radeon gallium driver suggests it may help with streaming.

@PadreAdamo
Copy link

PadreAdamo commented Mar 6, 2018

Another Guild Wars 2 player checking in! I have not gotten any increased performance but it seems that everything is alot smoother, less frame spikes overall? I would like to help. I'm not a seasoned command-line guy and a generally newer Linux user but I want to help. I'm on Solus.

I have slightly different hardware than the OP... RX 580 w/AMD Ryzen 1600X and I get average of 19-23 FPS in open maps. At the log-in screen with -dx9single argument I get 63 FPS.

@jrugia
Copy link

jrugia commented Mar 6, 2018

@PadreAdamo 19-23 is fairly low for that hardware specs, Can you post a screenshot of your in game graphics settings?

@PadreAdamo
Copy link

@jrugia Everything is at High/Ultra EXCEPT models on screen is set for "Lowest" but using the "Highest" quality models. I'm also on a resolution of 4000x1170 (across three screens). I'm all ears on helping me get better FPS though :-)

@yaomtc
Copy link
Author

yaomtc commented Mar 6, 2018

I'd turn Shadows to Low, that has a significant impact on performance, I've found.

@jrugia
Copy link

jrugia commented Mar 8, 2018

@acomminos I will give it a more in depth test tomorrow.

@PadreAdamo
Copy link

PadreAdamo commented Mar 9, 2018

@jrugia I managed to get to 30+ FPS in most areas and 60+ in (SPVP) by adding the following:
"DirectDrawRenderer"="opengl"
"VideoMemorySize"="8024"

Thank you :-)

@yaomtc
Copy link
Author

yaomtc commented Mar 9, 2018

OpenGL is already the default option: https://wiki.winehq.org/Useful_Registry_Keys

Setting the value for VideoMemorySize didn't seem to make a difference for me. What's SPVP?

@jrugia
Copy link

jrugia commented Mar 10, 2018

@yaomtc SPVP is Structured Player vs Player :-)

Just tried latest PBA with Wine 3.3 Staging. Performance is significantly worse on Nvidia: https://i.imgur.com/c9hQMXu.jpg

Can anyone with AMD test this please?

3.3 Build: https://drive.google.com/file/d/1Oc57KEzp1bfOW_lQE2dw2ksZJpkhzFL2/view?usp=sharing

Old 2.21 Build: https://drive.google.com/file/d/1TdFwaZ7juoiPawa9d2TCz3i7xZ9vswmR/view

@Espionage724
Copy link

Espionage724 commented Mar 10, 2018

Edit: 0004-wined3d-Use-GL_CLIENT_STORAGE_BIT-for-persistent-map.patch (commit) seems to be causing the high GPU usage and overall lower performance. Removing that patch as of 4b64220 helps significantly.

I'm on NVIDIA, but this might be useful info regardless. It seems wine-pba (4b64220) increases GPU usage a lot, but I'm not entirely certain it's helping average FPS.

Vanilla Wine 3.3 currently has better overall performance. Staging 2.2 + an older commit of wine-pba provides the best performance by a good bit.

Here's some testing results in a few places in Queensdale (teleported to the WP and left camera facing in default location, little-to-no other players in-front of the camera):

Water Pipe Vista (looking towards Shaemoor Garrison)

  • Vanilla Wine 3.3 - 31 FPS -- 35% GPU
  • 3.3 Staging + pba (4b64220) - 33 FPS -- 100% GPU
  • 3.3 Staging + pba (older) (34a2a05) - 41 FPS -- 29% GPU
  • 2.21 Staging + pba - 43 FPS -- 27% GPU

Orchard Waypoint

  • Vanilla Wine 3.3 - 38 FPS -- 36% GPU
  • 3.3 Staging + pba (4b64220) - 22 FPS -- 100% GPU
  • 3.3 Staging + pba (older) (34a2a05) - 47 FPS -- 39% GPU
  • 2.21 Staging + pba - 55 FPS -- 40% GPU

Claypool Waypoint

  • Vanilla Wine 3.3 - 33 FPS -- 38% GPU
  • 3.3 Staging + pba (4b64220) - 30 FPS -- 100% GPU
  • 3.3 Staging + pba (older) (34a2a05) - 45 FPS -- 40% GPU
  • 2.21 Staging + pba - 40 FPS 38% GPU

Swamplost Haven Waypoint

  • Vanilla Wine 3.3 - 47 FPS -- 37% GPU
  • 3.3 Staging + pba (4b64220) - 46 FPS -- 100% GPU
  • 3.3 Staging + pba (older) (34a2a05) - 62 FPS -- 39% GPU
  • 2.21 Staging + pba - 64 FPS -- 40% GPU

@IngeniousDox
Copy link

@Espionage724 If you have __GL_THREADED_OPTIMIZATIONS=1 with Wine-PBA 4b64220, you might want to try without it. In D3/WoW my fps was down because I had it on, turning it off increased my fps again over previous builds where it was still helping.

@Espionage724
Copy link

@IngeniousDox I turned it off; I did a clean Fedora install a few hours ago and noticed that GW2 had more hitching with it enabled. Seems like it makes generating the texture cache (on NVIDIA's end) much worse, but it might be ok once all textures are pre-compiled.

But since it doesn't offer much of a performance difference or drop in CPU usage, it's probably better off.

I also added my 2.2 Staging + pba results to the above post; seems like there is some kind of regression from that point and now.

@acomminos
Copy link
Owner

I'm curious- can you skip applying the patch 0003-wined3d-Use-ARB_multi_bind-to-speed-up-UBO-updates and let me know how this affects your FPS?

@IngeniousDox
Copy link

@Espionage724 Correct, since you disable __GL_THREADED you also disable multi threaded creation of shaders. Filling the shader cache will be slower.

@Espionage724
Copy link

Espionage724 commented Mar 11, 2018

@acomminos I was having a hard time getting Copr to start a build without that patch, but it looks like it's building right now. I'll get some performance numbers in about an hour with all patches up to commit 4b64220, and 0003-wined3d-Use-ARB_multi_bind-to-speed-up-UBO-updates.patch excluded.

In the meantime however, I did testing on an older version of Wine I had. The build was done sometime between 27fc725 and 34a2a05 and I added the FPS/GPU usage to the above #11 (comment) post. Basically it seems to be pretty similar to 2.21.

@Espionage724
Copy link

@acomminos Excluding 0003-wined3d-Use-ARB_multi_bind-to-speed-up-UBO-updates with the latest commit didn't change anything (GPU usage is still 100% with lower FPS)

@acomminos
Copy link
Owner

@acomminos Excluding 0003-wined3d-Use-ARB_multi_bind-to-speed-up-UBO-updates with the latest commit didn't change anything (GPU usage is still 100% with lower FPS)

Hm, alright- thanks for testing that. If you have the time, I'd be interested in whether or not skipping 0004-wined3d-Use-GL_CLIENT_STORAGE_BIT-for-persistent-map.patch makes a difference.

Also, if you're getting any interesting WINEDEBUG output related to buffer allocation, that would be good to know.

@Espionage724
Copy link

@acomminos Excluding 0004-wined3d-Use-GL_CLIENT_STORAGE_BIT-for-persistent-map.patch brings FPS up and lowers GPU usage; it's pretty much matching Staging 2.21 performance now.

@acomminos
Copy link
Owner

Bizarre, but good to hear. What NVIDIA driver version are you using?

@Espionage724
Copy link

390.25

@acomminos
Copy link
Owner

Is there any interesting WINEDEBUG output (particularly pba-related under the d3d_perf channel)? On my machine (NVIDIA), GL_CLIENT_STORAGE_BIT makes the difference between DMA cached and system heap backed memory (when set and unset, respectively). The former should be faster for streaming.

@Espionage724
Copy link

Espionage724 commented Mar 11, 2018

I did about 30 second with d3d_perf with that patch enabled (high GPU load, low FPS): https://paste.ee/p/PhaRQ

And here's without the patch (low GPU load, high FPS): https://paste.ee/p/WxSLZ

@Espionage724
Copy link

I'm also on an Optimus laptop; I have the typical NVIDIA driver set-up (no Bumblebee, render-everything-on-NV-GPU).

@PadreAdamo
Copy link

@yaomtc I think my results were due to a placebo effect and possibly amount of people logged into the area (Mistlock Sanctuary). I overclocked my RAM from 3200 to 3833 and I got dramatic improvement. I'm going to bump to 4k tonight. I went from 30 average to roughly 43 average.

@jrugia
Copy link

jrugia commented Mar 12, 2018

@Espionage724 I really really must ask you, is it possible to always run such a laptop with the Nvidia GPU only? Let's say I don't care about the battery life but I prefer that than running it through Optimus/Bumblebee, also would it still be possible even if you can't turn off Intel HD from the bios?

@Espionage724
Copy link

@jrugia With my comment, I meant that I have the Intel iGPU enabled, but it has acceleration disabled and everything is accelerated with the NVIDIA dGPU.

I have a modded BIOS that does allow me to disable the Intel iGPU, but it stop the built-in laptop display from working. Even with a display attached to the HDMI port (which is wired to the NV GPU), nothing displays on it until late-stage booting of an OS (so no BIOS, GRUB, and about half of the Linux boot process is displayed).

@jrugia
Copy link

jrugia commented Mar 15, 2018

@Espionage724 For a moment I had hope that a modern laptop existed without the Intel-Nvidia passthrough. Unless it's an older laptop I'd rather not experiment with bios flashing, in the case something goes wrong, it's a time consuming task to de-solder, reflash and re-solder the chip. Thanks for the explanation, glad to know it's possible in some way though. :-)

@mirh
Copy link

mirh commented Apr 1, 2018

Slowness on AMD cards is highly likely due to
https://bugs.freedesktop.org/show_bug.cgi?id=102204

@shmerl
Copy link

shmerl commented Apr 13, 2018

Is anyone working on fixing it in Mesa?

@yaomtc
Copy link
Author

yaomtc commented Apr 13, 2018

I've noticed significant improvement in AMD performance with WoW when compared to Wine Staging, just not with this game for some reason. (GW2's poor optimization compared to WoW is probably a factor.) Though I haven't tested in a few weeks.

@Goldpaw
Copy link

Goldpaw commented Apr 13, 2018

Well have you tried this on mesa and amd lately, @shmerl? It's had great performance for quite some time now. :)

@mirh
Copy link

mirh commented Apr 13, 2018

just not with this game for some reason. (GW2's poor optimization compared to WoW is probably a factor.)

The golden metric should just be windows performance, not game vs game.

Also, maybe you could point out some other free test case on the bugzilla.

@shmerl
Copy link

shmerl commented Apr 13, 2018

I tried it recently (with The Witcher 3). Performance was very bad.

@yaomtc
Copy link
Author

yaomtc commented Jan 22, 2019

Now I get a huge framerate boost with PBA enabled VS not, in Guild Wars 2. Probably has to do with Mesa improvements since last time.

@yaomtc yaomtc closed this as completed Jan 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants