ValveSoftware / gamescope

SteamOS session compositing window manager
Other
3.15k stars 213 forks source link

Gamescope destroys my system #1166

Closed prufaraSS closed 8 months ago

prufaraSS commented 8 months ago

Operating System: Arch Linux KDE Plasma Version: 5.27.10 KDE Frameworks Version: 5.115.0 Qt Version: 5.15.12 Kernel Version: 6.7.6-arch1-1 (64-bit) Graphics Platform: X11 Processors: 8 × AMD Ryzen 5 2400G with Radeon Vega Graphics Memory: 15.3 GiB of RAM Graphics Processor: NVIDIA GeForce GTX 1050 Ti/PCIe/SSE2 Manufacturer: Micro-Star International Co., Ltd. Product Name: MS-7A36 System Version: 1.0

Launching expensive Proton games (in my case Remnant: From the Ashes) causes game to launch for too long and in the process corrupts whole system. The symptoms are (all of these are rid by simply rebooting the system):

And after that game just starts like nothing happened! And works completely fine! (except there's no sound at all...)

Whats lead to this is that I've been trying to fix ANOTHER gamescope issue, which also doesn't seem for anyone to had!!! This issue was a thing for CS 2 and Remnant: From the Ashes, and is about that game would update only when my mouse is moving inside a game window, otherwise the game would update (and function as well) only 1 time in ~10 seconds. So, in case of fixing it the latest thing I've tried and so it lead to the current problem is downloading Winetricks (I had GStreamer plugins error and was trying to work around it), but trying to do so required for me to update all installed packages, since pacman's databases were outdated and it constantly threw 404 and "no rsync support" errors. And this is very unfortunate, because it updated amd ucodes, nvidia drivers, KDE packages and etc...

What I've tried to do:

Showcase Video: https://youtu.be/APsIEzjNVRs

journalctl: https://pastebin.com/tww3tqrd

If something more required for problem investigation feel free to ask I'll try to get information.

sharkautarch commented 8 months ago

Replying to https://github.com/ValveSoftware/gamescope/issues/1166#issue-2160983883

Question: does this issue still happen if you launch gamescope with: ENABLE_GAMESCOPE_WSI=0 gamescope <other gamescope params> -- %command%

EDIT: from youy journalctl log:

Feb 29 15:26:40 localhost plasmashell[1938]: [2024-02-29 15:26:35] Startup - Steam Client launched with: '/home/max/.local/share/Steam/ubuntu12_32/steam' 'gamescope' '-e' '--'

are you launching steam client with gamescope, or are you running proton games w/ gamescope via steam launch options?

EDIT EDIT: Also, w/ regards to nvidia gpu, there are known to be issues with nvidia driver and gamescope, my advice would be to try downgrading to nvidia dkms 535 driver. I myself have an nvidia gpu on x11, and I use these aur packages:

optionally, if you need to use opencl/CUDA also these aur packages (for compatibility w/ 535 driver):

Also you may need to try building against my nvidia-fix-latest-upstream fork of gamescope Here's a version of gamescope-git pkgbuild for building against the nvidia-fix-latest-upstream branch: https://gist.github.com/sharkautarch/25c774bd50a644b8116cc2988b7f78a0

prufaraSS commented 8 months ago

Replying to #1166 (comment)

Question: does this issue still happen if you launch gamescope with: ENABLE_GAMESCOPE_WSI=0 gamescope <other gamescope params> -- %command%

Yes, This command doesn't affect anything in fresh system. Game launches instantly in broken system though, not sure if it's done because of this command.

EDIT: from youy journalctl log:

Feb 29 15:26:40 localhost plasmashell[1938]: [2024-02-29 15:26:35] Startup - Steam Client launched with: '/home/max/.local/share/Steam/ubuntu12_32/steam' 'gamescope' '-e' '--'

are you launching steam client with gamescope, or are you running proton games w/ gamescope via steam launch options?

I'm running proton games with gamescope via steam launch options. I'm gonna try downgrading to 535 drivers and build your fork next day for sure. P.s. One thing is I'm using "nvidia" package for drivers, not the dkms one.

prufaraSS commented 8 months ago

building 535 drivers ended in a complete failure. rebuilding kernel with DKMS driver caused driver to throw a lot of errors in which it can't find kernel directories, and also building nvidia settings threw me this error:

make[1]: Leaving directory '/home/max/nvidia-535xx-settings/src/nvidia-settings-535.161.07/samples'
make[1]: Entering directory '/home/max/nvidia-535xx-settings/src/nvidia-settings-535.161.07/doc'
   HOST_CC      ../src/gen-manpage-opts.c
   HOST_CC      ../src/common-utils/gen-manpage-opts-helper.c
   HOST_LINK    home/max/nvidia-535xx-settings/src/nvidia-settings-535.161.07/doc/out/gen-manpage-opts
   M4           nvidia-settings.1.m4
/bin/sh: line 2: m4: command not found
make[1]: *** [Makefile:112: out/nvidia-settings.1] Error 127
make[1]: *** Deleting file 'out/nvidia-settings.1'
make[1]: Leaving directory '/home/max/nvidia-535xx-settings/src/nvidia-settings-535.161.07/doc'
make: *** [Makefile:25: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

(can't provide full log since its flooded with gtk-3.0 warnings of deprecated functions) I guess for now I can only hope that in recent 550 version they've fixed compatibilities and try to compile a patched gamescope version.

sharkautarch commented 8 months ago

Replying to https://github.com/ValveSoftware/gamescope/issues/1166#issuecomment-1973133340

hmmm... weird you don't strictly need the nvidia-settings package, unless you want custom settings I guess... can you post a pastebin link for the errors you got when building the nvidia 535 driver?

alternatively, you could just try running gamescope nvidia-fix-latest-upstream with your current driver... tho do note that even if you are able to run gamescope w/ nvidia, I've heard others say that gamescope felt 'stuttery'/low fps on nvidia. Let me know if that's the case for you, cuz I might post a branch w/ some extra edits to try to mitigate that issue (Edit: I just went ahead and made another branch with some tweaks: nvidia-fix-latest-upstream-plus-extra-tweaks)

prufaraSS commented 8 months ago

@sharkautarch I've tried a few more things (gamescope is still with ENABLE_GAMESCOPE_WSI=0 prefix): 1) Installed gamescope-nvidia AUR package 2) Tested out different Proton versions 3) Installed gamescope with nvidia-fix-latest-upstream 4) Removed gst related plugins 5) Installed nouveau driver (i've got shocked it literally doesn't use GPU and doesn't work with Vulkan...) 6) Tried to install 535 nvidia dkms driver again. Full log starting from downloading package here: https://pastebin.com/VCnRbxkY

ALL OF THIS changed nothing. The problem is 100% is something that was in the list of packages that have got upgraded, so nvidia driver is the main suspect. I have to install 535 drivers. EDIT: Gonna checkout ur latest tweaks rn

prufaraSS commented 8 months ago

Aaand nope. Extra tweaks didn't changed anything as well. There was some warnings in the process of compiling, I'm sure this is not related to the problem, just in case: https://pastebin.com/ynKfwRaU

sharkautarch commented 8 months ago

Replying to https://github.com/ValveSoftware/gamescope/issues/1166#issuecomment-1973556797

hmmmm since your computer has hybrid graphics (amd iGPU and nvidia discrete GPU) you might need to pass the --prefer-vk-device param to gamescope, like so:

ENABLE_GAMESCOPE_WSI=0 gamescope --prefer-vk-device $(lspci -nn | grep 3D | grep NVIDIA | tr -d '][' | tr ' ' $'\n' | grep 10de) ...

if that still doesn't work, as a sanity check, see if it also fails to run glxgears: ENABLE_GAMESCOPE_WSI=0 gamescope --prefer-vk-device $(lspci -nn | grep 3D | grep NVIDIA | tr -d '][' | tr ' ' $'\n' | grep 10de) -- glxgears If it still fails to run, you probably need to try installing nvidia 535 dkms again, and I think I know what you need to do to get the driver dkms package to compile right:

prufaraSS commented 8 months ago

The problem with driver compiling truly was in linux headers, you've got bullseye with this one. Soooo...

  1. With 535 nothing changed.
  2. With --prefer-vk-device nothing changed.
  3. Trying out gamescope glxgears caused system a bit of freeze before showing up window (my video stopped showing for a few seconds). Performance is excellent (same as if just launch gfxgears).
  4. Its not KDE fault as well - same problem occurs on Xfce4

EDIT: Gonna try updating to KDE Plasma 6 and changing to Wayland rn

prufaraSS commented 8 months ago

Changed to KDE Plasma 6 and Wayland, nothing changed.

Operating System: Arch Linux KDE Plasma Version: 6.0.0 KDE Frameworks Version: 6.0.0 Qt Version: 6.6.2 Kernel Version: 6.7.6-arch1-2 (64-bit) Graphics Platform: Wayland

prufaraSS commented 8 months ago

I've just find out it breaks the system even without getting started as a gamescope app 💀

prufaraSS commented 8 months ago

I've got back to the moment when the game starts just fine but in gamescope it updates only on mouse movement. ENABLE_GAMESCOPE_WSI=0 changed nothing. I'm not sure what to do with this thread now, since the main problem solved, but gamescope still doesn't function well. Just for archive: I've been trying to remove every audio-related package in my system just for curiosity, and it turned out my desktop environment started freezing every boot. Then I've decided to remove 535 drivers and get back my 550 drivers. SDDM stopped launching at all... I had no idea why: the last time it happened i figured out i have no driver at all (i just forgor to install them 💀 ), so I've started checking blacklists, xorg (there actually was a problem, that there was no driver specified for device), sddm config, ended up just removing and reinstalling drivers and it worked. So, after my boot I've decided to test out game again, and noticed i have no steam, no discord, no firefox. I've installed steam and like 999 dependencies for it, started the game, and it started as intended to! I guess the problem was in conflicting in steam dependencies.

prufaraSS commented 8 months ago

Installing 535 again made me finally successfully launch the game on gamescope! But... Poor performance. I can clearly see game never shows me more than 60 fps. gfxgears show me that in fullscreen average fps is 60, while in windowed mode average is 116. --prefer-vk-device don't do a thing. As well as -r, --framerate-limit, --immediate-flips, --expose-wayland, --force-composition and --disable-layers. EDIT: gonna checkout on x11 sometime

prufaraSS commented 8 months ago

Changing to X11 solved framerate issue. Gamescope works as intended now, thanks to @sharkautarch !

Milor123 commented 3 weeks ago

How can use it in KDE plasma 6 in wayland, its bug again for me :/ I have a 4070, Driver Version: 550.120 in manjaro

console: gamescope version 3.15.11+ (gcc 14.2.1)
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
ATTENTION: default value of option vk_khr_present_wait overridden by environment.
ATTENTION: default value of option vk_khr_present_wait overridden by environment.
[gamescope] [Info]  vulkan: selecting physical device 'NVIDIA GeForce RTX 4070': queue family 2
[gamescope] [Info]  vulkan: physical device supports DRM format modifiers
[gamescope] [Error] vulkan: vkCreateDevice failed (VkResult: -7)
terminate called without an active exception