Game-performance prevents suspend

Hello,
I think recently something has changed, not sure what exactly since I’m doing daily updated but opening a game from Lutris causes sleep block.

Once I’m finished playing game when I try to put PC to sleep button does nothing.
I noticed “rocket” icon in the tray I never seen/didn’t notice.

When running systemctl suspend I get

❯ systemctl suspend
Operation inhibited by "powerprofilesctl launch -p performance -r Launched with CachyOS game-performance utility -- /usr/bin/steam steam://rungameid/2358720" (PID 22771 "systemd-inhibit", user cachy), reason is "CachyOS game-performance is running".
Please retry operation after closing inhibitors and logging out other users.
'systemd-inhibit' can be used to list active inhibitors.
Alternatively, ignore inhibitors and users with 'systemctl suspend -i'.

systemd-inhibit
WHO                                                                                                            UID  USER  PID   COMM            WHAT                                                                       >
NetworkManager                                                                                                 0    root  970   NetworkManager  sleep                                                                      >
Realtime Kit                                                                                                   0    root  1281  rtkit-daemon    sleep                                                                      >
UPower                                                                                                         0    root  1545  upowerd         sleep                                                                      >
PowerDevil                                                                                                     1000 cachy 1457  org_kde_powerde handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch >
Screen Locker                                                                                                  1000 cachy 1192  kwin_wayland    sleep                                                                      >
powerprofilesctl launch -p performance -r Launched with CachyOS game-performance utility -- /usr/bin/steam st… 1000 cachy 22771 systemd-inhibit shutdown:sleep:idle

Anyone knows if this is some kind of new “feature”?
I didn’t have any problems with suspend so far, I wonder if this is some kind of bug with Lutris/game-performance that after closing game it keeps process running.

Why is the whole of steam using game-performance?

How was that configured?

Honestly, no idea, I configured Steam initially following Gaming with CachyOS Guide, I didn’t add any launch option inside of Steam, everything goes through Lutris:

I just noticed while getting screenshot, in Lutris it thinks that game is still running, there is “Stop” button visible.
Weird, it’s for sure not running, inside of Steam I can only launch this game so I think from Steam perspective it was stopped but not for Lutris

Edit: Just tested it, clicking Stop in Lutris unlocks possibility to suspend

Ok so its not really steam itself being launched with that option - though thats how some of the messaging made it appear.

As for the game not fully ending somehow .. sounds like it could be a lutris bug of some kind?

Lutris last update was in Februrary so it doesn’t sound like broken update, it was working fine for sure after that, maybe something in game-performance itself, from what I understand when you exit game power profile should be reverted to previous state - in my case game exits but game-performance still runs as indicated here:

Also this is not a single game problem, tested it on different ones and it’s the same behavior.

So maybe just to be sure we return to the original concept.. what about steam itself?

Not what is configured in lutris.

Like an alias or maybe a custom launcher in ~/.local/share/applications?

sudo nano /usr/bin/game-performance (or open it with kate)

at the bottom swap:

else
exec systemd-inhibit --why “CachyOS game-performance is running” powerprofilesctl launch
-p performance -r “Launched with CachyOS game-performance utility” – “$@”
fi

with;

else
#exec systemd-inhibit --why “CachyOS game-performance is running” powerprofilesctl launch
#-p performance -r “Launched with CachyOS game-performance utility” – “$@”
exec systemd-inhibit --what=“idle” --why “CachyOS game-performance is running” powerprofilesctl launch
-p performance -r “Launched with CachyOS game-performance utility” – “$@”
fi

this will allow you to suspend with power options and while the game is running it won’t suspend automatically when you’re afk.

Probably not with that em dash making it syntactically broken.

( But highly likely some LLM output. )

Though it might just break the line so maybe in a roundabout way that it will mitigate the issue because the powerprofiles thing does not run?

Do you maybe mean -- ?

I prefer not to modify system package manually - my understanding is that it will be replaced anyway if there is update.

So today game-performance is not working at all, at least in Lutris, game is launching normally but power option is not switched at all.
In log I see only this, no other logs are produced post launch:

lutris-wrapper: Against the Storm
Started initial process 189193 from game-performance /usr/bin/steam steam://rungameid/1336490
Start monitoring process.
Monitored process exited.
Initial process has exited (return code: 0)
All processes have quit
Exit with return code 0

I checked game-performance directly in Steam, it’s working there just fine, power options are applied and are reverted after game quits.

see this really lloks like steam being launched itself with game-performance.

Either there is something up with something like a custom launcher or alias or script somewhere

Or there is something wrong with how lutris is doing this.

Folder looks kinda normal, I don’t honestly remember doing anything special about Lutris or Steam - I just set this up initially as described on wiki and never had to tweak anything.

~/.local/share/applications
❯ ls
drwxr-xr-x   - cachy 23 mar 13:56  wine
.rwxr-xr-x 178 cachy 20 mar 00:35  'Cyberpunk 2077.desktop'
.rw-r--r-- 437 cachy  8 kwi 21:22  mimeinfo.cache
.rw-r--r-- 279 cachy 20 mar 00:59  modorganizer2-nxm-handler.desktop
.rwxr-xr-x 190 cachy 25 mar 12:20  'Sekiro Shadows Die Twice.desktop'
.rwxr-xr-x 171 cachy 21 mar 19:41  Stellaris.desktop
.rwxr-xr-x 174 cachy 24 mar 23:28  Timberborn.desktop
.rw-r--r-- 205 cachy  8 kwi 18:19  wine-extension-chm.desktop
.rw-r--r-- 215 cachy  8 kwi 21:22  wine-extension-crt.desktop
.rw-r--r-- 207 cachy  8 kwi 18:19  wine-extension-hlp.desktop
.rw-r--r-- 228 cachy  8 kwi 18:19  wine-extension-msp.desktop
.rw-r--r-- 195 cachy  8 kwi 21:22  wine-extension-reg.desktop
.rw-r--r-- 200 cachy  8 kwi 18:19  wine-extension-vbs.desktop
.rw-r--r-- 231 cachy  8 kwi 21:22  wine-extension-xl2.desktop

This command below is indeed what Lutris is doing, if it’s not supposed to look like that what is the proper command that Lutris should use?

game-performance /usr/bin/steam steam://rungameid/1336490

Btw, doing sanity check - If I configure command prefix and environment variables in Lutris global options they should be passed to Steam game using Stream runner? It’s not like I have to configure prefix and variables for each game inside of Steam?

I am not sure about how lutris should best hand over a game with launch options to steam ..

But that syntax above seems like it would be applying game-performance to steam .. and as such is not really preferred (like with prime-run we do not apply that to steam but to any given game). And anyways then we would expect the effects of game-performance to last for as long as that steam process is running. As in this outcome is expected if launched that way.

For example the wiki on the similar gamemoderun;

and

I would generally not consider that last example a decent suggestion .. but at least it works as reference for us in this situation.

If game-performance is added to the Launch Options for the game in Steam and then you run the game through Lutris without the option, does game-performance apply?

I’ve never run Steam games through Lutris(actually don’t use it at all anymore) so I can’t test this myself, but it wouldn’t surprise me if this is just a limitation of the syntax required to launch Steam games externally since it has no way to declare these wrappers without also passing them to Steam itself rather than just the game. Which is why I bring up the suggestion above. Ideally, you’d prefer Steam to be what passes a wrapper like game-performance to the game being launched.

And yeah, there also might be a better way for Lutris to do this, but if so then I’m not aware of what it might be.

Good catch, it indeed runs fine with game-performance specified on Steam not in Lutris and launched from Lutris.

lutris-wrapper: Black Myth: Wukong
Started initial process 11072 from /usr/bin/steam steam://rungameid/2358720
Start monitoring process.
Monitored process exited.
Initial process has exited (return code: 0)
All processes have quit
Exit with return code 0

I tried to ask this question on Lutris discord, if it’s capable of sending command prefix to launch Steam game and did not receive any answer. Honestly I thought this is like main selling point for Lutris, that I can manage every single game from one interface - if I have to still go to Steam just to add few options per game then I don’t need Lutris to click one “Play” button.

EDIT: Out of curiosity I tested if at least environment variables are passed from Lutris to Steam. Nope. Adding PROTON_LOG=1 in Lutris does nothing, adding same env variable inside of Steam produces log file in home folder…
Is there a supported/recommended way to reinstall Steam+Lutris installed via Cachy Hello gaming packages?

EDIT2: I think this and this are my answers. It is almost certainly not able to pass global options to Steam runner. I think we can just call it a day, maybe it is worth to mention in gaming Cachy wiki that setting up env variables and command prefixes in Lutris are not carried over to Steam game .

Yeah, it is looking like there’s no way to pass these things to Steam games since they in some part need to be funneled through Steam before being passed to the games themselves.

The main selling point for launchers like Lutris are likely going to vary from person to person. I think the “one-stop shop” interface is nice in theory but I think even if it wasn’t this, it would’ve been some other limitation caused by a lack of full functionality being transmitted past the middleware.

For me, I use a launcher(formerly Lutris, now Heroic Games Launcher) as a Wine/Proton prefix management suite for games with independent installers(like from GOG) or portable games and I find that they perform that task well. Switching from those to Steam to play games from my library there isn’t bothersome on my desktop. In fact I like things being organized in this way.

For something like a living room television gaming box I’d like the idea of a single interface for all games since I’d mostly be navigating with limited input, like just keyboard, and cutting down on the different gaming applications would improve the UX. In that case, given what you found out here, I’d probably use Steam’s Big Picture mode with both Steam’s native library and externally loaded games so Launch Options could be passed to each game without issue.