prasanthrangan / hyprdots

// Aesthetic, dynamic and minimal dots for Arch hyprland
GNU General Public License v3.0
7.57k stars 876 forks source link

Stuttering in games #667

Closed hoodust closed 9 months ago

hoodust commented 11 months ago

In some games I get horrendous "stuttering" -- like it's replaying old frames. This can range from blurriness to jitter to being entirely unplayable. Cities: Skylines II is horrifically stuttering 100% of the time, but most games that are affected do it only at certain times. Cyberpunk 2077 does it when in certain parts of the city and facing a certain direction, regardless of graphics settings (in fact lowering graphics settings makes it much worse in this and most other games). Some games, even demanding ones, are entirely unaffected and run flawlessly.

The Hyprland wiki says to use gamescope, but after just three "vulkan" lines of output I get a segmentation fault trying to run it on its own or on any game. Google-fu is failing me on how to even troubleshoot that.

Game mode (super+alt+g) makes no difference. Steam, Heroic Games Launcher, Lutris... doesn't matter what wine/proton

Nvidia 2080Ti with latest 545.29.06 drivers. Minimal Arch install and hyprdots from there.

Anyone else have anything like this? I've been trying for weeks to figure it out and am out of ideas.

ApolloFortyNine commented 11 months ago

I have experienced the same, if the game your playing natively supports wayland, enabling it fixes the issue (Factorio for instance runs perfectly after). I also had 'fixed' the issue for a bit by downgrading the nvidia driver to before the last major update, 543 maybe? I had read the new drivers have 'better' support for Wayland, but it's when the issues started for me.

I've also heard playing around with gamescope can fix the issue.

hoodust commented 11 months ago

@ApolloFortyNine you mean 535? Unless there's a 543 for other cards.

I've done a ton of research before and after your comment and most threads die out with everyone reverting to 535, so I think you're right.

I managed to get gamescope to start (i.e. no segfault) by downgrading to 3.12.5-1, but anything run with it just opens an instantly frozen window and spams vblankmanager: write failed: Resource temporarily unavailable after a minute and until you kill the process. I found a thread with people troubleshooting this but eventually it seems (you guessed it) they pointed to a bug in the nvidia drivers and had to downgrade them.

However I'm pretty certain I'll break everything if I attempt to downgrade, lol. Plus 535 apparently causes Cyberpunk 2077 to crash, one of the games I'm trying to get running without this issue.

prasanthrangan commented 11 months ago

Hi, i'm unable to replicate this on 545.29.06 driver. I dont have Cyberpunk 2077 currently installed, will give it a try when i get a chance.

hoodust commented 10 months ago

Hi, i'm unable to replicate this on 545.29.06 driver. I dont have Cyberpunk 2077 currently installed, will give it a try when i get a chance.

Thanks.

It happens with other games too, but very noticeable in many parts of the map in CP2077. It happens on any Proton/GE/Wine that will get the game to run. It also happens in Control (by Remedy) and even some non-demanding games like the System Shock remake, Space Hulk (old top-down strategy game), Space Hulk Deathwing (FPS game), etc. but it tends to be more noticeable in newer, more demanding games.

Games like Portal, Rise of the Tomb Raider (DX12), Prodeus, Polybius, Project Zomboid, etc. are not affected at ALL and run perfectly.

If you happen to have Cities: Skylines 2 (Steam), it's insanely bad 100% of the time on any graphics settings. It's so bad you can see it on the circular loading bar.

ACTUALLY even just scrolling through my library in Steam or Heroic Games Launcher is very stuttery, more so the larger the window is. This doesn't happen in browsers or other scrollable windows like kitty, vscode, or dolphin. I assume this isn't the case for you? If not, any ideas what I can do to troubleshoot?

SushiByte-beep commented 10 months ago

Could this issue be related to the monitor's refresh rate? I've been experiencing a problem for a while and am uncertain whether to create a new post or reply here.

I use a monitor with G-Sync support and have set vrr=1 in the configuration. I've noticed that the adaptive refresh rate only activates when viewing an empty workspace. As soon as any window or program is displayed, my system seems to force the maximum refresh rate.

This isn't a major issue for older, smaller games where achieving high frame rates is likely, such as Portal.

However, it's very noticeable in games like The Witcher III and other titles with high graphics settings.

Lowering the graphics settings sometimes makes the symptoms less noticeable, but it's never a complete solution.

On my RTX 2070, this issue has persisted since June, and I've tried nearly every driver available. When testing from different window managers (with working adaptive refreshrate) on the same machine doesn't exhibit these problems.

hoodust commented 10 months ago

@SushiByte-beep It sounds like you're describing something different. In my case it's not just noticeable, it's a VERY unpleasant flickering, showing old frames (constantly in some games) and it happens on my both my older 60hz monitor and my newer 175hz/gsync monitor regardless of what refresh rate I set, vsync, etc. Lowering graphics settings makes it WORSE (not better) in affected games. The games that aren't affected can be well below 175 or even below 60fps and never demonstrate it.

e.g. in Cities: Skylines II if I lower graphics settings -OR- set the monitor refresh rate to 60, the rotating cranes in-game look like the second hand on a watch twitching back and forth between 2 adjacent seconds about 5-10 times a second. The best I can get it to look is still abysmally "blurry" and completely unplayable (this coming from someone who has completed entire FPS games at <20 fps).

hoodust commented 10 months ago

Little update on this... I did a new/clean install of minimal Arch + Hyprdots on another drive of the same computer for testing (same problems out of the box) and then tried downgrading the nvidia drivers to 535.113.01: ALL graphical stuttering/old-frames/etc. issues disappeared in ALL games, and even desktop window glitches were fixed (some apps like kitty were flickering black a bit when resized for example). Steam and Heroic still scroll clunky, but I can totally live with that.

Unfortunately Cyberpunk 2077 indeed always freezes/crashes after 5-15 minutes in-game on 535, which tracks with reports I had heard. Some say even older drivers can fix this, however I can't get the desktop environment (or even login screen) to launch when trying anything older than 535.113.01 so far... not sure if Hyprland just doesn't support it or what.

To add more data, neither game age nor specs/performance demands are a factor at all. Wandersong (a 2018 2D sidescroller puzzle/adventure game) stutters badly 100% of the time, the remaster of 1998's adventure game Grim Fandango flickers black constantly, and many other low-spec games have similar problems, however 535 fixes them all. Also fullscreen/windowed/borderless make no difference.

hoodust commented 9 months ago

Solved: sorta...

nvidia 545 drivers still suck, and default downgrade (at least on arch) 535 version has problems in some games (like freezing in Cyberpunk 2077) but I used the nvidia-tkg script to install Vulkan dev 535.43.22 drivers and everything works perfectly with excellent performance. I couldn't get past the login screen with the 6.7 kernel and these drivers, but 6.6.10 is perfect.

https://github.com/Frogging-Family/nvidia-all