nix-community / impermanence

Modules to help you handle persistent state on systems with ephemeral root storage [maintainer=@talyz]
MIT License
1.01k stars 76 forks source link

Persisting Steam breaks any game within it and also fails shutdown #165

Open GetPsyched opened 5 months ago

GetPsyched commented 5 months ago

Persisting .local/share/Steam either with bindfs or as a symlink causes Steam to partially break. Any time I open it, it fails to launch any game, and if I try to shut down Steam, it gives the following log with the last line repeating every X seconds.

x86_64-linux-gnu-capsule-capture-libs: warning: Dependencies of libnvidia-pkcs11.so.545.29.06 not found, ignoring: Missing dependencies: Could not find "libcrypto.so.1.1" in LD_LIBRARY_PATH "/persist/bigdata/home/getpsyched/.local/share/Steam/ubuntu12_32:/persist/bigdata/home/getpsyched/.local/share/Steam/ubuntu12_32/panorama:/lib64:/lib32:/steamrt/amd64/lib/x86_64-linux-gnu:/steamrt/amd64/lib:/steamrt/amd64/usr/lib/x86_64-linux-gnu:/steamrt/amd64/usr/lib:/steamrt/i386/lib/i386-linux-gnu:/steamrt/i386/lib:/steamrt/i386/usr/lib/i386-linux-gnu:/steamrt/i386/usr/lib:/run/opengl-driver/lib:/run/opengl-driver-32/lib:/lib:/lib32:/run/opengl-driver/lib:/run/opengl-driver-32/lib:/nix/store/7jiqcrg061xi5clniy7z5pvkc4jiaqav-glibc-2.38-27/lib", ld.so.cache, DT_RUNPATH or fallback /lib:/usr/lib
x86_64-linux-gnu-capsule-capture-libs: warning: Dependencies of libnvidia-pkcs11.so.545.29.06 not found, ignoring: Missing dependencies: Could not find "libcrypto.so.1.1" in LD_LIBRARY_PATH "/persist/bigdata/home/getpsyched/.local/share/Steam/ubuntu12_32:/persist/bigdata/home/getpsyched/.local/share/Steam/ubuntu12_32/panorama:/lib64:/lib32:/steamrt/amd64/lib/x86_64-linux-gnu:/steamrt/amd64/lib:/steamrt/amd64/usr/lib/x86_64-linux-gnu:/steamrt/amd64/usr/lib:/steamrt/i386/lib/i386-linux-gnu:/steamrt/i386/lib:/steamrt/i386/usr/lib/i386-linux-gnu:/steamrt/i386/usr/lib:/run/opengl-driver/lib:/run/opengl-driver-32/lib:/lib:/lib32:/run/opengl-driver/lib:/run/opengl-driver-32/lib:/nix/store/7jiqcrg061xi5clniy7z5pvkc4jiaqav-glibc-2.38-27/lib", ld.so.cache, DT_RUNPATH or fallback /lib:/usr/lib
x86_64-linux-gnu-capsule-capture-libs: warning: Dependencies of libnvidia-pkcs11.so.545.29.06 not found, ignoring: Missing dependencies: Could not find "libcrypto.so.1.1" in LD_LIBRARY_PATH "/persist/bigdata/home/getpsyched/.local/share/Steam/ubuntu12_32:/persist/bigdata/home/getpsyched/.local/share/Steam/ubuntu12_32/panorama:/lib64:/lib32:/steamrt/amd64/lib/x86_64-linux-gnu:/steamrt/amd64/lib:/steamrt/amd64/usr/lib/x86_64-linux-gnu:/steamrt/amd64/usr/lib:/steamrt/i386/lib/i386-linux-gnu:/steamrt/i386/lib:/steamrt/i386/usr/lib/i386-linux-gnu:/steamrt/i386/usr/lib:/run/opengl-driver/lib:/run/opengl-driver-32/lib:/lib:/lib32:/run/opengl-driver/lib:/run/opengl-driver-32/lib:/nix/store/7jiqcrg061xi5clniy7z5pvkc4jiaqav-glibc-2.38-27/lib", ld.so.cache, DT_RUNPATH or fallback /lib:/usr/lib
pressure-vessel-wrap[18330]: W: "/run/current-system/sw/bin/getent" is unlikely to appear in "/run/host"
pressure-vessel-wrap[18330]: W: Found more than one possible libdrm data directory from provider
src/common/pipes.cpp (885) : stalled cross-thread pipe.
src/common/pipes.cpp (885) : stalled cross-thread pipe.
02/10 15:43:35 Init: Installing breakpad exception handler for appid(steam)/version(1705108172)/tid(17585)
assert_20240210154335_39.dmp[18555]: Uploading dump (out-of-process)
/tmp/dumps/assert_20240210154335_39.dmp
src/clientdll/steamclient.cpp (912) : bufRet.TellPut() == sizeof(uint8)
src/clientdll/steamclient.cpp (912) : bufRet.TellPut() == sizeof(uint8)
Thread "CJobMgr::m_WorkThreadPool:1" (ID 17679) failed to shut down
Thread "CJobMgr::m_WorkThreadPool:1" (ID 17679) failed to shut down
Thread "CJobMgr::m_WorkThreadPool:1" (ID 17679) failed to shut down
Thread "CJobMgr::m_WorkThreadPool:1" (ID 17679) failed to shut down

This also blocks any nixos-rebuild commands, system shutdown, and even just listing either .steam or .local/share/Steam using ls

I have been having this issue for months now and the only solution is to not persist Steam and run it off of my tmpfs. Also, FYI, I'm using BTRFS.

nakoo commented 4 weeks ago

Have the same issue with zfs. Did you find the solution rather than using tmpfs?

GetPsyched commented 4 weeks ago

I found a solution without sacrificing my tmpfs! I simply made a manual bind mount:

# making a separate subvol is entirely optional. I simply did it for convenience.
fileSystems."/persist/steam" = {
  device = "/dev/mapper/cryptroot";
  fsType = "btrfs";
  options = [ "subvol=${subvol},compress=zstd,noatime" ];
  neededForBoot = true;
};

fileSystems."/home/getpsyched/.steam" = {
  device = "/persist/steam/.steam";
  fsType = "none";
  options = [ "bind" ];
  noCheck = true;
};

NOTE: Before launching Steam, move .local/share/Steam to some place that's persisted but not touched by impermanence. When Steam launches, it will ask whether the installation was deleted or moved; select moved and point it to the new location. Done. Steam should now run normally.

nakoo commented 4 weeks ago

I found a solution without sacrificing my tmpfs! I simply made a manual bind mount:

# making a separate subvol is entirely optional. I simply did it for convenience.
fileSystems."/persist/steam" = {
  device = "/dev/mapper/cryptroot";
  fsType = "btrfs";
  options = [ "subvol=${subvol},compress=zstd,noatime" ];
  neededForBoot = true;
};

fileSystems."/home/getpsyched/.steam" = {
  device = "/persist/steam/.steam";
  fsType = "none";
  options = [ "bind" ];
  noCheck = true;
};

NOTE: Before launching Steam, move .local/share/Steam to some place that's persisted but not touched by impermanence. When Steam launches, it will ask whether the installation was deleted or moved; select moved and point it to the new location. Done. Steam should now run normally.

Thank you for the reply! I’m just curious but Is there a reason not choosing to bind .local/share/Steam into /persist/steam/.local/share/Steam?

GetPsyched commented 4 weeks ago

Well, initially I tried binding just .steam since it stores the important login details, .local/share/Steam is just state (I store my games elsewhere). But once this worked, I tried binding .local/share/Steam to /persist/steam/Steam but got some error that I don't recall unfortunately. Since moving the location on Steam worked and I was already tired of this issue, I didn't try any further. (if it works, don't touch it xD)