Games running very poorly after first session (semi-solved, still need help though!)

Hey everyone! Ive been having issues where my PC will run really poorly after the first gaming session and fixing it was rebooting.

I thought it was the performance flag, but it seems that its the compositor. Gemini seems to think that

"If kwin_wayland --replace fixed the performance, it means the issue isn’t your hardware, your drivers, or your game—it’s the Desktop Compositor (KWin) getting “confused” between sessions.

What is actually happening?

In a Wayland environment, KWin is the “middleman” that takes the frames from your game and draws them on your screen.

  1. The Hangover: When you close the first game, KWin sometimes fails to release the “High Priority” or “Exclusive” rendering state it created for that game.

  2. The Conflict: When you open the second game, KWin tries to manage it while still “holding onto” the memory or timing of the first one. This causes a massive desync in frame timing, which feels like your PC is “taking a dump.”

  3. The Fix: By running --replace, you essentially killed the “confused” middleman and started a fresh one that has no memory of the previous game."

I’m working to try and resolve how to fix this with Gemini, but I also wanted to come to you guys and ask if anyone has run into this and how they dealt with it? And I also wanted to make this post so that way anyone else who happens to come across this problem and easily solve it themselves and enjoy Linux :smiley:

Appreciate you guys!

This is mostly non-sense, there is no “High priority”/"Exclusive rendering state in kwin. It tries to describe the frame buffer swapping logic it seems.
You never mentioned a second game.
LLM (like gemini) aren’t very reliable and depend on what they were trained on to be accurate. It does not know much about the Linux stack it seems. They will hallucinate instead of telling “I don’t know”.

kwin_wayland still relies on your hardware for anything, just because --replace fixed it, does not mean the issue is not a driver or isn’t driver-related at least.

First, what is your system info, kinfo.

Ive been having issues where my PC will run really poorly after the first gaming session and fixing it was rebooting.

Can you be more specific, frame-drops ? low fps ? Which games ? Any games are concerned ?

hi, welcome.

i have an alias that does systemctl restart --user plasma-plasmashell.service

whenever i need to clear up any weirdness, but i don’t recall using lately.

i used to have an issue like this with a game if it sat idle for too long and lost connection to the game server—when i reconnected it would laaaag like mad and was probably related to this.

Ive had that happen with this problem too. If I leave a game idle in the escape menu for a longer then typical period when I was unpause and come back it would be running very poorly. I’m trying to get to the bottom of it, but Gemini is.. well not the most intuitive troubleshooter and my Linux knowledge is pretty limited.

I hope someone on here though knows the answer to this! It drives me up the wall, Gemini thinks now it could be something with the kernel and the dGPU vs iGPU.

Did you have an iGPU when you were dealing with this issue?

Operating System: CachyOS Linux
KDE Plasma Version: 6.6.4
KDE Frameworks Version: 6.25.0
Qt Version: 6.11.0
Kernel Version: 6.19.12-1-cachyos-bore-lto (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5700G with Radeon Graphics
Memory: 32 GiB of RAM (30.7 GiB usable)
Graphics Processor 1: AMD Radeon RX 6600 XT
Graphics Processor 2: AMD Radeon Graphics

All games I have tried are effected from what I can tell, I also made a bug report about it just in case.

https://bugs.kde.org/show_bug.cgi?id=519036 (bug report)

Any other info I’m more then happy to provide! :smiley: Thanks for your time!

Are you sure this doesn’t have anything to do with it? I’m running CachyOS with the default kernel and I experience none of the issues you’re describing.

It happens on the default kernel, the bore-lto kernel. It starts from the moment I reformat into default CachyOS with KDE Plasma.

Have you tried the CachyOS forums? I’m also running a KDE Neon 6.6.4 system here and it also doesn’t exhibit the issues you’re describing. I honestly don’t think this is a Plasma related issue.

Yeah Ive posted in there Reddit forums and I’m heading to there forums right now, I just wanted to cover my bases. I just honestly don’t know where to start other then “kwin_wayland --replace &" Do you think this is a wayland issue or something specific to CachyOS likely? I haven’t tried any other distros to be honest but it may be worth a try. For now I’ve just been running “kwin_wayland --replace &" constantly to resolve it.

It’s not a Wayland issue, and it’s not a Plasma issue. I run two systems here, one with an Nvidia RTX 4070S running KDE Neon 6.6.4; the other running CachyOS with Plasma 6.6.4 with an Nvidia RTX 2070S - Neither exhibits the issues you’re describing.

Well I’m quite envious of you sir.

I have AMD hardware, but I enjoy it. Thanks for your time and input.

Processors: 16 × AMD Ryzen 7 5700G with Radeon Graphics
Graphics Processor 2: AMD Radeon Graphics

The ‘G’ means you have an APU, that might be the explanation.
The wrong GPU might be used the second time you launch the game.
There are ways to force a particular GPU for a program you can look into that, or disable the CPU internal GPU.

Work is underway to improve APU/GPU behavior. It might not be in 6.7, it needs a new wayland protocol (WIP MR)…

The last times I had problems like these the reason was actually the VRAM being full. Maybe next time it happens you could try a tool like LACT and see if anything looks suspicious. In my case it usually ended up being firefox hogging a lot of vram (probably a combination of hardware rendering and lots of youtube) and closing it freed like 5gb at once, then the game ran normal on the next start.

I actually use LACT and all seemed fine as far as I could tell. When this happens the GPU util is 99% and clock is 2800mhz, but the games will run at 25fps instead of 144+

I added this to my etc/enviroment

KWIN_DRM_DEVICES=/dev/dri/card1:/dev/dri/card0

and it seems like it may have fixed the issue and potentially even improved performance.

Does this seem like a reasonable fix for you? It was provided by Gemini and I just don’t trust AI at all really so confirmation from a human would be amazing. Thanks for your time and wisdom :smiley:

Yes you can check yourself or ask gemini for its sources: KDE - ArchWiki

Making this post for anyone in the future who may have this issue. You can use kwin_wayland --replace & to resolve the performance issue. But in order to make a permanent fix, I added

this to my etc/environment

KWIN_DRM_DEVICES=/dev/dri/card1:/dev/dri/card0

Then just save and reboot and it appears to have fixed things!