ValveSoftware / steam-for-linux

Issue tracking for the Steam for Linux beta client
4.13k stars 174 forks source link

Running Steam with an AMD+NVIDIA GPU combo at least once results in constant screen repaints on KWin Wayland #10847

Open fililip opened 2 weeks ago

fililip commented 2 weeks ago

Your system information

Please describe your issue in as much detail as possible:

After running Steam at least once on a KWin Wayland session with both an AMD and NVIDIA GPU (and their corresponding drivers loaded into the kernel), always-on VRR for desktop breaks entirely, forcing the full refresh rate at all times. Closing Steam, hotplugging the display and/or killing Xwayland after that don't seem to help. Fullscreen is unaffected.

I did some more digging and found the Show Paint desktop effect in KWin. The results are as follows: before Steam has ever been opened during a session on an empty desktop everything is fine. After Steam has run at least once, the effect constantly triggers (so there are constant repaints), even on the secondary screen which didn't even display Steam on it even once.

This is not just an issue for always-on desktop VRR though, as it also increases KWin's CPU usage (though by a very insignificant amount, something like 0.5% per thread on average).

To fix it, I need to restart KWin by either executing kwin_wayland --replace or relogging.

However, regular PRIME offloading, with both X11 and Wayland applications/games or CUDA work do not trigger this. Only Steam seems to trigger something.

When there is no nvidia driver loaded at all, running Steam works just fine (the issue doesn't exist, everything repaints only when needed), pointing to some kind of mutual issues with Steam and the nvidia driver.

Running Steam in gamescope does not cause any issues at all though.

Steps for reproducing this issue:

  1. Enable the Show Paint effect in KDE's desktop effects menu, notice how there aren't any repaints when nothing is happening on an empty desktop
  2. Have the nvidia driver loaded
  3. Run Steam
  4. Observe how repaints happen every display refresh regardless of whether something needs a repaint or not

Original KDE bug report: https://bugs.kde.org/show_bug.cgi?id=485425

As this isn't really any kind of dealbreaker, I am mostly curious here what Steam (on a real desktop session, outside of gamescope) does together with the nvidia driver to cause this.

Thanks in advance!

fililip commented 2 weeks ago

A workaround is to run Steam in gamescope, like so:

gamescope -w 1920 -h 1080 -r 165 -e -- steam -gamepadui

(I have a 165Hz primary display, you will need to adjust it accordingly)

dev0T commented 1 week ago

Same thing. Running EndeavourOS with a 7800X3D CPU and GTX 1070 GPU.

In addition to the flickering, I also get this weird glitching appearence:

image

Edit: With the above workaround I am still getting the flickering/glitching

image