Skip to content

steam can't run Cyberpunk 2077 via Proton 5.13 (even though it should) #106571

Closed

Description

@peti

According to https://www.phoronix.com/scan.php?page=news_item&px=Cyberpunk-2077-Proton-Linux, Cyberpunk 2077 is supposed to run fine on Steam Linux via Proton Proton 5.13. However, I have not been able to run it. The game won't even start up, apparently because there's all kinds of linker errors. I have not been able to run any game with Proton 5.13 on NixOS, to be honest, so I reckon that this is an issue with the way Steam is packaged for NixOS rather than one with Steam itself.

Does anyone have a suggestion how fix that?

Activity

  1. added
    0.kind: bug
    6.topic: nixos
    6.topic: steam
    on Dec 10, 2020
  2. mweinelt commented on Dec 10, 2020

    @mweinelt
    Member

    I'm likely seeing the same issues with Among Us on Proton 5.13.

    One is this:

    /nix/store/p4sq0bv6i0nm3na8k3gzam9xk8mjcn9n-gvfs-1.46.1/lib/gvfs/libgvfscommon.so: undefined symbol: g_task_new
    Failed to load module: /nix/store/p4sq0bv6i0nm3na8k3gzam9xk8mjcn9n-gvfs-1.46.1/lib/gio/modules/libgioremote-volume-monitor.so

    Another, probably worse, is this:

    /home/hexa/.local/share/Steam/steamapps/common/SteamLinuxRuntime_soldier/pressure-vessel/bin/pressure-vessel-adverb: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

    Full terminal spew
    GameAction [AppID 945360, ActionID 2] : LaunchApp changed task to ProcessingInstallScript with ""
    _v2-entry-point[629]: STEAM_COMPAT_APP_ID=945360
    _v2-entry-point[629]: STEAM_COMPAT_SESSION_ID=ec2599f99be1ea68
    _v2-entry-point[629]: XDG_RUNTIME_DIR=/run/user/1000
    _v2-entry-point[628]: STEAM_COMPAT_APP_ID=945360
    _v2-entry-point[628]: STEAM_COMPAT_SESSION_ID=ec2599f99be1ea68
    _v2-entry-point[628]: XDG_RUNTIME_DIR=/run/user/1000
    /nix/store/p4sq0bv6i0nm3na8k3gzam9xk8mjcn9n-gvfs-1.46.1/lib/gvfs/libgvfscommon.so: undefined symbol: g_task_new
    Failed to load module: /nix/store/p4sq0bv6i0nm3na8k3gzam9xk8mjcn9n-gvfs-1.46.1/lib/gio/modules/libgioremote-volume-monitor.so
    /nix/store/p4sq0bv6i0nm3na8k3gzam9xk8mjcn9n-gvfs-1.46.1/lib/gvfs/libgvfscommon.so: undefined symbol: g_task_new
    Failed to load module: /nix/store/p4sq0bv6i0nm3na8k3gzam9xk8mjcn9n-gvfs-1.46.1/lib/gio/modules/libgvfsdbus.so
    /nix/store/z7wjvx0q2allrs5ka9xphbm93r89izgy-dconf-0.38.0-lib/lib/gio/modules/libdconfsettings.so: undefined symbol: g_type_ensure
    Failed to load module: /nix/store/z7wjvx0q2allrs5ka9xphbm93r89izgy-dconf-0.38.0-lib/lib/gio/modules/libdconfsettings.so
    x86_64-linux-gnu-capsule-capture-libs: code 2: open "/etc/ld.so.cache": No such file or directory
    pressure-vessel-wrap[646]: Child process exited with code 1
    ln: failed to create symbolic link '/tmp/SteamPVSockets.euXY5x/SteamLinuxRuntime.ec2599f99be1ea68/socket' -> '': No such file or directory
    /nix/store/p4sq0bv6i0nm3na8k3gzam9xk8mjcn9n-gvfs-1.46.1/lib/gvfs/libgvfscommon.so: undefined symbol: g_task_new
    Failed to load module: /nix/store/p4sq0bv6i0nm3na8k3gzam9xk8mjcn9n-gvfs-1.46.1/lib/gio/modules/libgioremote-volume-monitor.so
    /nix/store/p4sq0bv6i0nm3na8k3gzam9xk8mjcn9n-gvfs-1.46.1/lib/gvfs/libgvfscommon.so: undefined symbol: g_task_new
    Failed to load module: /nix/store/p4sq0bv6i0nm3na8k3gzam9xk8mjcn9n-gvfs-1.46.1/lib/gio/modules/libgvfsdbus.so
    /nix/store/z7wjvx0q2allrs5ka9xphbm93r89izgy-dconf-0.38.0-lib/lib/gio/modules/libdconfsettings.so: undefined symbol: g_type_ensure
    Failed to load module: /nix/store/z7wjvx0q2allrs5ka9xphbm93r89izgy-dconf-0.38.0-lib/lib/gio/modules/libdconfsettings.so
    x86_64-linux-gnu-capsule-capture-libs: code 2: open "/etc/ld.so.cache": No such file or directory
    pressure-vessel-wrap[672]: Child process exited with code 1
    ln: failed to create symbolic link '/tmp/SteamPVSockets.euXY5x/SteamLinuxRuntime.ec2599f99be1ea68/socket' -> '': No such file or directory
    src/clientdll/installscript_posix.cpp (419) : Assertion Failed: Standalone evaluator returned error code for app 945360
    src/clientdll/installscript_posix.cpp (419) : Assertion Failed: Standalone evaluator returned error code for app 945360
    GameAction [AppID 945360, ActionID 2] : LaunchApp changed task to SiteLicenseSeatCheckout with ""
    GameAction [AppID 945360, ActionID 2] : LaunchApp changed task to CreatingProcess with ""
    GameAction [AppID 945360, ActionID 2] : LaunchApp waiting for user response to CreatingProcess ""
    GameAction [AppID 945360, ActionID 2] : LaunchApp continues with user response "CreatingProcess"
    Game update: AppID 945360 "", ProcID 692, IP 0.0.0.0:0
    ERROR: ld.so: object '/home/hexa/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
    ERROR: ld.so: object '/home/hexa/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
    ERROR: ld.so: object '/home/hexa/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
    ERROR: ld.so: object '/home/hexa/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
    Starting app 945360
    >>> Adding process 692 for game ID 945360
    GameAction [AppID 945360, ActionID 2] : LaunchApp changed task to WaitingGameWindow with ""
    pid 695 != 693, skipping destruction (fork without exec?)
    ERROR: ld.so: object '/home/hexa/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
    GameAction [AppID 945360, ActionID 2] : LaunchApp changed task to Completed with ""
    _v2-entry-point[693]: STEAM_COMPAT_APP_ID=945360
    _v2-entry-point[693]: STEAM_COMPAT_SESSION_ID=ec2599f99be1ea68
    _v2-entry-point[693]: XDG_RUNTIME_DIR=/run/user/1000
    ERROR: ld.so: object '/home/hexa/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
    /home/hexa/.local/share/Steam/steamapps/common/SteamLinuxRuntime_soldier/pressure-vessel/bin/pressure-vessel-adverb: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
    ERROR: ld.so: object '/home/hexa/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
    /home/hexa/.local/share/Steam/steamapps/common/SteamLinuxRuntime_soldier/pressure-vessel/bin/pressure-vessel-adverb: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
    >>> Adding process 693 for game ID 945360
    >>> Adding process 694 for game ID 945360
    >>> Adding process 696 for game ID 945360
    Game removed: AppID 945360 "", ProcID 692 
    Uploaded AppInterfaceStats to Steam
    Exiting app 945360
    No cached sticky mapping in ActivateActionSet.
    
  3. baracoder commented on Dec 10, 2020

    @baracoder
    Contributor

    Probably related #100655

  4. dasJ commented on Dec 10, 2020

    @dasJ
    Member

    @mweinelt If you want to play Among Us, use Proton 3.16-9. Also works with Wayland

  5. mweinelt commented on Dec 10, 2020

    @mweinelt
    Member

    @mweinelt If you want to play Among Us, use Proton 3.16-9. Also works with Wayland

    I have it working with 4.2-9 currently, so I'm fine.

  6. Wulfsta commented on Dec 11, 2020

    @Wulfsta
    Member

    I'm not sure how Steam is packaged, but do we have the version of mesa we need?

  7. jbalme commented on Dec 11, 2020

    @jbalme
    Contributor

    Duplicate of #100655.

    Basically, Pressure Vessel (Steam's new container runtime that new versions of Proton are built on) has some incompatibilities with Nix that will require changes on both our end and Pressure Vessel's end.

    In the mean time, try Proton 4.x or Proton-GE 5.9 (no later.)

  8. dasJ commented on Dec 11, 2020

    @dasJ
    Member

    Switching to an older Proton version is not applicable for Cyberpunk unfortunately.
    The previous available version in Steam is 5.0 where the launcher (QtWebkit btw) crashes because it cannot find an OpenGL driver:
    image

  9. pinkisemils commented on Dec 11, 2020

    @pinkisemils

    The game can be launched by installing Steam via flatpak. You can enable flatpak via services.flatpak.enable = true; in your configuration.nix.

    flatpak install com.valvesoftware.Steam.CompatibilityTool.Proton com.valvesoftware.Steam

    You have to use flatpak to run steam, so might want to move over your steam library to the flatpacked Steam

    mv ~/.local/share/Steam/steamapps/ ~/.var/app/com.valvesoftware.Steam/data/Steam/steamapps/ 

    By default, steam will try to use it's own Proton runtime, but to this doesn't work on flatpak. You have to select the community runtime, which does work.

    And users with AMD GPUs can overcome some graphics bugs by using a mesa-git extension. Once set up, you should be able to see actual textures on human models in the game if you run the steam flatpak like this FLATPAK_GL_DRIVERS=mesa-git flatpak run com.valvesoftware.Steam.

    Don't try and rebuild the mesa in nixpkgs, as that isn't used by flatpaks, and running the latest proton versions natively just won't work without some extra development effort.

  10. dasJ commented on Dec 12, 2020

    @dasJ
    Member

    Cannot confirm:

    >>> Adding process 1238 for game ID 1091500
    «o╫ called in 64-bit code (0x000000007bc2ecd8).└Hâ─`[├╠╠╠╠╠╠╠╠╠╠╠╠╠╠Hâ∞8╢┬IïP Hà╥tï
    Register dump:
     rip:000000007bc2ecd8 rsp:000000000031ca70 rbp:0000000000000000 eflags:00000202 (   - --  I   - - - )
     rax:0000000180000100 rbx:000000000031ca90 rcx:000000000031ca90 rdx:0000000142a812e9
     rsi:00000001437bd88a rdi:00000001437bb2d8  r8:0000000000000000  r9:00000000c0000005 r10:00000001428f16e4
     r11:0000000000000000 r12:0000000000000000 r13:000000000031cbf0 r14:000000013fff8000 r15:0000000142a811f0
    Stack dump:
    0x000000000031ca70:  000000000031ca90 0000000142a8070f
    0x000000000031ca80:  000000000031cb70 0000000000000000
    0x000000000031ca90:  0000000180000100 0000000000000000
    0x000000000031caa0:  000000007bc2ecd8 0000000100000002
    0x000000000031cab0:  000000000031d1d0 0000000142a812e9
    0x000000000031cac0:  0000000000000400 000000014304bd00
    0x000000000031cad0:  00000000000000c4 0000000000000264
    0x000000000031cae0:  0000000000027180 0000000142a80a3a
    0x000000000031caf0:  00000000437ffe00 0000000000000000
    0x000000000031cb00:  0000000000000000 0000000000000000
    0x000000000031cb10:  000000013fff8000 000000000031d1d0
    0x000000000031cb20:  000000007bc689e0 0000000000000000
    Backtrace:
    =>0 0x000000007bc2ecd8 EntryPoint+0xffffffffffffffff() in ntdll (0x0000000000000000)
      1 0x0000000142a812e9 EntryPoint+0x1028d630c() in cyberpunk2077 (0x0000000000000000)
      2 0x000000007bc27dbe EntryPoint+0xffffffffffffffff() in ntdll (0x0000000000000000)
      3 0x000000007bc59b2a EntryPoint+0xffffffffffffffff() in ntdll (0x000000007bc79152)
      4 0x000000007bc57c88 EntryPoint+0xffffffffffffffff() in ntdll (0x000000000031d2f0)
      5 0x00000000312b396a EntryPoint+0xffffffffffffffff() in d3d12 (0x000000000031d410)
      6 0x00000000312b36fb EntryPoint+0xffffffffffffffff() in d3d12 (0x0000000000000000)
      7 0x00000000312b44ce EntryPoint+0xffffffffffffffff() in d3d12 (0x0000000000000001)
      8 0x00000000312b5362 EntryPoint+0xffffffffffffffff() in d3d12 (0x0000000000000001)
      9 0x00000000312b5454 EntryPoint+0xffffffffffffffff() in d3d12 (0x00000000223f6360)
      10 0x00000000312b5dac EntryPoint+0xffffffffffffffff() in d3d12 (0x00000000223f6360)
      11 0x0000000142b9caaf EntryPoint+0x1029f1ad2() in cyberpunk2077 (0x000000000031ddd0)
      12 0x000000014260a33a EntryPoint+0x10245f35d() in cyberpunk2077 (0x000000000031f179)
      13 0x0000000140a9b917 EntryPoint+0x1008f093a() in cyberpunk2077 (0x000000000031f2e0)
      14 0x0000000141656567 EntryPoint+0x1014ab58a() in cyberpunk2077 (0x000000000031f539)
      15 0x000000014288919b EntryPoint+0x1026de1be() in cyberpunk2077 (0x000000000031f539)
      16 0x0000000140a982e9 EntryPoint+0x1008ed30c() in cyberpunk2077 (0x000000000031f6a0)
      17 0x0000000140a94d61 EntryPoint+0x1008e9d84() in cyberpunk2077 (0x000000000031f890)
      18 0x0000000140a93702 EntryPoint+0x1008e8725() in cyberpunk2077 (0x000000000031ffd0)
      19 0x00000001401aa83b EntryPoint+0xfffff85e() in cyberpunk2077 (0x000000000031ffd0)
      20 0x00000001401aa8a1 EntryPoint+0xfffff8c4() in cyberpunk2077 (0x000000000031ffd0)
      21 0x00000001401aaf6e EntryPoint+0xffffff91() in cyberpunk2077 (0x000000000031ffd0)
      22 0x000000007b64af76 in kernel32 (+0x2af75) (0x000000000031ffd0)
    0x000000007bc2ecd8 EntryPoint+0xffffffffffffffff in ntdll: jmp  0x000000007bc2ecd0 EntryPoint+0xffffffffffffffff
    
  11. fabianhjr commented on Dec 21, 2020

    @fabianhjr
    Member

    I still get errors/crashes on the latest nvidia driver but figure upgrading wouldn't hurt: #107345.

    Can run with flatpak steam and proton (custom fork with 5.13-experimental)

  12. fabianhjr commented on Feb 15, 2021

    @fabianhjr
    Member

    I have been playing over a week now (though with nvidia related crashes) with LuigiPiucco/pressure-vessel branch changes rebased on origin/main branch and GloriousEggroll/proton-ge-custom.

    This is the diff with the origin/main:

    diff --git a/nixos/modules/programs/steam.nix b/nixos/modules/programs/steam.nix
    index 3c919c47a0c..eecb9de43cc 100644
    --- a/nixos/modules/programs/steam.nix
    +++ b/nixos/modules/programs/steam.nix
    @@ -4,6 +4,13 @@ with lib;
     
     let
       cfg = config.programs.steam;
    +
    +  steam = pkgs.steam.override {
    +    extraLibraries = pkgs: with config.hardware.opengl;
    +      if pkgs.hostPlatform.is64bit
    +      then [ package ] ++ extraPackages
    +      else [ package32 ] ++ extraPackages32;
    +  };
     in {
       options.programs.steam.enable = mkEnableOption "steam";
     
    @@ -18,7 +25,7 @@ in {
     
         hardware.steam-hardware.enable = true;
     
    -    environment.systemPackages = [ pkgs.steam ];
    +    environment.systemPackages = [ steam ];
       };
     
       meta.maintainers = with maintainers; [ mkg20001 ];
    diff --git a/pkgs/build-support/build-fhs-userenv-bubblewrap/default.nix b/pkgs/build-support/build-fhs-userenv-bubblewrap/default.nix
    index 6592621570c..c39b1131f42 100644
    --- a/pkgs/build-support/build-fhs-userenv-bubblewrap/default.nix
    +++ b/pkgs/build-support/build-fhs-userenv-bubblewrap/default.nix
    @@ -1,4 +1,6 @@
    -{ lib, callPackage, runCommandLocal, writeShellScriptBin, coreutils, bubblewrap }:
    +{ lib, callPackage, runCommandLocal, writeShellScriptBin, glibc, pkgsi686Linux, coreutils, bubblewrap }:
    +
    +let buildFHSEnv = callPackage ./env.nix { }; in
     
     args @ {
       name
    @@ -60,21 +62,45 @@ let
       in concatStringsSep "\n  "
       (map (file: "--ro-bind-try /etc/${file} /etc/${file}") files);
     
    +  # Create this on the fly instead of linking from /nix
    +  # The container might have to modify it and re-run ldconfig if there are
    +  # issues running some binary with LD_LIBRARY_PATH
    +  createLdConfCache = ''
    +    cat > /etc/ld.so.conf <<EOF
    +    /lib
    +    /lib/x86_64-linux-gnu
    +    /lib64
    +    /usr/lib
    +    /usr/lib/x86_64-linux-gnu
    +    /usr/lib64
    +    /lib/i386-linux-gnu
    +    /lib32
    +    /usr/lib/i386-linux-gnu
    +    /usr/lib32
    +    EOF
    +    ldconfig &> /dev/null
    +  '';
       init = run: writeShellScriptBin "${name}-init" ''
         source /etc/profile
    +    ${createLdConfCache}
         exec ${run} "$@"
       '';
     
       bwrapCmd = { initArgs ? "" }: ''
         blacklist=(/nix /dev /proc /etc)
         ro_mounts=()
    +    symlinks=()
         for i in ${env}/*; do
           path="/''${i##*/}"
           if [[ $path == '/etc' ]]; then
    -        continue
    +        :
    +      elif [[ -L $i ]]; then
    +        symlinks+=(--symlink "$(readlink "$i")" "$path")
    +        blacklist+=("$path")
    +      else
    +        ro_mounts+=(--ro-bind "$i" "$path")
    +        blacklist+=("$path")
           fi
    -      ro_mounts+=(--ro-bind "$i" "$path")
    -      blacklist+=("$path")
         done
     
         if [[ -d ${env}/etc ]]; then
    @@ -112,8 +138,19 @@ let
           ${lib.optionalString unshareCgroup "--unshare-cgroup"}
           --die-with-parent
           --ro-bind /nix /nix
    +      --tmpfs ${glibc}/etc \
    +      --symlink /etc/ld.so.conf ${glibc}/etc/ld.so.conf \
    +      --symlink /etc/ld.so.cache ${glibc}/etc/ld.so.cache \
    +      --ro-bind ${glibc}/etc/rpc ${glibc}/etc/rpc \
    +      --remount-ro ${glibc}/etc \
    +      --tmpfs ${pkgsi686Linux.glibc}/etc \
    +      --symlink /etc/ld.so.conf ${pkgsi686Linux.glibc}/etc/ld.so.conf \
    +      --symlink /etc/ld.so.cache ${pkgsi686Linux.glibc}/etc/ld.so.cache \
    +      --ro-bind ${pkgsi686Linux.glibc}/etc/rpc ${pkgsi686Linux.glibc}/etc/rpc \
    +      --remount-ro ${pkgsi686Linux.glibc}/etc \
           ${etcBindFlags}
           "''${ro_mounts[@]}"
    +      "''${symlinks[@]}"
           "''${auto_mounts[@]}"
           ${init runScript}/bin/${name}-init ${initArgs}
         )
    diff --git a/pkgs/build-support/build-fhs-userenv-bubblewrap/env.nix b/pkgs/build-support/build-fhs-userenv-bubblewrap/env.nix
    index 8b2d46c4ae9..73d705dbaa6 100644
    --- a/pkgs/build-support/build-fhs-userenv-bubblewrap/env.nix
    +++ b/pkgs/build-support/build-fhs-userenv-bubblewrap/env.nix
    @@ -1,4 +1,4 @@
    -{ stdenv, buildEnv, writeText, pkgs, pkgsi686Linux }:
    +{ stdenv, lib, buildEnv, writeText, writeScriptBin, pkgs, pkgsi686Linux }:
     
     { name, profile ? ""
     , targetPkgs ? pkgs: [], multiPkgs ? pkgs: []
    @@ -49,6 +49,11 @@ let
         [ (toString gcc.cc.lib)
         ];
     
    +  ldconfig = writeScriptBin "ldconfig" ''
    +    #!${pkgs.stdenv.shell}
    +
    +    exec ${pkgs.glibc.bin}/bin/ldconfig -f /etc/ld.so.conf -C /etc/ld.so.cache "$@"
    +  '';
       etcProfile = writeText "profile" ''
         export PS1='${name}-chrootenv:\u@\h:\w\$ '
         export LOCALE_ARCHIVE='/usr/lib/locale/locale-archive'
    @@ -86,7 +91,8 @@ let
       # Composes a /usr-like directory structure
       staticUsrProfileTarget = buildEnv {
         name = "${name}-usr-target";
    diff --git a/nixos/modules/programs/steam.nix b/nixos/modules/programs/steam.nix
    index 3c919c47a0c..eecb9de43cc 100644
    --- a/nixos/modules/programs/steam.nix
    +++ b/nixos/modules/programs/steam.nix
    @@ -4,6 +4,13 @@ with lib;
     
     let
       cfg = config.programs.steam;
    +
    +  steam = pkgs.steam.override {
    +    extraLibraries = pkgs: with config.hardware.opengl;
    +      if pkgs.hostPlatform.is64bit
    +      then [ package ] ++ extraPackages
    +      else [ package32 ] ++ extraPackages32;
    +  };
     in {
       options.programs.steam.enable = mkEnableOption "steam";
     
    @@ -18,7 +25,7 @@ in {
     
         hardware.steam-hardware.enable = true;
     
    -    environment.systemPackages = [ pkgs.steam ];
    +    environment.systemPackages = [ steam ];
       };
     
       meta.maintainers = with maintainers; [ mkg20001 ];
    diff --git a/pkgs/build-support/build-fhs-userenv-bubblewrap/default.nix b/pkgs/build-support/build-fhs-userenv-bubblewrap/default.nix
    index 6592621570c..c39b1131f42 100644
    --- a/pkgs/build-support/build-fhs-userenv-bubblewrap/default.nix
    +++ b/pkgs/build-support/build-fhs-userenv-bubblewrap/default.nix
    @@ -1,4 +1,6 @@
    -{ lib, callPackage, runCommandLocal, writeShellScriptBin, coreutils, bubblewrap }:
    +{ lib, callPackage, runCommandLocal, writeShellScriptBin, glibc, pkgsi686Linux, coreutils, bubblewrap }:
    +
    +let buildFHSEnv = callPackage ./env.nix { }; in
     
     args @ {
       name
    @@ -60,21 +62,45 @@ let
       in concatStringsSep "\n  "
       (map (file: "--ro-bind-try /etc/${file} /etc/${file}") files);
     
    +  # Create this on the fly instead of linking from /nix
    +  # The container might have to modify it and re-run ldconfig if there are
    +  # issues running some binary with LD_LIBRARY_PATH
    +  createLdConfCache = ''
    +    cat > /etc/ld.so.conf <<EOF
    +    /lib
    +    /lib/x86_64-linux-gnu
    +    /lib64
    +    /usr/lib
    +    /usr/lib/x86_64-linux-gnu
    +    /usr/lib64
    +    /lib/i386-linux-gnu
    +    /lib32
    +    /usr/lib/i386-linux-gnu
    +    /usr/lib32
    +    EOF
    +    ldconfig &> /dev/null
    +  '';
       init = run: writeShellScriptBin "${name}-init" ''
         source /etc/profile
    +    ${createLdConfCache}
         exec ${run} "$@"
       '';
     
       bwrapCmd = { initArgs ? "" }: ''
         blacklist=(/nix /dev /proc /etc)
         ro_mounts=()
    +    symlinks=()
         for i in ${env}/*; do
           path="/''${i##*/}"
           if [[ $path == '/etc' ]]; then
    -        continue
    +        :
    +      elif [[ -L $i ]]; then
    +        symlinks+=(--symlink "$(readlink "$i")" "$path")
    +        blacklist+=("$path")
    +      else
    +        ro_mounts+=(--ro-bind "$i" "$path")
    +        blacklist+=("$path")
           fi
    -      ro_mounts+=(--ro-bind "$i" "$path")
    -      blacklist+=("$path")
         done
     
         if [[ -d ${env}/etc ]]; then
    @@ -112,8 +138,19 @@ let
           ${lib.optionalString unshareCgroup "--unshare-cgroup"}
           --die-with-parent
           --ro-bind /nix /nix
    +      --tmpfs ${glibc}/etc \
    +      --symlink /etc/ld.so.conf ${glibc}/etc/ld.so.conf \
    +      --symlink /etc/ld.so.cache ${glibc}/etc/ld.so.cache \
    +      --ro-bind ${glibc}/etc/rpc ${glibc}/etc/rpc \
    +      --remount-ro ${glibc}/etc \
    +      --tmpfs ${pkgsi686Linux.glibc}/etc \
    +      --symlink /etc/ld.so.conf ${pkgsi686Linux.glibc}/etc/ld.so.conf \
    +      --symlink /etc/ld.so.cache ${pkgsi686Linux.glibc}/etc/ld.so.cache \
    +      --ro-bind ${pkgsi686Linux.glibc}/etc/rpc ${pkgsi686Linux.glibc}/etc/rpc \
    +      --remount-ro ${pkgsi686Linux.glibc}/etc \
           ${etcBindFlags}
           "''${ro_mounts[@]}"
    +      "''${symlinks[@]}"
           "''${auto_mounts[@]}"
           ${init runScript}/bin/${name}-init ${initArgs}
         )
    diff --git a/pkgs/build-support/build-fhs-userenv-bubblewrap/env.nix b/pkgs/build-support/build-fhs-userenv-bubblewrap/env.nix
    index 8b2d46c4ae9..73d705dbaa6 100644
    --- a/pkgs/build-support/build-fhs-userenv-bubblewrap/env.nix
    +++ b/pkgs/build-support/build-fhs-userenv-bubblewrap/env.nix
    @@ -1,4 +1,4 @@
    -{ stdenv, buildEnv, writeText, pkgs, pkgsi686Linux }:
    +{ stdenv, lib, buildEnv, writeText, writeScriptBin, pkgs, pkgsi686Linux }:
     
     { name, profile ? ""
     , targetPkgs ? pkgs: [], multiPkgs ? pkgs: []
    @@ -49,6 +49,11 @@ let
         [ (toString gcc.cc.lib)
         ];
     
    +  ldconfig = writeScriptBin "ldconfig" ''
    +    #!${pkgs.stdenv.shell}
    +
    +    exec ${pkgs.glibc.bin}/bin/ldconfig -f /etc/ld.so.conf -C /etc/ld.so.cache "$@"
    +  '';
       etcProfile = writeText "profile" ''
         export PS1='${name}-chrootenv:\u@\h:\w\$ '
         export LOCALE_ARCHIVE='/usr/lib/locale/locale-archive'
    @@ -86,7 +91,8 @@ let
       # Composes a /usr-like directory structure
       staticUsrProfileTarget = buildEnv {
         name = "${name}-usr-target";
    diff --git a/nixos/modules/programs/steam.nix b/nixos/modules/programs/steam.nix
    index 3c919c47a0c..eecb9de43cc 100644
    --- a/nixos/modules/programs/steam.nix
    +++ b/nixos/modules/programs/steam.nix
    @@ -4,6 +4,13 @@ with lib;
     
     let
       cfg = config.programs.steam;
    +
    +  steam = pkgs.steam.override {
    +    extraLibraries = pkgs: with config.hardware.opengl;
    +      if pkgs.hostPlatform.is64bit
    +      then [ package ] ++ extraPackages
    +      else [ package32 ] ++ extraPackages32;
    +  };
     in {
       options.programs.steam.enable = mkEnableOption "steam";
     
    @@ -18,7 +25,7 @@ in {
     
         hardware.steam-hardware.enable = true;
     
    -    environment.systemPackages = [ pkgs.steam ];
    +    environment.systemPackages = [ steam ];
       };
     
       meta.maintainers = with maintainers; [ mkg20001 ];
    diff --git a/pkgs/build-support/build-fhs-userenv-bubblewrap/default.nix b/pkgs/build-support/build-fhs-userenv-bubblewrap/default.nix
    index 6592621570c..c39b1131f42 100644
    --- a/pkgs/build-support/build-fhs-userenv-bubblewrap/default.nix
    +++ b/pkgs/build-support/build-fhs-userenv-bubblewrap/default.nix
    @@ -1,4 +1,6 @@
    -{ lib, callPackage, runCommandLocal, writeShellScriptBin, coreutils, bubblewrap }:
    +{ lib, callPackage, runCommandLocal, writeShellScriptBin, glibc, pkgsi686Linux, coreutils, bubblewrap }:
    +
    +let buildFHSEnv = callPackage ./env.nix { }; in
     
     args @ {
       name
    @@ -60,21 +62,45 @@ let
       in concatStringsSep "\n  "
       (map (file: "--ro-bind-try /etc/${file} /etc/${file}") files);
     
    +  # Create this on the fly instead of linking from /nix
    +  # The container might have to modify it and re-run ldconfig if there are
    +  # issues running some binary with LD_LIBRARY_PATH
    +  createLdConfCache = ''
    +    cat > /etc/ld.so.conf <<EOF
    +    /lib
    +    /lib/x86_64-linux-gnu
    +    /lib64
    +    /usr/lib
    +    /usr/lib/x86_64-linux-gnu
    +    /usr/lib64
    +    /lib/i386-linux-gnu
    +    /lib32
    +    /usr/lib/i386-linux-gnu
    +    /usr/lib32
    +    EOF
    +    ldconfig &> /dev/null
    +  '';
       init = run: writeShellScriptBin "${name}-init" ''
         source /etc/profile
    +    ${createLdConfCache}
         exec ${run} "$@"
       '';
     
       bwrapCmd = { initArgs ? "" }: ''
         blacklist=(/nix /dev /proc /etc)
         ro_mounts=()
    +    symlinks=()
         for i in ${env}/*; do
           path="/''${i##*/}"
           if [[ $path == '/etc' ]]; then
    -        continue
    +        :
    +      elif [[ -L $i ]]; then
    +        symlinks+=(--symlink "$(readlink "$i")" "$path")
    +        blacklist+=("$path")
    +      else
    +        ro_mounts+=(--ro-bind "$i" "$path")
    +        blacklist+=("$path")
           fi
    -      ro_mounts+=(--ro-bind "$i" "$path")
    -      blacklist+=("$path")
         done
     
         if [[ -d ${env}/etc ]]; then
    @@ -112,8 +138,19 @@ let
           ${lib.optionalString unshareCgroup "--unshare-cgroup"}
           --die-with-parent
           --ro-bind /nix /nix
    +      --tmpfs ${glibc}/etc \
    +      --symlink /etc/ld.so.conf ${glibc}/etc/ld.so.conf \
    +      --symlink /etc/ld.so.cache ${glibc}/etc/ld.so.cache \
    +      --ro-bind ${glibc}/etc/rpc ${glibc}/etc/rpc \
    +      --remount-ro ${glibc}/etc \
    +      --tmpfs ${pkgsi686Linux.glibc}/etc \
    +      --symlink /etc/ld.so.conf ${pkgsi686Linux.glibc}/etc/ld.so.conf \
    +      --symlink /etc/ld.so.cache ${pkgsi686Linux.glibc}/etc/ld.so.cache \
    +      --ro-bind ${pkgsi686Linux.glibc}/etc/rpc ${pkgsi686Linux.glibc}/etc/rpc \
    +      --remount-ro ${pkgsi686Linux.glibc}/etc \
           ${etcBindFlags}
           "''${ro_mounts[@]}"
    +      "''${symlinks[@]}"
           "''${auto_mounts[@]}"
           ${init runScript}/bin/${name}-init ${initArgs}
         )
    diff --git a/pkgs/build-support/build-fhs-userenv-bubblewrap/env.nix b/pkgs/build-support/build-fhs-userenv-bubblewrap/env.nix
    index 8b2d46c4ae9..73d705dbaa6 100644
    --- a/pkgs/build-support/build-fhs-userenv-bubblewrap/env.nix
    +++ b/pkgs/build-support/build-fhs-userenv-bubblewrap/env.nix
    @@ -1,4 +1,4 @@
    -{ stdenv, buildEnv, writeText, pkgs, pkgsi686Linux }:
    +{ stdenv, lib, buildEnv, writeText, writeScriptBin, pkgs, pkgsi686Linux }:
     
     { name, profile ? ""
     , targetPkgs ? pkgs: [], multiPkgs ? pkgs: []
    @@ -49,6 +49,11 @@ let
         [ (toString gcc.cc.lib)
         ];
     
    +  ldconfig = writeScriptBin "ldconfig" ''
    +    #!${pkgs.stdenv.shell}
    +
    +    exec ${pkgs.glibc.bin}/bin/ldconfig -f /etc/ld.so.conf -C /etc/ld.so.cache "$@"
    +  '';
       etcProfile = writeText "profile" ''
         export PS1='${name}-chrootenv:\u@\h:\w\$ '
         export LOCALE_ARCHIVE='/usr/lib/locale/locale-archive'
    @@ -86,7 +91,8 @@ let
       # Composes a /usr-like directory structure
       staticUsrProfileTarget = buildEnv {
         name = "${name}-usr-target";
    -    paths = [ etcPkg ] ++ basePkgs ++ targetPaths;
    +    # ldconfig wrapper must come first so it overrides the original ldconfig
    +    paths = [ etcPkg ldconfig ] ++ basePkgs ++ targetPaths;
         extraOutputsToInstall = [ "out" "lib" "bin" ] ++ extraOutputsToInstall;
         ignoreCollisions = true;
       };
    @@ -132,7 +138,20 @@ let
         mkdir -m0755 usr
         cd usr
         ${setupLibDirs}
    -    for i in bin sbin share include; do
    +    ${lib.optionalString isMultiBuild ''
    +    if [ -d "${staticUsrProfileMulti}/share" ]; then
    +      cp -rLf ${staticUsrProfileMulti}/share share
    +    fi
    +    ''}
    +    if [ -d "${staticUsrProfileTarget}/share" ]; then
    +      if [ -d share ]; then
    +        chmod -R 755 share
    +        cp -rLTf ${staticUsrProfileTarget}/share share
    +      else
    +        cp -rLf ${staticUsrProfileTarget}/share share
    +      fi
    +    fi
    +    for i in bin sbin include; do
           if [ -d "${staticUsrProfileTarget}/$i" ]; then
             cp -rsHf "${staticUsrProfileTarget}/$i" "$i"
           fi
    diff --git a/pkgs/games/steam/fhsenv.nix b/pkgs/games/steam/fhsenv.nix
    index 924714d802a..42faaf287d7 100644
    --- a/pkgs/games/steam/fhsenv.nix
    +++ b/pkgs/games/steam/fhsenv.nix
    @@ -134,6 +134,20 @@ in buildFHSUserEnv rec {
         libuuid
         libbsd
         alsaLib
    +
    +    # needed by getcap for vr startup
    +    libcap
    +
    +    # dependencies for mesa drivers, needed inside pressure-vessel
    +    mesa.drivers
    +    expat
    +    wayland
    +    xlibs.libxcb
    +    xlibs.libXdamage
    +    xlibs.libxshmfence
    +    xlibs.libXxf86vm
    +    llvm_11.lib
    +    libelf
       ] ++ (if (!nativeOnly) then [
         (steamPackages.steam-runtime-wrapped.override {
           inherit runtimeOnly;
    @@ -251,6 +265,8 @@ in buildFHSUserEnv rec {
         fi
     
         export STEAM_RUNTIME=${if nativeOnly then "0" else "/steamrt"}
    +
    +    export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/intel_icd.x86_64.json:/usr/share/vulkan/icd.d/intel_icd.i686.json:/usr/share/vulkan/icd.d/lvp_icd.x86_64.json:/usr/share/vulkan/icd.d/lvp_icd.i686.json:/usr/share/vulkan/icd.d/nvidia_icd.json:/usr/share/vulkan/icd.d/nvidia_icd32.json:/usr/share/vulkan/icd.d/radeon_icd.x86_64.json:/usr/share/vulkan/icd.d/radeon_icd.i686.json
       '' + extraProfile;
     
       runScript = writeScript "steam-wrapper.sh" ''
    

    From this branch: https://github.com/LuigiPiucco/nixpkgs/commits/pressure-vessel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bug6.topic: nixos6.topic: steam

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions