flightlessmango / MangoHud

A Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more. Discord: https://discordapp.com/invite/Gj5YmBb
MIT License
6.39k stars 282 forks source link

Frame limiter causes freezing/unstable frametimes in The Witcher 3: Wild Hunt #1302

Closed RaduAvramescu closed 5 months ago

RaduAvramescu commented 5 months ago

Describe the bug Using Mangohud's frame limiter, I ran into 2 issues in the application. Here are the issues I faced:

  1. The game can completely freeze in the menus (have to force close it).
  2. After being in game for like 20 seconds or so, frametimes start fluctuating massively.

List relevant hardware/software information

To Reproduce Steps to reproduce the behavior:

  1. Launch the application
  2. Select DX12
  3. Press "Play"
  4. Wait in the main menu until the application completely freezes (should happen in under a minute)
  5. For the other issue (the frametimes one), instead of point 4 load up a save game and simply wait for about a minute.

Expected behavior The application should not freeze, and the frametimes should remain consistent and not start fluctuating after a short period.

Screenshots Screenshot_20240421_115305

Additional context Similar issues were also reported here: https://github.com/ValveSoftware/Proton/issues/607#issuecomment-2027122530

zastrixarundell commented 5 months ago

I don't think that is MangoHud's issue. I have the same issue on KDE6. KDE5 could accept smoother frames which would fix this, KDE6 doesn't. Try to switch to Gnome and test it out. I didn't have this issue there.

flightlessmango commented 5 months ago

https://github.com/ValveSoftware/Proton/issues/607#issuecomment-2027803365 As per this comment it appears it's happening with gamescope frame limiter as well. This makes me think it's probably a wine/proton issue rather than a mangohud one

RaduAvramescu commented 5 months ago

Thanks for the suggestion @zastrixarundell. I did a complete reinstall, this time choosing Fedora Workstation 40 instead of the KDE spin.

The Mangohud version is still v0.7.1, kernel is 6.8.8, and Mesa 24.0.6 (though I also tried mesa-git). I was unable to reproduce either of the issues, with Mangohud's framelimiter on. The frames were always smooth, and there was also no freeze regardless of how long I waited in the game's menus.

As such, I think @flightlessmango is correct and it's a Wine/Proton issue, or, more likely, KDE one. The fact that it happens with Gamescope's frame limiter also points in the direction that it's not Mangohud at fault.

I'm closing this issue and will refer to this comment on the Proton thread. Thanks to both of you!

PS: Obviously, feel free to change how the issue is closed - not sure if it should be closed as completed or not planned (wasn't sure what's the correct one in this case).

Mershl commented 5 months ago

I've ran a few tests on GNOME (wayland) and while I don't see the freezes, I still "see" an unstable frametime graph.

  1. ~Set an fps_limit in mangohud (97 in my case)~ (described issue is independent of frame limiter)
  2. Start Witcher 3 (next-gen latest patch). Make sure it's the DX12 version and the game is in Fullscreen. (Tested Ultra preset, Vsync disabled)
  3. Choose New Game -> "Blood and Wine Only" -> any difficulty
  4. Ride slowly into the village just ahead of you
  5. After 10 seconds mangohud's frame graph will show a jigsaw pattern ranging from 0.4ms to 27.0ms
  6. The game feels perfectly fine and nothing like the graph suggests. Using ALT+TAB (while the game is still running) shows that gnome-shell itself is permanently stuttering - exactly like the frametime graph. Again: the gameplay does not show any stuttering and is perfectly smooth.

image

Tested on Fedora 40, Gnome 46.1, wayland session, 7900XTX. Issue is seen with and without VRR enabled.

RaduAvramescu commented 5 months ago

@Mershl Okay, this is interesting.

Actually, I have unstable frametimes after a while as well, but I get that regardless of VRR setting, and also I don't need to have a frame limit on. That said, just like you, there is no difference in terms of how smooth the game actually feels even after that point.

This was not my experience on KDE (the frametimes were both unstable and the game wasn't smooth, and of course the main issue there is that the game would freeze).

I don't think this is Mangohud related though, especially as it happens without limiting the frames for me.

Mershl commented 5 months ago

I don't think this is Mangohud related though, especially as it happens without limiting the frames for me.

You're absolutely right. The issue is seen with and without framelimit. And with and without mangohud.

Still interesting that the framegraph shows the stuttering of the shell, which is not perceived in gameplay.