gamescope
gamescope copied to clipboard
3.14.3 refresh on Apr 9 crashes/freezes flathub apps on Steam Deck
Hello,
Ever since the refresh version of 3.14.3 (released on Apr 9 I believe) that I've updated in the Discovery store, pretty much all the flathub apps would either crash or freeze a few seconds after opening. For example,
Chiaki4deck would crash as soon as the spinning logo (the one that plays right after you click "Play") finishes.
Shortcuts created by Heroic would crash as soon as the spinning logo (the one that plays right after you click "Play") finishes.
Shortcuts created by Lutris would freeze a few seconds after the spinning logo disappears.
Tried re-installing Gamescope via Terminal but no change. Tried the earlier version (22.08) via Terminal but Lutris or Heroic wouldn't recognize this version for some reason so I'd lose the HDR support on my Steam Deck OLED. Same with the version on Discovery store which is also 3.14.2.
It's been working solidly before this version so not sure if I'm missing anything? Or is there anyway I could install the earlier version of 3.14.3 (23.08)?
Thanks so much!
Good morning, I have exactly the same issue. I had to uninstall gamescope flatpak to make several shortcuts created with Lutris or Dolphin to work, if not they crash. In some of those shortcuts failed with Assertion Failed ‘winevulkan/loader.c’ , others just crash. Please fix. Thanks
This is because the Gamescope Layer in the Flatpak does not match the version on the outside. These two things are meant to go together as they are tightly coupled.
I do not have a good way of fixing this for older versions I think :/
I could backport a fix to an older tag that should at least prevent stuff from crashing I guess. Do we know who maintains the flatpak that adds the Gamescope layer?
Sorry, but i don’t have that information. I am quite new to Linux world (just after buying Steam Deck OLED) and I only wanted to report the same error
I can confirm that this breaks many, many games that run through Flatpak applications on Steam Deck (including through Lutris, Heroic, RetroArch, Dolphin, and others). These Flatpaks all have whitelisted access to the gamescope-0 socket, so any game that tries to use it (e.g. for HDR support) will immediately crash in Steam Deck OLED's Game Mode.
After uninstalling the Gamescope Flatpak, these games launch, but then I lose HDR support.
So is it accurate to say that the Gamescope Flatpak needs to stay pinned to the built-in/system version of Gamescope on Steam Deck? Looks like @ColinKinloch and @orowith2os are previous contributors to the Gamescope Flatpak and that the version upgrade was done automatically based on the upstream version bump.
The current system version of Gamescope on SteamOS is 3.13.16.8-1 (as reported by pacman -Ss gamescope).
As a temporary workaround, I got my non-Steam games and HDR working again by downgrading the Gamescope Flatpak to an earlier version. There wasn't an exact commit for 3.13.16 that I found, so I used the known-working commit prior to 3.14.3:
sudo flatpak update --commit=871e619e26646af747705ad1d04f4dbd4b7809b1e45d19ef41dea1a5bf9ba6ba org.freedesktop.Platform.VulkanLayer.gamescope
Hello. The flathub repo gets PRs automatically whenever there's a new tag on this repo. I test the PRs on mutter and take a quick look at the commits before hitting the merge button. Is there something else I should be doing?
I think this issue is mostly only relevant to setups where there's a possibility of conflict between system Gamescope and Flatpak Gamescope -- that is, SteamOS and related immutable distros where you would use Flatpak for installing non-Steam software. Thus, this was bound to happen sooner or later since Gamescope Flatpak follows the development version of Gamescope which is always a bit further ahead of SteamOS Stable system Gamescope package.
So I believe what we need is a way for Steam Deck users to install a special branch of Gamescope Flatpak that stays pinned to the current SteamOS Stable system version of Gamescope.
Note that, as far as I know, the main use case for Gamescope Flatpak on SteamOS is simply to get HDR working in non-Steam games in Game Mode.
I tried to use the following instruction provided earlier but it didnt work for me: sudo flatpak update --commit=871e619e26646af747705ad1d04f4dbd4b7809b1e45d19ef41dea1a5bf9ba6ba org.freedesktop.Platform.VulkanLayer.gamescope The error i got is: error: org.freedesktop.Platform.VulkanLayer.gamescope not installed
One option might be to use --filesystem=host-os:ro to use the compositors gamescope version. That would be a per app permission, not a particularly convenient solution.
Maybe a separate gamescope extension for steam deck. Or a separate build in the one package? Still a bit of a pain.
It depends how savvy we expect the user to be.
How frequently and for how long is this likely to be a problem? How long is the lag in the SteamOS releases?
@Alvsar it needs to be installed to downgrade
But i have it installed:
Oh, I see. Its a user install.
Add --user after update and remove the sudo.
(1)(deck@steamdeck ~)$ flatpak update --user --commit=871e619e26646af747705ad1d04f4dbd4b7809b1e45d19ef41dea1a5bf9ba6ba org.freedesktop.Platform.VulkanLayer.gamescope Looking for updates… error: Commit has no requested ref ‘runtime/org.freedesktop.Platform.VulkanLayer.gamescope/x86_64/22.08’ in ref binding metadata
The 22.08 version shouldn't have this issue. You want to downgrad 23.08.
Add //23.08 after .gamescope
Thanks @ColinKinloch and @rakonkido for your comments. I was able to install 23.08 and downgrade to the version where HDR works for Lutris shortcuts and Dolphin.
One option might be to use
--filesystem=host-os:roto use the compositors gamescope version.
Adding host-os to the filesystem overrides and /var/run/host/usr/bin to the Flatpak PATH does grant Heroic access to the system-level Gamescope executable. This needs more testing and there are probably more overrides needed for Steam Deck OLED HDR mode.
However, there are complications: what if a user also has the Gamescope Flatpak installed? Setting up the Flatpak applications to ensure they prefer the system Gamescope's shared library and executable (if available) would mean that if you have both system Gamescope and Flatpak Gamescope installed, system Gamescope will always get selected even when you intended to use Flatpak Gamescope. This could easily happen on a desktop Linux distro if you install Lutris via package manager and Heroic+Gamescope via Flatpak. Not a big deal I guess -- it shouldn't lead to crashing, but it's unexpected behavior and a bit messy.
That would be a per app permission, not a particularly convenient solution.
PRs can be made to those Flatpak manifests make this easier for users. That's what I did for giving them access to xdg-run/gamescope-0. But I'm not sure this will get approved, since in addition to the messiness of the above approach, there may be other security and isolation implications to granting host-os access and editing the PATH to include the host's /usr/bin.
The problem here is nothing to do with that -- it's because the version of the layer and the runtime basically need to be the same because they use their own IPC that is versioned.
It's crashing right now because of an oversight in the layer where it assumes the gamescope swapchain interface is available if the socket is. I need to fix that, and potentially backport to the version in latest SteamOS.
Still, it's a problem as then HDR would not work for things in Flatpak. I do not really have a good solution to this other than somehow trying to use the same layer version as the host gamescope in Flatpak, or potentially us committing to some stable versioning there (which I am a bit against)
Can confirm it worked with the downgrade. Thank @ColinKinloch and @rakonkido so much for your help and it’s a very good workaround!
Should I close this issue now or wait for a more permanent solution?
I just ran into this on Gentoo. I had 3.14.2 installed using the package manager and wanted to try 3.14.3 (not in the distro repos yet). My current workaround is just to bind mount the new libraries over the system ones like this:
sudo mount --bind ./build/layer/libVkLayer_FROG_gamescope_wsi_x86_64.so /usr/lib64/libVkLayer_FROG_gamescope_wsi_x86_64.so
sudo mount --bind ./build/layer/VkLayer_FROG_gamescope_wsi.x86_64.json /usr/share/vulkan/implicit_layer.d/VkLayer_FROG_gamescope_wsi.x86_64.json
Something similar might be possible with the flatpak version.
there may be other security and isolation implications to granting host-os access and editing the PATH to include the host's /usr/bin.
Tested, this does not work. Although we can grant a Flatpak application access to the host-level Gamescope executable, this does not allow HDR to work. I guess for HDR it needs access to the host's shared libraries (so it can access the Gamescope WSI layer library)? But this breaks Flatpak applications since they'll see the wrong glibc and crash immediately.
So if I'm understanding everything right, Gamescope itself needs a fix to prevent the crash that happens due to version conflict, but to actually get HDR working in Game Mode for Flatpak games we also need a fix in Flatpak Gamescope that somehow ensures the versions are the same between host and Flatpak.
Maybe the latest Gamescope versions can go into the flathub-beta repository, while the main flathub repository can stay pinned to whatever version is current in SteamOS Stable? That way, it stays easy for Steam Deck users to install Gamescope via Discover, while desktop Linux users can add the flathub-beta remote if they want the newest Gamescope.
My current workaround is just to bind mount the new libraries over the system ones like this
Probably wouldn't work on Steam Deck, since the system Gamescope is always running in Game Mode
The "proper" solution for now, until some form of HDR stability is reached, is most likely just downgrading the Flatpak gamescope so that things work. Anything involving using the host gamescope binaries will end up breaking. Ideally we would have a normal (stable) HDR protocol everyone uses, but we don't, so we end up in this situation.
On Mon, Apr 15, 2024 at 10:52 PM rakonkido @.***> wrote:
My current workaround is just to bind mount the new libraries over the system ones like this
Probably wouldn't work on Steam Deck, since the system Gamescope is always running in Game Mode
— Reply to this email directly, view it on GitHub https://github.com/ValveSoftware/gamescope/issues/1239#issuecomment-2058179569, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWHH7LZRUFOKGJXTWMOBZNLY5SN65AVCNFSM6AAAAABGEFCAOCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJYGE3TSNJWHE . You are receiving this because you were mentioned.Message ID: @.***>
Sorry to bump up on this. Just today the same downgrade command doesn’t work anymore that it gives an error: Error: While pulling runtime/……/23.08 from remote flathub: Server returned HTTP 404 Updates complete.
Could someone take a look at?
Thanks.
Sounds like it's been deleted, I assume only a few previous versions are kept around.
You could build it using flatpak-builder to build the correct version of the manifest then use flatpak mask to make sure it doesn't get auto updated.
Assuming the version you want is 3.14.2 it should be this commit: https://github.com/flathub/org.freedesktop.Platform.VulkanLayer.gamescope/commit/2a8ab98c2881d5a1262712093d051434a1a7d6f4
Sounds like it's been deleted, I assume only a few previous versions are kept around.
You could build it using
flatpak-builderto build the correct version of the manifest then useflatpak maskto make sure it doesn't get auto updated. Assuming the version you want is 3.14.2 it should be this commit: flathub/org.freedesktop.Platform.VulkanLayer.gamescope@2a8ab98
Ah ok thanks for this. Is there some kind of tutorial of how to do this step by step? Sorry I’m really a noob when it comes to this…
Clone the repo:
git clone https://github.com/flathub/org.freedesktop.Platform.VulkanLayer.gamescope.git
Checkout the correct version:
git checkout 2a8ab98c2881d5a1262712093d051434a1a7d6f4
Install the flatpak-builder flatpak:
flatpak install org.flatpak.Builder
Build and install gamescope:
flatpak run org.flatpak.Builder --user --jobs=4 --install ./_build ./org.freedesktop.Platform.VulkanLayer.gamescope.yml
Stop updates on the org.freedesktop.Platform.VulkanLayer.gamescope package:
flatpak mask --user org.freedesktop.Platform.VulkanLayer.gamescope
Thanks, and have fun.
Replying to https://github.com/ValveSoftware/gamescope/issues/1239#issuecomment-2114711196
Thanks so much for this! Following this guide, though some error occurred at step 2:
git checkout 2a8ab98c2881d5a1262712093d051434a1a7d6f4 fatal: not a git repository (or any parent up to mount point /) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
If I continue, error happened again at step 4:
flatpak run org.flatpak.Builder --user --jobs=4 --install ./_build ./org.freedesktop.Platform.VulkanLayer.gamescope.yml
F: Not sharing "/esp" with sandbox: Ignoring blocking autofs path "/esp" Can't load './org.freedesktop.Platform.VulkanLayer.gamescope.yml': Failed to open file “/home/deck/org.freedesktop.Platform.VulkanLayer.gamescope.yml”: No such file or directory
Am I missing something? Appreciated your help :)
Hello @hys17,
I had exactly the same problem trying to downgrade to the flatpak version 3.14.2 of Gamescope. I followed the excellent instructions of @ColinKinloch and after installation it worked just fine for non-Steam games, including one that supports HDR.
The procedure just needs a "step 1.5": after you use the git clone command, go into the newly created folder with the command
cd org.freedesktop.Platform.VulkanLayer.gamescope
and then execute the git checkout command and the other steps.
Be aware the build and install take a few minutes and it will show a lot of scrolling text while it's running.
Hope this helps!