protonscr

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

steamclosed Window managerDistro Family: Arch
ValveSoftware/steam-for-linux#10847 · opened 2024-05-03 by fililip · updated 2024-05-23 · 3 comments · github
Ffililip 2024-05-03 github

Your system information

  • Steam client version (build number or date): 1709846872

  • Distribution (e.g. Ubuntu): Arch

  • Opted into Steam client beta?: No

  • Have you checked for system updates?: Yes

  • Steam Logs: steam-logs.tar.gz

  • GPUs:

    • AMD Radeon RX 6600 XT (Display)
    • NVIDIA GeForce RTX 4070 Super (CUDA, VFIO virtual machines and PRIME game offloading, no screen is plugged into that card)

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!

Ffililip 2024-05-04 github

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)

Ddev0T 2024-05-08 github

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

Ffililip 2024-05-23 github

This is very easy to fix: disable the window open/close effect or switch it from Glide - it's the troublemaker.
See https://bugs.kde.org/show_bug.cgi?id=485425

Nothing extracted yet.