Running linux native steam game

Hi

I installed the game Dead Cells through steam. It is a Linux native game and does not start when trying to launch the linux version (proton version works though).

I checked tahth all the linked libraries are resolved by changing the LD_LIBRARY_PATH variable but the binary still does not start.

❯ strace ./deadcells
execve("./deadcells", ["./deadcells"], 0x7ffcecdde580 /* 99 vars */) = -1 ENOENT (No such file or directory)
strace: exec: No such file or directory
+++ exited with 1 +++

What is the correct way to solve this ?

Give it an ldd, you’ll probably see that the interpreter is wrong. The error message is misleading, but it’s what you see when the interpreter is missing.

That said, while I use the flatpak personally, I thought the steam runtime fixes issues like these, or at least programs.steam.enable would.

1 Like

I installed steam with programs.steam.enable = true.
ldd seems ok too:

 ldd ./deadcells
        linux-vdso.so.1 (0x00007fff1cdc2000)
        libhl.so => ./libhl.so (0x00007f7ada381000)
        libm.so.6 => /nix/store/d2bpliayddadf6lx6l1i04w265gqw8n6-glibc-2.34-210/lib/libm.so.6 (0x00007f7ada2a8000)
        libdl.so.2 => /nix/store/d2bpliayddadf6lx6l1i04w265gqw8n6-glibc-2.34-210/lib/libdl.so.2 (0x00007f7ada2a3000)
        libpthread.so.0 => /nix/store/d2bpliayddadf6lx6l1i04w265gqw8n6-glibc-2.34-210/lib/libpthread.so.0 (0x00007f7ada29e000)
        libc.so.6 => /nix/store/d2bpliayddadf6lx6l1i04w265gqw8n6-glibc-2.34-210/lib/libc.so.6 (0x00007f7ada0a0000)
        /lib64/ld-linux-x86-64.so.2 => /nix/store/d2bpliayddadf6lx6l1i04w265gqw8n6-glibc-2.34-210/lib64/ld-linux-x86-64.so.2 (0x00007f7ada82b000)

That’s the interpreter. It looks fine because ldd isn’t actually executing the program, so it will look up where the linker it knows about is and everything’s fine.

In reality, the file starts with #!/lib64/ld-linux-x86-64.so.2, which means the kernel will execute that file and pass the rest of your program to it, so the kernel tells you

Because that path doesn’t exist. It’s a silly error message for a silly issue.

If you want to run that binary, you’ll have to patchelf it (use --set-interpreter). Note that this may constitute cheating, and that updates might break that.

The non-patchelf solution is figuring out how docs/container-runtime.md · master · steamrt / steam-runtime-tools · GitLab works, and why it’s not being used for you by default.

Another alternative is using Flathub—An app store and build service for Linux with the proton extensions if you need them (note the built-in proton doesn’t always work, you want the additional flathub extensions), but it would be nice to know why your NixOS setup doesn’t work out of the box.

I try to force the steam-runtime in the compatibility mode without success, I don’t see the command ran by steam though. When launching through the steam client it just closes immediately.

I think I’ll stay with the proton version (ie windows build) which is working instead of the flatpak. I did not encountered another game having this behavior yet.

If I understand the situation correctly, you’re trying to run the game through steam, and it doesn’t work, so you tried running the game outside of steam, and got the No such file or directory error.

In that case, the error has nothing to do with why it’s not running correctly when launched from steam. It happens anytime a binary made for normal linux distributions is run on nixos. The packaging for steam on nixos gets around this by creating a lightweight container that replicates a more typical distro’s filesystem environment.

Try running the game with steam-run ./deadcells. That should produce an environment much closer to how it runs when started through steam, and allow more useful debugging.

It can also be useful to start steam itself from a terminal so that you can see console output of not only steam, but the games it starts.

1 Like

I also had an issue with this game specifically, I solved it by adding libpng to the steam extraPackages like so:

          steam = prev.steam.override {
            extraPkgs = pkgs:
              with pkgs; [
                libpng # dead cells
                icu # unrailed
              ];
          };

I tried with the terminal after having tried through steam. If I check the logs from steam it gives an error about libpng missing (as mentionned by @timhae)

I reinstalled and forced again steam-runtime in compatibility mode and it worked. If I uncheck the compatibility option and install libpng as instructed by @timhae it works too. I think the container is not created by steam if the steam-runtime is not selected but I do not know exactly why.

What is the difference between installing libpng with the extraPkgs directive and installing libpng alongside steam as a normal package (not in extraPkgs) ?

Installing libraries directly in nixos does nothing useful at all. Packages hardcode the storepaths of their libraries. They aren’t found by searching well-known paths.

The extraPkgs directive tells nix to include the library in the container it runs steam in. This is distinct from the container that steam creates when you use the steam-runtime compatibility tool, btw.

1 Like

I did not know that steam on nix was containerized.
We can consider the subject solved then.

Thanks all !