Strange issue with games losing focus
New Bazzite user here. Installed only a few days ago and have been setting everything up. So far, I'm absolutely loving it but unfortunately, there's an issue thats plaguing me.
This install is on a System76 Oryx Pro 8 laptop, so has an Intel iGPU and NVidia dGPU.
The games are selecting the NVidia card for use, Steam for some reason resorts to the Intel GPU (discovered via Big Picture Mode and going to About).
I figured out I can force Steam to use the dGPU by using the following command:
switcherooctl launch steam 1
Steam is still sluggish using the Nvidia GPU regardless of whatever settings I try (like disabling Hardware acceleration, etc)
That's not the primary issue though. Regardless of forcing steam to use the dGPU or if using the iGPU, whenever I'm in game (fullscreen, windowed, doesn't matter), I get random "freezes". Or so I thought that they were freezes. I discovered that the majority of the time, I can alt-tab out and back into the game and it resumes. Only the video freezes, never audio. I thought it was the
Pause Game
decky plugin, but I have since removed that.
It should be noted that I use an Xbox One controller. I have not yet confirmed to see if this issue is still present without the controller being on, but I believe it is.
How can I track this annoying bug down? I'm curious if it has something to do with a scheduler or some other app stealing the game focus?
More info posted to reddit:
https://www.reddit.com/r/Bazzite/comments/1f55v8v/strange_issue_with_games_losing_focus/36 Replies
i can at least answer one of the things, steam big picture mode being slow on nvidia is an nvidia exclusive issue that they/nvidia need to fix.
Ahh. Thanks for letting me know. I assumed as much. My next build will be using AMD exclusively. Gotta work with what I have for now though.
Decided to post this to Bazzite github issue. Looks like it may be a tricky bug to track down.
https://github.com/ublue-os/bazzite/issues/1583
GitHub
Strange issue with games losing focus · Issue #1583 · ublue-os/bazz...
Describe the bug Regardless of forcing steam to use the dGPU or if using the iGPU, whenever I'm in game (fullscreen, windowed, doesn't matter), I get random "freezes". Or so I tho...
since i got rid of my nvidia laptop earlier this year, i cant suggest anything but keeping an eye on thermals and see if there is any correlation with the freezes
see if it is getting throttled and such
The issue is that it's completely random. I've noticed most times its right when I get to the game menu. Usually happens a couple times. If I can get into the game for more than 5 minutes, it's generally a stable experience.
Wouldn't that tell us that it's probably not the thermals? 🤔
you can thermal throttle from too manu fps in menus if vsync is disabled
my friend thermal throttled in yakuza and gw2 because he didnt vsync on his laptop
Ohh. Interesting. I'll check that out. Should be able to add the GPU thermals to mangohud
What temps would be good/bad? I'm not really familiar with hardware.
depends on the hardware but i got a rule of thumb of 85c being on the toasty side, mainly because things can deform around 90c (for longer period of time) depending on the material (like my 2009 macbook :clueless: )
Let me change my mangohud config real quick and check my temps.
Got a video of it doing it. Temp got up to 81 but still played fine. Went back to menu and let GPU cool down, and it "froze" when temp was at 72ish
Seems to be when you just alt tab though? some games dont like that
for those games i try to run them in nested gamescope and it sometimes help. nested gamescope should work on nvidia
It happens during just regular gameplay. Almost like something steals it's focus, then this behavior starts.
Some games, I can get back to playing. This game, I have to exit and restart because the behavior is "backwards"
weird
Very
can you try nested gamescope, see if it does anything?
I'll have to google that. Not familiar. lol
gamescope -f -w inputwidth -h inputheight -W outputwidth -H outputheight -e --force-grab-cursor -- %command%
in launch options
if you need a different keyboard layout than US then add XKB_DEFAULT_LAYOUT=no
before gamescope
replacing no
with the correct layoutThat's in the Steam game launch options, correct? Same place as Mangohud usually goes?
mangohud will probably not work correctly in gamescope fyi but we are done with that anyway
yep
Okay, let me give that a go.
Weird. Froze during the game credits boot screen. Re-opened game, got into it.. Character just got loaded and it "froze" again. Can still hear the audio but alt-tabbing doesn't work.
ok then i dont know much more to try :/
Well. Thanks for your help. It does look like the
gamescope
thing brings about the bug a little more. Makes it easier to reproduce.
For what it's worth, Mangohud is still showing properly. Guess I should mention that I have MANGOHUD=1
in /etc/environment
. I did remove it before, to ensure that wasn't what was causing this "bug".we highly recommend you remove that, it can break your system
I'd really prefer to make Steam start using mangohud directly. So I don't have to add the launch option to nearly 500 games lol
I start Steam using
switcherooctl launch steam 1
right now.
To force it to use the dGPUshouldnt even be neccessary with our switcherooctl as its patched to correctly detect the dgpu
So something is broken there too? 🤔
Without that command, steam starts on the Intel iGPU
on other systems i did that, but we wrote a patch to switcherooctl to fix the behavior since the desktop file for steam tells it to launch on whatever is not the default gpu, disregarding if it is an igpu or dgpu
I just found a dangling error in the steam command.
chdir "/var/home/levi/.local/share/Steam/steamapps/common/Afterimage"
ERROR: ld.so: object '/var/home/levi/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ignore it
its an ld_preload for 32bit games
[gamescope] [Error] wlserver: [xwayland/sockets.c:64] Failed to bind socket @/tmp/.X11-unix/X0: Address already in use
How about that one?if you play a 32bit game it complains about 64bit ld_preload
Other than those errors, steam logs are clean.
idk about that error, might be because youre on x11 (because nvidia) and it shouldnt amount to anything unless gamescope never opens
Found a nice workaround, was able to finally switch to Wayland DE. I haven't had a single freeze in nearly 2 days. It's kind of ironic because X11 is suppose to be more stable, yet Wayland is superior with this setup for whatever reason.
On X11, it's a 75% chance it will freeze on menus. If the game will keep playing for at least 5 minutes, there's a 50% chance it won't freeze lol