gamescope icon indicating copy to clipboard operation
gamescope copied to clipboard

Errors when launching games with Gamescope

Open troy0h opened this issue 1 year ago • 17 comments

The two games I currently use Gamescope on both have errors when launching. Helldivers 2: (gamescope -f -w 2560 -h 1440 -- mangohud %command% --use-d3d11) Team Fortress 2: (gamescope -f -w 2560 -h 1440 -- mangohud %command%) Both games worked perfectly in Gamescope fairly recently, and now crash very soon after getting into the game.

CreateSwapchainHKR: Creating swapchain for non-Gamescope swapchain. Hooking has failed somewhere! You may have a bad Vulkan layer interfering.

If I press OK, I get another error:

QueuePresentKHR: Attempting to present a non-hooked swapchain. Hooking has failed somewhere! You may have a bad Vulkan layer interfering.

troy0h avatar Jun 01 '24 15:06 troy0h

@troy0h do you also have that issue when running w/o mangohud?

sharkautarch avatar Jun 01 '24 21:06 sharkautarch

Yes, it seems the mangohud layer is broken here. You can just workaround it by using --mangoapp instead,

misyltoad avatar Jun 02 '24 02:06 misyltoad

I've seen this error as well recently, on my NVIDIA rig with driver 555.42.02. For example, I'm able to trigger the Vulkan layer pop-up by using the Performance Overlay within this nested steam window: gamescope -e -f -H 1440 -W 3440 --hdr-enabled -- steam -steamdeck -steampal -tenfoot -steamos3

Toggling the performance overlay on and trying to launch Ori and the Will of the Wisps gives me:

QueuePresentKHR: Attempting to present a non-hooked swapchain.
Hooking has failed somewhere!
You may have a bad Vulkan layer interfering.

while keeping it off lets the game launch perfectly with HDR enabled.

I just tried compiling MangoHud from source and I seem to be able to use gamescope -e -f -H 1440 -W 3440 --hdr-enabled --mangoapp -- steam -steamdeck -steampal -tenfoot -steamos3 to add the MangoHud overlay without swapchain warnings now.

matte-schwartz avatar Jun 02 '24 06:06 matte-schwartz

Yes, it seems the mangohud layer is broken here. You can just workaround it by using --mangoapp instead,

Yep, this fixed it, seems like it was just a mangohud issue

troy0h avatar Jun 02 '24 11:06 troy0h

Facing the same issue recently. Running with --mangoapp from my Arch installation will open the game but without mangohud, almost as if the command is being ignored.

EDIT: I'm running Arch, Plasma 6.1 beta, nvidia-open-beta-dkms 555, kwin-explicit-sync patch, mangohud from Arch's repository

Virkkunen avatar Jun 03 '24 12:06 Virkkunen

Let me guess, your distro does not build mangoapp? :)

misyltoad avatar Jun 03 '24 12:06 misyltoad

Facing the same issue recently. Running with --mangoapp from my Arch installation will open the game but without mangohud, almost as if the command is being ignored.

weird, im on arch too and --mangoapp works fine for me my launch options for helldivers 2 right now is gamescope -f -r 165 -w 2560 -h 1440 --mangoapp -- %command% --use-d3d11 and that works fine for me, I don't have a mangoapp package maybe you forgot to install the lib32-mangohud package?

troy0h avatar Jun 03 '24 13:06 troy0h

lib32-mangohud and mangohud are both installed from pacman, I'm able to run mangoapp on the terminal and it gives me an error

Glfw Error 65550: X11: Platform not initialized
Glfw Error 65550: X11: Platform not initialized
Glfw Error 65550: X11: Platform not initialized
Glfw Error 65550: X11: Platform not initialized
[1]    3791 segmentation fault (core dumped)  mangoapp

but it shows mangoapp exists. I'm running my games with gamescope -W 3840 -H 2160 -r 165 --hdr-enabled --hdr-itm-enable --hdr-itm-sdr-nits 300 --hdr-itm-target-nits 1000 -f -e --mangoapp -- %command%

Virkkunen avatar Jun 03 '24 13:06 Virkkunen

lib32-mangohud and mangohud are both installed from pacman, I'm able to run mangoapp on the terminal and it gives me an error about the session not being initialised, but it shows mangoapp exists.

Maybe try reinstalling mangohud w/: pacman -S --overwrite='*' mangohud lib32-mangohud

sharkautarch avatar Jun 03 '24 13:06 sharkautarch

Maybe try reinstalling mangohud w/: pacman -S --overwrite='*' mangohud lib32-mangohud

Well, this did something, now running with mangoapp it'll show up the mangohud overlay and a black screen, a few seconds later the same two warnings will pop up

Virkkunen avatar Jun 03 '24 13:06 Virkkunen

Maybe try reinstalling mangohud w/: pacman -S --overwrite='*' mangohud lib32-mangohud

Well, this did something, now running with mangoapp it'll show up the mangohud overlay and a black screen, a few seconds later the same two warnings will pop up

That could be the HDR stuff, maybe try removing that and see what happens

troy0h avatar Jun 03 '24 19:06 troy0h

Do you have other Vulkan layers interfering like it asks? =)

misyltoad avatar Jun 03 '24 19:06 misyltoad

Do you have other Vulkan layers interfering like it asks? =)

yeah thats what i was thinking with the HDR commands

troy0h avatar Jun 03 '24 19:06 troy0h

What HDR commands? The Gamescope args should be fine

misyltoad avatar Jun 03 '24 19:06 misyltoad

What HDR commands? The Gamescope args should be fine

the --hdr-enabled --hdr-itm-enable --hdr-itm-sdr-nits 300 --hdr-itm-target-nits 1000 in his gamescope args, it can cause issues iirc, especially with mangohud

troy0h avatar Jun 03 '24 19:06 troy0h

Found out that the nvidia-open-beta-dkms (driver 555) was the issue. Changing to nvidia-beta-dkms (also 555) lets mangohud show up with --mangoapp, although the GPU stats are all 0. Maybe that's because of the beta driver?

20240604_090945

About the HDR flags, the only issue I found with them is that some games will simply freeze after some seconds or minutes, but I think this bug has been reported already and it's still under investigation.

Virkkunen avatar Jun 03 '24 20:06 Virkkunen

Found out that the nvidia-open-beta-dkms (driver 555) was the issue. Changing to nvidia-beta-dkms (also 555) lets mangohud show up with --mangoapp, although the GPU stats are all 0. Maybe that's because of the beta driver?

20240604_090945

Running the same games with just mangohud %command%, all stats are displayed without issue, only when running with gamescope and --mangoapp that the GPU stats aren't displayed. I also didn't find anything out of the ordinary on the console output while running with gamescope.

Virkkunen avatar Jun 04 '24 07:06 Virkkunen

Running the same games with just mangohud %command%, all stats are displayed without issue, only when running with gamescope and --mangoapp that the GPU stats aren't displayed. I also didn't find anything out of the ordinary on the console output while running with gamescope.

Did you ever figure this out? I am having the same behavior as well. Running driver version 550.127.05 on openSUSE Tumbleweed.

Otherwise my gamescope is working just fine.

CanadaBry avatar Nov 12 '24 21:11 CanadaBry

I got this same warning message -but i solved it- while running on gnome wayland, using intel iris xe igpu, these flags i was using gamescope -h 540 -H 1080 -f -F fsr --expose-wayland --mangoapp -- %command% i solved it by replacing --expose-wayland with --backend wayland and it worked

can someone tell what's the diff between these two flags??

chikobara avatar Mar 04 '25 07:03 chikobara

I got this same warning message -but i solved it- while running on gnome wayland, using intel iris xe igpu, these flags i was using gamescope -h 540 -H 1080 -f -F fsr --expose-wayland --mangoapp -- %command% i solved it by replacing --expose-wayland with --backend wayland and it worked

can someone tell what's the diff between these two flags??

I believe --expose-wayland is meant to be used for a very specific setup (waydroid or something?) --backend wayland just manually sets the backend to the wayland (makes gamescope's windowing use wayland protocol & forwards compositing work to your desktop wayland compositor) Note that when you're running gamescope ontop of a wayland desktop session, gamescope will automatically select the wayland backend, unless you specify a different backend w/ --backend

sharkautarch avatar Mar 04 '25 12:03 sharkautarch

I'm having this issue as well, i searched and tried many things that it could be related, i tried --backend wayland, --backend sdl, ENABLE_GAMESCOPE_WSI=0, ENABLE_GAMESCOPE_WSI=1, DISABLE_GAMESCOPE_WSI=0, DISABLE_GAMESCOPE_WSI=1, but i always get this error message, i also tried a package from AUR called gamescope-plus and with that package it works but with the latest gamescope or gamescope git it does not.

I test it with driver 570 and now with 575 beta nvidia driver, had the same outcome with bot drivers, also i believe is important to point out i on hyprland.

K1NGSSTH avatar May 20 '25 22:05 K1NGSSTH