Gamescope refuses to work with Steam

Hello!

I know many articles and such have been made similar to this one but sadly none of the solutions shown there seem to help :frowning:

The problem is just as the title says, gamescope refuses to work with steam regardless of what I try (different kernels, configurations, etc.). My best guess is that it might be due to my system using wayland and not x11.

Here is my specs (alongside the shown kernel I have also tried the latest and the cachyos-kernels from chaoticnyx)

Here is my current gaming.nix setup with suggestions from a friendly discord server.

{ config, inputs, pkgs, ... }:

{
  environment.systemPackages = with pkgs; [
    protonup-qt
    protontricks
    cabextract # Needed for ^

    dxvk
    vkd3d

    wineWowPackages.full
    winetricks
    faudio
    # Performance tools
    gamemode
    gamescope
    mangohud
  ];  

  environment.sessionVariables = {
    # Default 64-bit Wine prefix for modern games
    WINEPREFIX = "$HOME/.wine";
    WINEARCH = "win64";
    
    OBS_VKCAPTURE = "1";
    RADV_TEX_ANISO = "16";

    # Explicit Wine paths for Winetricks / Protontricks (avoids unknown arch)
    WINE = "/run/current-system/sw/bin/wine";
    WINESERVER = "/run/current-system/sw/bin/wineserver";
  };

  hardware.steam-hardware.enable = true;

  users.users.silk.packages = with pkgs; [
    heroic
    lutris
    dolphin-emu
    mcpelauncher-ui-qt
    melonDS
    steam-rom-manager
    srb2

    prismlauncher
    # Minecraft Java JRE's for all versions
    temurin-jre-bin
    temurin-jre-bin-17
    temurin-jre-bin-8
  ];

  programs = {
   gamescope = {
     enable = true;
     capSysNice = true;
   };
   gamemode.enable = true;
   steam = {
    enable = true;
    remotePlay.openFirewall = true;
    dedicatedServer.openFirewall = true;
    localNetworkGameTransfers.openFirewall = true;
    gamescopeSession.enable = true;
    protontricks.enable = true;
    extest.enable = true;
    package = pkgs.steam.override {
      extraEnv = {
        OBS_VKCAPTURE = "1";
        RADV_TEX_ANISO = "16";
      };
      extraPkgs = pkgs': with pkgs'; [
        xorg.libXcursor
        xorg.libXi
        xorg.libXinerama
        xorg.libXScrnSaver
        libpng
        libpulseaudio
        libvorbis
        stdenv.cc.cc.lib # Provides libstdc++.so.6
        libkrb5
        keyutils
        # Add other libraries as needed
      ];
    };
     extraCompatPackages = [ pkgs.steamtinkerlaunch pkgs.proton-ge-bin pkgs.proton-cachyos ]; 
   };
  };
}

Though sadly it refuses to work still :frowning:

I launched steam via console to try and see what might be the issue and got this:

System.Exception: x11 not available
  at Xalia.Sdl.SplitOverlayBox.CreateWindows () [0x0005b] in <5b50cb9692864a58a57a8b9091dd6c44>:0 
  at Xalia.Sdl.SplitOverlayBox..ctor (Xalia.Sdl.WindowingSystem windowingSystem) [0x0002e] in <5b50cb9692864a58a57a8b9091dd6c44>:0 
  at Xalia.Sdl.WindowingSystem.CreateOverlayBox () [0x0001b] in <5b50cb9692864a58a57a8b9091dd6c44>:0 
  at Xalia.Ui.UiMain..ctor () [0x00039] in <5b50cb9692864a58a57a8b9091dd6c44>:0 
  at Xalia.MainClass.Init (Xalia.Gudl.GudlStatement[] config) [0x0001b] in <5b50cb9692864a58a57a8b9091dd6c44>:0 
chdir "/home/silk/.local/share/Steam/steamapps/common/Deadlock"
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/silk/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
failed to inherit capabilities: Operation not permittedGame Recording - would start recording game 1422450, but recording for this game is disabled
Adding process 16368 for gameID 1422450
Game Recording - game stopped [gameid=1422450]
Removing process 16368 for gameID 1422450

And using a different backend like sdl leads to this:

pressure-vessel-wrap[19612]: W: Found more than one possible libdrm data directory from provider
pressure-vessel-wrap[19612]: W: "run/opengl-driver/share/drirc.d" is unlikely to appear in "/run/host"
pressure-vessel-wrap[19612]: W: "run/opengl-driver-32/share/drirc.d" is unlikely to appear in "/run/host"
pressure-vessel-wrap[19612]: W: Found more than one possible drirc.d data directory from provider
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
Proton: Upgrading prefix from CachyOS-10.0-200 to GE-Proton10-19 (/home/silk/.local/share/Steam/steamapps/compatdata/0/)
Proton: Prefix has an invalid version?! You may want to back up user files and delete this prefix.
ProtonFixes[19849] WARN: Skipping fix execution. We are probably running an unit test.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
fsync: up and running.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
[obs-vkcapture] Init Vulkan 1.5.3 (64bit)
WARNING: radv is not a conformant Vulkan implementation, testing use only.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
[obs-vkcapture] Init Vulkan 1.5.3 (64bit)
WARNING: radv is not a conformant Vulkan implementation, testing use only.
radv: Forcing anisotropy filter to 16x
Fossilize INFO: Overriding serialization path: "/home/silk/.local/share/Steam/shader_cache_temp_dir_d3d11_64/fozpipelinesv6/steamapprun_pipeline_cache".
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
pressure-vessel-wrap[19952]: W: Found more than one possible libdrm data directory from provider
pressure-vessel-wrap[19952]: W: "run/opengl-driver/share/drirc.d" is unlikely to appear in "/run/host"
pressure-vessel-wrap[19952]: W: "run/opengl-driver-32/share/drirc.d" is unlikely to appear in "/run/host"
pressure-vessel-wrap[19952]: W: Found more than one possible drirc.d data directory from provider
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ProtonFixes[20200] WARN: Skipping fix execution. We are probably running an unit test.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
fsync: up and running.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
[obs-vkcapture] Init Vulkan 1.5.3 (64bit)
WARNING: radv is not a conformant Vulkan implementation, testing use only.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
[obs-vkcapture] Init Vulkan 1.5.3 (64bit)
WARNING: radv is not a conformant Vulkan implementation, testing use only.
WARNING: radv is not a conformant Vulkan implementation, testing use only.
radv: Forcing anisotropy filter to 16x
Fossilize INFO: Overriding serialization path: "/home/silk/.local/share/Steam/shader_cache_temp_dir_d3d12_64/fozpipelinesv6/steamapprun_pipeline_cache".
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
pressure-vessel-wrap[20309]: W: Found more than one possible libdrm data directory from provider
pressure-vessel-wrap[20309]: W: "run/opengl-driver/share/drirc.d" is unlikely to appear in "/run/host"
pressure-vessel-wrap[20309]: W: "run/opengl-driver-32/share/drirc.d" is unlikely to appear in "/run/host"
pressure-vessel-wrap[20309]: W: Found more than one possible drirc.d data directory from provider
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
fsync: up and running.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
[obs-vkcapture] Init Vulkan 1.5.3 (64bit)
WARNING: radv is not a conformant Vulkan implementation, testing use only.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
chdir "/home/silk/.local/share/Steam/steamapps/common/Deadlock"
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/silk/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
failed to inherit capabilities: Operation not permittedGame Recording - would start recording game 1422450, but recording for this game is disabled
Adding process 20632 for gameID 1422450
Game Recording - game stopped [gameid=1422450]
Removing process 20632 for gameID 1422450

(the ld.so error has been reduced here but it was a lot of those)

If anyone could help I would be super appreciative :bowing_woman:

Known issue, disable that, see here: Gamescope cannot be used to launch Steam games · Issue #351516 · NixOS/nixpkgs · GitHub

I tried this though sadly it still doesn’t work

Here with default backend:

No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
[gamescope] [Info]  scriptmgr: Loading scripts from: '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts'
[gamescope] [Info]  scriptmgr: Loading scripts from: '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts/00-gamescope'
[gamescope] [Info]  scriptmgr: Loading scripts from: '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts/00-gamescope/common'
[gamescope] [Info]  scriptmgr: Running script file '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts/00-gamescope/common/inspect.lua' (id: 0)
[gamescope] [Info]  scriptmgr: Running script file '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts/00-gamescope/common/modegen.lua' (id: 1)
[gamescope] [Info]  scriptmgr: Running script file '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts/00-gamescope/common/util.lua' (id: 2)
[gamescope] [Info]  scriptmgr: Loading scripts from: '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts/00-gamescope/displays'
[gamescope] [Info]  scriptmgr: Running script file '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts/00-gamescope/displays/asus.rogally.lcd.lua' (id: 3)
[gamescope] [Info]  scriptmgr: Running script file '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts/00-gamescope/displays/deckhd.steamdeck.deckhd-lcd.lua' (id: 4)
[gamescope] [Info]  scriptmgr: Running script file '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts/00-gamescope/displays/gpd.win4.lcd.lua' (id: 5)
[gamescope] [Info]  scriptmgr: Running script file '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts/00-gamescope/displays/lenovo.legiongo.lcd.lua' (id: 6)
[gamescope] [Info]  scriptmgr: Running script file '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts/00-gamescope/displays/lenovo.legiongos.lcd.lua' (id: 7)
[gamescope] [Info]  scriptmgr: Running script file '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts/00-gamescope/displays/valve.steamdeck.lcd.lua' (id: 8)
[gamescope] [Info]  scriptmgr: Running script file '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts/00-gamescope/displays/valve.steamdeck.oled.lua' (id: 9)
[gamescope] [Info]  scriptmgr: Loading scripts from: '/etc/gamescope/scripts'
[gamescope] [Warn]  scriptmgr: Directory '/etc/gamescope/scripts' does not exist
[gamescope] [Info]  scriptmgr: Loading scripts from: '/home/silk/.config/gamescope/scripts'
[gamescope] [Warn]  scriptmgr: Directory '/home/silk/.config/gamescope/scripts' does not exist
wp_color_manager_v1#20: error 0: Windows scRGB is not supported
libdecor-gtk-WARNING: Could not get required globals
Failed to load plugin 'libdecor-gtk.so': failed to init
Game Recording - would start recording game 1422450, but recording for this game is disabled
Adding process 10923 for gameID 1422450
libdecor-cairo-WARNING: Could not get required globals
Failed to load plugin 'libdecor-cairo.so': failed to init
No plugins found, falling back on no decorations
[obs-vkcapture] Init Vulkan 1.5.3 (64bit)
WARNING: radv is not a conformant Vulkan implementation, testing use only.
WARNING: radv is not a conformant Vulkan implementation, testing use only.
[gamescope] [Info]  vulkan: selecting physical device 'AMD Radeon Graphics (RADV GFX1200)': queue family 1 (general queue family 0)
[gamescope] [Info]  vulkan: physical device supports DRM format modifiers
radv: Forcing anisotropy filter to 16x
[obs-vkcapture] could not get device address for vkCreateSwapchainKHR
[obs-vkcapture] could not get device address for vkDestroySwapchainKHR
[obs-vkcapture] could not get device address for vkQueuePresentKHR
[obs-vkcapture] could not get device address for vkGetSwapchainImagesKHR
[gamescope] [Info]  wlserver: [backend/headless/backend.c:67] Creating headless backend
[gamescope] [Error] xdg_backend: Couldn't create Wayland input objects.
[gamescope] [Error] xdg_backend: Failed to initialize input thread
terminate called without an active exception
Game Recording - game stopped [gameid=1422450]
Removing process 10923 for gameID 1422450

With sdl backend

ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
pressure-vessel-wrap[11448]: W: Found more than one possible libdrm data directory from provider
pressure-vessel-wrap[11448]: W: "run/opengl-driver/share/drirc.d" is unlikely to appear in "/run/host"
pressure-vessel-wrap[11448]: W: "run/opengl-driver-32/share/drirc.d" is unlikely to appear in "/run/host"
pressure-vessel-wrap[11448]: W: Found more than one possible drirc.d data directory from provider
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
fsync: up and running.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
[obs-vkcapture] Init Vulkan 1.5.3 (64bit)
WARNING: radv is not a conformant Vulkan implementation, testing use only.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
chdir "/home/silk/.local/share/Steam/steamapps/common/Deadlock"
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/silk/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/silk/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/nix/store/5qy880i4vzp591hz5ac66hjdngii7kx2-extest-1.0.2/lib/libextest.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
ERROR: ld.so: object '/home/silk/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
[gamescope] [Info]  console: gamescope version 3.16.17 (gcc 14.3.0)
No CAP_SYS_NICE, falling back to regular-priority compute and threads.
Performance will be affected.
[gamescope] [Info]  scriptmgr: Loading scripts from: '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts'
[gamescope] [Info]  scriptmgr: Loading scripts from: '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts/00-gamescope'
[gamescope] [Info]  scriptmgr: Loading scripts from: '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts/00-gamescope/common'
[gamescope] [Info]  scriptmgr: Running script file '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts/00-gamescope/common/inspect.lua' (id: 0)
[gamescope] [Info]  scriptmgr: Running script file '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts/00-gamescope/common/modegen.lua' (id: 1)
[gamescope] [Info]  scriptmgr: Running script file '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts/00-gamescope/common/util.lua' (id: 2)
[gamescope] [Info]  scriptmgr: Loading scripts from: '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts/00-gamescope/displays'
[gamescope] [Info]  scriptmgr: Running script file '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts/00-gamescope/displays/asus.rogally.lcd.lua' (id: 3)
[gamescope] [Info]  scriptmgr: Running script file '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts/00-gamescope/displays/deckhd.steamdeck.deckhd-lcd.lua' (id: 4)
[gamescope] [Info]  scriptmgr: Running script file '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts/00-gamescope/displays/gpd.win4.lcd.lua' (id: 5)
[gamescope] [Info]  scriptmgr: Running script file '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts/00-gamescope/displays/lenovo.legiongo.lcd.lua' (id: 6)
[gamescope] [Info]  scriptmgr: Running script file '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts/00-gamescope/displays/lenovo.legiongos.lcd.lua' (id: 7)
[gamescope] [Info]  scriptmgr: Running script file '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts/00-gamescope/displays/valve.steamdeck.lcd.lua' (id: 8)
[gamescope] [Info]  scriptmgr: Running script file '/nix/store/ilcxyrf3spslfparl1x5cf2gxqj8jphj-gamescope-3.16.17/share/gamescope/scripts/00-gamescope/displays/valve.steamdeck.oled.lua' (id: 9)
[gamescope] [Info]  scriptmgr: Loading scripts from: '/etc/gamescope/scripts'
[gamescope] [Warn]  scriptmgr: Directory '/etc/gamescope/scripts' does not exist
[gamescope] [Info]  scriptmgr: Loading scripts from: '/home/silk/.config/gamescope/scripts'
[gamescope] [Warn]  scriptmgr: Directory '/home/silk/.config/gamescope/scripts' does not exist
terminate called without an active exception
Game Recording - would start recording game 1422450, but recording for this game is disabled
Adding process 11767 for gameID 1422450
Game Recording - game stopped [gameid=1422450]
Removing process 11767 for gameID 1422450

I am aware that Gnome used to not support scRGB but from what I saw that was fixed :confused: Would I have to wait for Gnome 49?

While I’m at it, let me fix your configuration:

{
  pkgs,
  ...
}:

{
  environment.systemPackages = with pkgs; [
    protonup-qt
    cabextract # Needed for ^

    dxvk

    wineWowPackages.full
    winetricks
    faudio
    # Performance tools
    mangohud
  ];

  environment.sessionVariables = {
    # Default 64-bit Wine prefix for modern games
    WINEPREFIX = "$HOME/.wine";
    WINEARCH = "win64";

    OBS_VKCAPTURE = "1";
    RADV_TEX_ANISO = "16";
  };

  users.users.silk.packages = with pkgs; [
    heroic
    lutris
    dolphin-emu
    mcpelauncher-ui-qt
    melonDS
    steam-rom-manager
    srb2

    prismlauncher
  ];

  programs = {
    gamescope.enable = true;
    gamemode.enable = true;
    steam = {
      enable = true;
      localNetworkGameTransfers.openFirewall = true;
      protontricks.enable = true;
      extest.enable = true;
      package = pkgs.steam.override {
        extraEnv = {
          OBS_VKCAPTURE = "1";
          RADV_TEX_ANISO = "16";
        };
      };
      extraCompatPackages = [
        pkgs.steamtinkerlaunch
        pkgs.proton-ge-bin
        pkgs.proton-cachyos
      ];
    };
  };
}

The general gist of the edits are:

  • Fixed indentation by running it through nixfmt
  • Using NixOS modules over adding stuff to environment.systemPackages
    • NixOS modules generally configure additional stuff, you can’t expect adding packages to environment.systemPackages to work if modules for the packages exist; that usually indicates that the package needs some system-level configuration and will not work properly if you just dump it into $PATH.
    • Adding the package both via the module and environment.systemPackages is at best a noop and at worst makes the module not actually work because you override the binary added by the module with a default one that isn’t configured correctly.
  • The vkd3d package doesn’t do anything, you need to install it into your wineprefix. Ditto for dxvk, by the way, but that at least is a setup script you can run, so I’m going to pretend that you realize this and install it on purpose.
    • A better way to install dxvk IMO is to use nix-shell or nix run to just install it into the wineprefix ad-hoc; you’re not declaratively configuring wineprefixes, so having this in $PATH at all times is basically useless
  • You don’t need to separately install JRE if you’re using PrismLauncher, the package handles that for you
    • If you want to install an exotic JRE that’s not among those (the specific ones you chose are installed by default, and will likely always be given that that’s 8, LTS stable), use (prismlauncher.override { jdks = [ pkgs.some-kind-of-jre ]; })
  • Setting the WINE and WINESERVER variables should be unnecessary, and risks hard-coding the wine used in environments where that is controlled by different means.
    • If you really want to throw caution to the wind, it’s better to use lib.getExe pkgs.wineWowPackages.full and lib.getExe' pkgs.wineWowPackages.full "wineserver"
  • Disabled a bunch of steam related options you’re almost certainly not using. In order of likely unintendedness (least indended first):
    • dedicatedServer.openFirewall
      • Unless you’re hosting a team fortress server 24/7 on your gaming rig, don’t enable this
    • gamescopeSession.enable
      • That’s a build-your-own SteamOS option and has nothing to do with running steam on other DEs
    • hardware.enable
      • Only used for steam controller/index
    • remotePlay.openFirewall
      • Only used for in-home streaming type stuff, which you almost definitely do not
    • All the extraPkgs that you almost certainly don’t want in there, since they are provided by the steam runtime

Forgive me, but this just looks like sling-shit-at-the-wall-until-it-sticks debugging, which IME brings more issues than it solves. It can be a valid strategy, but you should isolate variables rather than keeping everything enabled.

Looks to me like you didn’t configure gamescope. What does your steam launch command say?

Thank you and yeah :sweat_smile: that’s fair

My initial solution was far simpler than this but i did well ‘slinging-shit-at-the-wall’ using solutions i saw until i ended up with that,

Thank you for going through the effort to look through the sloppy code :bowing_woman:

I used

gamescope -w 2560 -h 1440 -- %command%

gamescope -w 2560 -h 1440 --backend sdl -- %command%

gamescope -w 2560 -h 1440 --backend wayland -- %command%

I also tried with and without refresh rate -r 165.0

Replace that with:

gamescope -W 2560 -H 1440

Yeah, I know. Gamescope isn’t very intuitive. IME a window size must be set. Feel free to add additional options to change the game render resolution as well if that doesn’t look pretty ootb.

I tried it with this as well, and sadly the same errors I pasted before appear. Though that is good to know

Right, with the sdl backend I don’t see any actual errors. That’s just the usual result of steam trying to launch its overlay.

Have you tried running something with gamescope outside of steam?

I have!

It works perfectly fine running Krita for example; its exclusively Steam applications that always fail.

1 Like