Repository navigation
Description
Update: please see most recent comment for what I think is the actual issue here, though these other comments are hopefully helpful for reproducing and determining what is happening in the actual code.
Pressure Vessel can load the host's GL drivers from Mesa and will note that it is capturing these drivers to place in overrides. However, not all of them are actually there once it comes time for the game to launch (i.e. after LIBGL_DRIVERS_PATH is overwritten).
For example, here is the relevant output for the 64bit radeonsi_dri driver, which exists for 32bit as well as other drivers like swrast:
pressure-vessel-wrap[420]: D: ->
pressure-vessel-wrap[420]: I: Capturing loadable module: /gnu/store/ry26xl825rnm8ia473qidfd1a9qnkx39-mesa-for-fhs-21.2.5/lib/dri/radeonsi_dri.so
pressure-vessel-wrap[420]: D: run: '/home/john/.local/share/Steam/steamapps/common/SteamLinuxRuntime_soldier/pressure-vessel/libexec/steam-runtime-tools-0/x86_64-linux-gnu-capsule-capture-libs' '--container' '/home/john/.local/share/Steam/steamapps/common/SteamLinuxRuntime_soldier/var/tmp-OACID1' '--remap-link-prefix' '/app/=/run/host/app/' '--remap-link-prefix' '/usr/=/run/host/usr/' '--remap-link-prefix' '/lib=/run/host/lib' '--provider' '/' '--library-knowledge' '/home/john/.local/share/Steam/steamapps/common/SteamLinuxRuntime_soldier/var/tmp-OACID1/usr/lib/steamrt/libcapsule-knowledge.keyfile' '--dest' '/home/john/.local/share/Steam/steamapps/common/SteamLinuxRuntime_soldier/var/tmp-OACID1/usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/dri' 'no-dependencies:even-if-older:if-exists:if-same-abi:path:/gnu/store/ry26xl825rnm8ia473qidfd1a9qnkx39-mesa-for-fhs-21.2.5/lib/dri/radeonsi_dri.so'
And then later the errors from libGL (I believe the failing to find configuration files is innocuous or similar to #432 in Nix):
libGL: Can't open configuration file /gnu/store/nmnlw8h88r3kqd5ymbvb3qwilkf8f3cr-mesa-for-fhs-21.2.5/etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/john/.drirc: No such file or directory.
libGL: using driver amdgpu for 31
libGL: Can't open configuration file /gnu/store/nmnlw8h88r3kqd5ymbvb3qwilkf8f3cr-mesa-for-fhs-21.2.5/etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/john/.drirc: No such file or directory.
libGL: pci id for fd 31: 1002:73df, driver radeonsi
libGL: MESA-LOADER: failed to open /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/dri/radeonsi_dri.so: /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/dri/radeonsi_dri.so: cannot open shared object file: No such file or directory
libGL: MESA-LOADER: failed to open /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/dri/radeonsi_dri.so: /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/dri/radeonsi_dri.so: cannot open shared object file: No such file or directory
libGL error: MESA-LOADER: failed to open radeonsi: /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/dri/radeonsi_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/dri:/usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/dri, suffix _dri)
libGL error: failed to load driver: radeonsi
libGL: using driver amdgpu for 31
libGL: Can't open configuration file /gnu/store/nmnlw8h88r3kqd5ymbvb3qwilkf8f3cr-mesa-for-fhs-21.2.5/etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/john/.drirc: No such file or directory.
libGL: pci id for fd 31: 1002:73df, driver radeonsi
libGL: MESA-LOADER: failed to open /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/dri/radeonsi_dri.so: /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/dri/radeonsi_dri.so: cannot open shared object file: No such file or directory
libGL: MESA-LOADER: failed to open /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/dri/radeonsi_dri.so: /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/dri/radeonsi_dri.so: cannot open shared object file: No such file or directory
libGL error: MESA-LOADER: failed to open radeonsi: /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/dri/radeonsi_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/dri:/usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/dri, suffix _dri)
libGL error: failed to load driver: radeonsi
libGL: MESA-LOADER: failed to open /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/dri/swrast_dri.so: /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/dri/swrast_dri.so: cannot open shared object file: No such file or directory
libGL: MESA-LOADER: failed to open /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/dri/swrast_dri.so: /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/dri/swrast_dri.so: cannot open shared object file: No such file or directory
libGL error: MESA-LOADER: failed to open swrast: /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/dri/swrast_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/dri:/usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/dri, suffix _dri)
libGL error: failed to load driver: swrast
And indeed, looking at the overrides folder in the container shows some of the files missing:
tmp-OACID1/usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/dri
├── i830_dri.so -> /gnu/store/ry26xl825rnm8ia473qidfd1a9qnkx39-mesa-for-fhs-21.2.5/lib/dri/i830_dri.so
├── i915_dri.so -> /gnu/store/ry26xl825rnm8ia473qidfd1a9qnkx39-mesa-for-fhs-21.2.5/lib/dri/i915_dri.so
├── i965_dri.so -> /gnu/store/ry26xl825rnm8ia473qidfd1a9qnkx39-mesa-for-fhs-21.2.5/lib/dri/i965_dri.so
├── nouveau_vieux_dri.so -> /gnu/store/ry26xl825rnm8ia473qidfd1a9qnkx39-mesa-for-fhs-21.2.5/lib/dri/nouveau_vieux_dri.so
├── r200_dri.so -> /gnu/store/ry26xl825rnm8ia473qidfd1a9qnkx39-mesa-for-fhs-21.2.5/lib/dri/r200_dri.so
└── radeon_dri.so -> /gnu/store/ry26xl825rnm8ia473qidfd1a9qnkx39-mesa-for-fhs-21.2.5/lib/dri/radeon_dri.so
This happens if I make these files available in another location like /lib/dri and set LIBGL_DRIVERS_PATH, where I can see pressure vessel picking them up from this path, but with the same results. I thought this was due to symlinking before (there are only a couple of different drivers for Mesa, most of these _dri.so files are symlinks for me) but still happens building Mesa in a more standard way, as in the above output.
The same file is loaded successfully earlier, before the final game launching step, e.g.
libGL: Can't open configuration file /gnu/store/ry26xl825rnm8ia473qidfd1a9qnkx39-mesa-for-fhs-21.2.5/etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/john/.drirc: No such file or directory.
libGL: using driver amdgpu for 14
libGL: Can't open configuration file /gnu/store/ry26xl825rnm8ia473qidfd1a9qnkx39-mesa-for-fhs-21.2.5/etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/john/.drirc: No such file or directory.
libGL: pci id for fd 14: 1002:73df, driver radeonsi
Installing breakpad exception handler for appid(steam)/version(1637624439)
Installing breakpad exception handler for appid(steam)/version(1637624439)
libGL: MESA-LOADER: dlopen(/gnu/store/ry26xl825rnm8ia473qidfd1a9qnkx39-mesa-for-fhs-21.2.5/lib/dri/radeonsi_dri.so)
Some technical details of my setup below, but any clues I could look into? Why is this happening for some of the drivers but not all? In particular it is happening for the exact file that is loaded earlier, but not sure how this would affect the capturing. How can I debug what is happening, as there are no errors around the capsule-capture-libs step, which sounds like it is doing exactly what it should, and does get all the other drivers?
Some technical details:
This is on GNU Guix, which has a similar format to NixOS. What is relevant is that everything is stored in /gnu/store and then symlinked. So Steam is launched in a container that mimics a typical FHS setup (similar to how Nix does it) creating all the usual folders in a (Guix, not bwrap) container. /gnu/store is visible and otherwise works in Steam. Steam has no problem finding things in /gnu/store like this and launches, installs games, but fails in the final container for launching a game. I run Steam with
LIBGL_DEBUG=verbose PRESSURE_VESSEL_FILESYSTEMS_RO=/gnu/store G_MESSAGES_DEBUG=1 PRESSURE_VESSEL_VERBOSE=1 STEAM_LINUX_RUNTIME_VERBOSE=1
I should note I'm working on updating a Steam package to have more recent Proton working (older ones work, before the runtime container was added in Proton 5.13). I think I've successfully set everything up to work, getting around the same issues raised for NixOS in e.g. NixOS/nixpkgs#100655 But this is where I'm stuck and not sure what else I can change on the host OS side that would have an effect.
Activity
podiki commentedon Dec 5, 2021
I did some more digging and I think found the actual problem. I ran the capture-libs command within pressure vessel (with the
PRESSURE_VESSEL_SHELL=insteadoption). Looks like capture will fail silently (no output) with some options, I think theif-existspart? Removing some options eventually I hit an output: it was failing to load some LLVM libraries, likelibLLVMCoroutines.so.So what I think is happening is that pressure vessel is not adding the LLVM libraries to the overrides (no LLVM ones listed in the output or Steam's system information) needed to load some of the Mesa drivers, like
radeonsi. Seems most distributions build a shared library likelibLLVM-11.sorather than linking Mesa against the individual ones. But I'm not sure why pressure vessel doesn't pull them in via references (lddshows the dependencies for instance), as I didn't see any explicit handling for this in my quick scan of the code.Now, one option is for Guix to build LLVM and Mesa with the appropriate option shared library option. While Guix might decide this is better (separating out the more "developer" build of LLVM for those that need it rather than for everything) and join most other distros, this still seems like a general problem that someone may run into compiling their own stuff. And would seem appropriate for pressure vessel to pull in linked dependencies for host graphics drivers. (For reference, this has come up on Guix but seems to have gotten lost: https://lists.gnu.org/archive/html/guix-devel/2020-06/msg00147.html and https://issues.guix.gnu.org/42576)
As far as I can tell, there's no way to force the LLVM libs to end up in the override, is there? Can (should?) pressure vessel be more robust in how it handles dependencies for overrides it brings in, especially for these few critical components?
Thanks!
podiki commentedon Dec 5, 2021
(Apologies for any spam, but hoping the process is helpful for others as well.)
Building LLVM with
DYLIBto have a singlelibLLVM-11.sofor Mesa linking did not help. Digging further, I'm really not sure what is going on, Steam can load the DRIradeonsi_dri.sofine until the final environment for launching the game, since it doesn't pull in the LLVM libs into overrides. Is this because of the capture-libsno-dependenciesflag? Yet that seems to work in other distros, so I would guess it is something about the pathing on Guix, but it is consistent in all paths (so why not pull inlibLLVMlike in other overrides, e.g.libstdc++.so.6).Adding the flag
CAPSULE_DEBUG=tool,search(thanks #305) shows explicitly that it knows to loadlibLLVMand finds it, e.g. on Steam startup:But in launching with an xterm in the environment and running the command from the log won't find
libLLVMas it is not in the overrides or/libor/usr/libwhile it still exists from the host, e.g.
So the search is only within the container and not from host at this stage, but just to confirm that this is still accessible:
The first part of an
objdump -T -xof thisradeonsi_dri.soand for this
libLLVM-11.soNote that all these
/gnu/storedirectories are visible in the pre-game launch environment and overrides does get populated with other libraries. For some reason just seemslibLLVM(or the individual LLVM libs when not a dynlib) is not also included.Steam Runtime Version: steam-runtime_0.20211102.0podiki commentedon Dec 6, 2021
I spoke too soon, seems moving to just
libLLVM-11.sodid indeed do the trick. I think when I was running the capture commands instead of launching the game, that it is already within the final container so it doesn't make sense to look at debugging there. Instead, I looked back at the log and saw the drivers weren't being captured to a different missing dependency (libelf.so.1) which I made available and now it works!The real potential issue, finally:
Looking back at the logs and going back through the changes, does seem that without LLVM compiled with the dynlib option, that pressure vessel won't see/capture the individual LLVM libraries needed by Mesa. So I see it fail on
libLLVMCoroutines.so(first one it tries?) yet no problem when it is justlibLLVM-11.so. Is that a possible bug? Or if there is something different on the host side, I'm not sure what, as that was the only change I made (and rebuilding Mesa with that LLVM input). And running this on Guix and within a Guix container I feel pretty safe in saying there weren't other side effects here.In any event, I hope this is helpful documentation and maybe of some use to someone else trying to debug such things (there's a lot to wrap your head around here!).
smcv commentedon Dec 6, 2021
As an immediate response before looking into the technical details:
@podiki or @kisak-valve: Please change the title of this issue to make it obvious that it is on Guix. "Steam Linux Runtime on Guix does not find driver dependencies" would probably be a good title.
pressure-vessel is very sensitive to the exact "shape" of non-FHS distributions like NixOS and Guix, and I would not expect it to work unmodified. We added some code to pressure-vessel specifically to support NixOS, and we will probably need to do the same for Guix. If a Guix user will test it for me (by replacing
SteamLinuxRuntime_soldier/pressure-vesselwith an unofficial build that I can provide), then I expect we can probably find a solution and include that in future official builds.smcv commentedon Dec 6, 2021
You've jumped straight in to very specific details from the various logs, but you're not giving me an overview of the bigger picture. Please could you provide the information from the issue reporting template, in particular the Steam system information (Help -> System Information) and the
slr-log file?It might be that you are correct about the failure mode, but to solve it we will probably need to "zoom out" and look at some more basic facts about Guix.
smcv commentedon Dec 6, 2021
Yes there is -
git logsays my first committed prototype of pressure-vessel, which only worked on Debian, is 4 years old (but there were ad-hoc prototypes even before that), and it has grown a lot since then as we added support for other distributions.It is deliberate that we use that flag. For loadable modules that do not normally appear in the default search path for libraries (and in particular Mesa DRI drivers), we need to run capsule-capture-libs twice: once with
no-dependencies, and once withonly-dependencies. Between them, they collect everything we need for the loadable module, but they have different target directories.This is because if
radeonsi_dri.sodepends onlibLLVMCoroutines.so, we wantradeonsi_dri.soto end up in theLIBGL_DRIVERS_PATHand not the default search path for libraries (in practice it goes to/usr/lib/pressure-vessel/overrides/${tuple}/driinside the container, where${tuple}is eitheri386-linux-gnuorx86_64-linux-gnu); but we do wantlibLLVMCoroutines.soto end up in the default search path for libraries (in practice/usr/lib/pressure-vessel/overrides/${tuple}) so thatld.sowill find it.If you had attached a whole log instead of selecting the parts you thought were most relevant, we'd be able to see the second invocation (with
only-dependencies) in the log, and then we'd be able to see whether this was working correctly or not.Most of the commands in the log are not running (and not necessarily even runnable!) in the container created by pressure-vessel, because they are gathering information that we will need before we can create our container. The log does tell you when it hands over to the
bwrapprocess that will set up the actual container (Replacing self with %s...), but there's a lot of (necessary!) noise before we get to that point.It's extra-confusing on NixOS and Guix, because on a typical FHS-ish distribution like Debian or Fedora, we only have one layer of containers:
but on NixOS, and presumably Guix too, there's an additional layer of container to turn it into a more FHS-shaped environment that will not break all our assumptions:
smcv commentedon Dec 6, 2021
Here are some things that are unusual about NixOS, and will probably be equally unusual about Guix:
Shared libraries are physically located in
/nix/storeor/gnu/store, and have a very longDT_RUNPATHpointing into that hierarchy. You have worked around this withPRESSURE_VESSEL_FILESYSTEMS_RO=/gnu/store. I assume it be appropriate for pressure-vessel to always share that part of the filesystem read-only with the container if it exists, like it already does for NixOS?For NixOS' benefit, we automatically share all of
/nixwith the container (not just/nix/store). What else is in/gnuon Guix, other than/gnu/store? Should we be sharing all of/gnuif it exists, or just/gnu/store, or/gnu/storeand a finite number of other directories?In upstream glibc and in most FHS distributions, glibc is configured so that
ld.soreads/etc/ld.so.cacheto find shared libraries. We have special cases for Clear Linux and Exherbo, which use different paths. What path does Guix' glibc read? Does the closer-to-FHS container that is used to run Steam ensure that the ld.so cache exists and has been populated with shared libraries - at least the ones required by Steam, GL drivers, and pressure-vessel?DT_RPATHandDT_RUNPATHfor specific, named libraries, but we cannot do that for patterns likelibGLX_*.so.0.ld.soreads/etc/ld.so.cache, which intentionally does not exist in a "pure" NixOS environment, but does exist in the closer-to-FHS container that is used to run Steam.You wrote: "Steam is launched in a container that mimics a typical FHS setup (similar to how Nix does it) creating all the usual folders in a (Guix, not bwrap) container". What container technology is used to launch the environment that Steam runs in? I know that NixOS uses (or used to use?) bubblewrap for that.
smcv commentedon Dec 6, 2021
In addition to all the other information I've asked for, it would probably be useful if you could show me a file listing (
find . -lsor similar) for the/gnu/store/*-llvm-*installation directory of each of the modes you tried when building LLVM, identifying which one is the working configuration and which one does not work. There are several different ways to build LLVM and link it into Mesa, and it's not always obvious which one people are referring to, so a file list is the easiest way to make it obvious. The layout I'm most familiar with is the one used in Debian, where dynamic linking uses a single large shared librarylibLLVM-13.so.1, but static linking uses multiple smaller static libraries such as/usr/lib/llvm-13/lib/libLLVMCoroutines.a.Ideally, I want pressure-vessel to "just work" by default on as many OSs as possible, and not need local workarounds - but for more-rarely-used OSs like NixOS and Guix, I have to depend on users of those OSs to provide the information that is needed to make that possible.
FHS and nearly-FHS distros like Debian, Fedora, Arch, or even Exherbo can usually be made to work as-is, with pressure-vessel responding to what the distro does rather than the other way round. Non-FHS distros like NixOS and Guix are just too unusual for that approach to work (and Steam won't work there anyway), so it's pragmatic for those distros to provide a closer-to-FHS container to run Steam in, which lets me concentrate on making pressure-vessel work as intended in that closer-to-FHS container instead of trying to make it work on the unmodified host system.
In particular, distros where users are expected to compile libraries from source for themselves (as opposed to binary-package-based distros like Debian and Fedora) are disproportionately "expensive" to test in a centralized way - it would take too much disk space and CPU time to bring up test systems with multiple source-based distros and keep them up to date - so we're reliant on users of these distros to bring issues to our attention.
Similarly, if things don't work in a distro that aims to be highly customizable, we are unlikely to be able to reproduce the exact customizations that a particular user has made.
[-]Capturing some Mesa DRI drivers (like radeonsi_dri.so) fails to place it in overrides[/-][+]Steam Linux Runtime on Guix does not find driver dependencies[/+]podiki commentedon Dec 6, 2021
Hi @smcv! And thanks for looking into this, much appreciated. Apologies for a flurry of messages as I sort of talked to myself in trying to debug without giving you the big picture.
Long reponse here to the points you raised. I've linked a log of the failure case and will provide more logs and info you requested in a later follow-up. Thanks!
Thanks and I would be happy to help test any fixes. I think the NixOS changes are generally helpful on the Guix side as they share very similar overall structure.
I should note that I can provide a few files and easy directions for reproducing the same environment in either a VM or on top of a regular distro, which will remain isolated.
I will add that in a followup (not at that computer until later, though I do have some of the logs). I'll give the System Information and
slr-log file for both the configuration that fails and one that succeeds, with just minimal changes.This is helpful, thank you. I think what I ran into that was most confusing and led me astray in my earlier isssue report was that I didn't have the right debug flags to see the details of the different
capture-libscalls. Only later when I turned on the fuller debug messages did I start better seeing what was happening, which now makes better sense with what you've said.Here is a log where capturing fails with the
libLLVMpieces. It does seem to look in the right place (all the libs were copied to thefhsdirectories) but yet does not load it. LogI'll provide the System Information and other info for this scenario when I'm at the original computer, with a fresh log just in case too.
Indeed, there's a lot of layers here! Containers within containers (as I understand it, what made Flatpak Steam tricky too).
Yes, that would be great. Perhaps pressure-vessel can have a list of such "stores" that should be read-only mounted.
(Aside: I don't think there should be any difficulty if you have Guix (or Nix) as an additional package manager on top of another distro, as everything is only located in the store or linked to it. So it is self-contained in a way, and running something from Guix should stay within Guix. The possible exception is maybe graphics drivers or other things like that where you need the actual real host version? I'm not sure, and that is extra confusion. I just tested running Steam from Guix on top of Arch and it worked, seemed to only use the Guix libraries including Mesa. But that is for another time.)
As far as I know there is only
/gnu/store. If I find out otherwise I'll let you know, but everything should just live in/gnu/store.Yes, this is a sticking point. By default Guix's
glibchas disabled theld.so.cachereading (for one, don't to get mixed up when on another distro). But, Guix is moving (as in any day now, but I'm using it already) to using aglibcthat readsetc/ld.so.cachefrom within the store of the binary. In other words,/gnu/store/<hash>-program/bin/progwill be able to use/gnu/store/<hash>-program/etc/ld.so.cache. This is described in this blog post or specifically this glibc patch.I've been trying to make this work for us (you can see the discussion at this issue on nonguix, where Nonguix is because Steam is non-free and GNU Guix is a free software distribution). I don't know much in this arena, but my efforts came up empty so far, just not sure that something like
LD_ORIGIN_PATHcan work to get Guix'sglibcto read theld.so.cachesomewhere else when we need it, even making it look like/gnu/store/....So what I'm doing now is reverting to an earlier version of the FHS container we had, where we have a more vanilla
glibcthat reads/etc/ld.so.cachelike in a regular distro. I've made sure to generate this cache in the container for the libraries included in the container, e.g. Mesa, LLVM, and so on.This (reliance on the cache) might be why my efforts for tricking Guix's standard
glibcdidn't get far either. Maybe there is a way around this, but seems complicated to keep it straight and make it work, unless I'm missing something easy to do?Similar to what I/we've done here too. Besides there not being
/etc/ld.so.cachein Guix System, being in a container means we can allow access or not anyway.I believe it is "Guix container technology," so just Guile code. I think this code is where most of it lives. In any event, the same idea of controlling what directores are exposed, environment variables, a separate profile of available libraries and programs, etc.
I'll provide this later from the original computer to be sure. The configuration options in LLVM from Guix's standard (see here) are changing
-DBUILD_SHARED_LIBS:BOOL=TRUEto-DLLVM_BUILD_LLVM_DYLIB=ONand-DLLVM_LINK_LLVM_DYLIB=ON.I understand and agree on the approach. An FHS container is handy for Guix to have for exactly these reasons, and I think having it mimic as close to possible something like Arch or Ubuntu makes a lot of sense on both sides.
I understand, but let me also say that we provide binary substitutes with Guix (and now Nonguix packages) and focus on reproducibility. Which actually makes this, I would say, a very good testing system since you can easily depoly the same environment repeatedly and on different hardware (or VM images). Guix is certainly not big enough or the ideal target here (as one that follows free software guidelines), but did want to mention that. It is fun technology.
Thanks again for all your time on this, I've learned a lot about how this works! I'll provide some more logs and happy to test any development builds or provide info for reproducibility.
podiki commentedon Dec 7, 2021
I ran Steam with
STEAM_LINUX_RUNTIME_LOG=1 CAPSULE_DEBUG=tool,search LIBGL_DEBUG=verbose G_MESSAGES_DEBUG=1 PRESSURE_VESSEL_VERBOSE=1 STEAM_LINUX_RUNTIME_VERBOSE=1and captured the logs.Here are the logs and
find . -lsin the/gnu/store/...llvm-...(64bit) for the working configuration (stderr/out log, system information, slr- logs) where I opened Steam, ran System Information, and then launched a game (Ape Out) successfully, and closed it.And here is the same logs for the non-working configuration. My test game (Ape Out) was just hanging it seemed like, so I also tried to run Hades (which gave an error). I can redo this in a different way if it didn't capture what you want. I wasn't sure if the log option had changed something, so I ran without it as I had before: this log shows the output.
The difference is noted in the previous comment, where the working configuration has LLVM with the dylib option configured (and Mesa built against that LLVM) and the non-working is original (no dylib but
BUILD_SHARED_LIBSinstead) LLVM with Mesa built against that.(I'm aware there are some other errors popping up; still working on the container and packaging but that's for later.)
smcv commentedon Dec 7, 2021
Sorry, that is definitely not going to work for us, because when you run a game (or Proton) in the Steam Linux Runtime environment, the executable you're using comes from the game (or Proton or pressure-vessel or the Steam Linux Runtime) - but to use your graphics drivers from the host system, we will usually also need to use your glibc.
We also cannot work around this by overriding
LD_ORIGIN_PATH, because Proton or a native Linux game might include libraries that need to be located relative to the real${ORIGIN}of the executable, and overridingLD_ORIGIN_PATHwould break that.If Guix is patching glibc anyway, would it be possible to make it try a constant (hard-coded) path such as
/gnu/guix-ld.so.cachefirst? And even if that path doesn't exist on the host system, we could still create it in the pressure-vessel container (as a symlink to the one we generate during container startup).Or the patched glibc could look at a Guix-specific environment variable, perhaps something like
GUIX_LD_SO_CACHE, before falling back to loading it based on${ORIGIN}; and we could set that variable during container startup?The only other option that I can see is for the closer-to-FHS environment that is used to run Steam to have its own build of glibc that has one of these configurations/patches, even if the normal glibc that is used to run other programs does not.
smcv commentedon Dec 7, 2021
In general, when getting this stuff working on an unusual distro, it's best to use a native Linux game and configure it to use the "Steam Linux Runtime" compatibility tool. This removes a lot of complexity from the overall system by not needing to use Proton to emulate Windows, and lets you concentrate on the pressure-vessel parts that are distro-specific.
I used Floating Point for a lot of the early pressure-vessel development, because it's tiny and can run on weak hardware. When you have that working, the next step is something like TF2 (OpenGL) or Artifact (Vulkan), and then start trying Proton.
I'm sure, but if the choice is between spending time making Steam and pressure-vessel work better on mainstream distros like Debian/Fedora/Arch, or spending the same amount of time making it work better on Guix, I have to do the one that benefits more people, and that's the mainstream distros.
smcv commentedon Dec 7, 2021
I think we are going to need a working
ld.so.cacheto enumerate libraries. That's likely to be non-negotiable: some graphics drivers can't be found any other way. The way they do this in NixOS is to generate it while setting up their FHS container: I'd recommend that you do the same if you want the same level of functionality in Guix.Similarly, we need your glibc to read a
ld.so.cachethat we generate, via a symlink at some fixed path (so/gnu/guix-ld.so.cachewould be OK, but/gnu/store/<hash>-steam-blahblah/etc/ld.so.cachewould not be, because we can't know what the hash should be). That's also likely to be non-negotiable: we originally tried relying onLD_LIBRARY_PATH, but that causes problems for a significant number of games, so we are not going to go back to that.If your
ld.so.cacheis not in the usual location, we can read from any fixed location in your FHS container (which can be a symlink if you want), and we can create a symlink at (nearly) any fixed location pointing to the newld.so.cachethat we generate in our container (this is what we do for/etc/ld.so.cache, which is actually a symlink to a file we generate below/run). You could prototype this by using/var/cache/ldconfig/ld.so.cache, which happens to be the non-standard path that is used in Clear Linux (and we already have an appropriate special case for that one). When you have that working, we can add a special case for a different Guix-specific path if you would prefer, so that it will not collide with the system installation if Guix is installed on top of Clear Linux.Please try downloading https://gitlab.steamos.cloud/steamrt/steam-runtime-tools/-/jobs/69589/artifacts/raw/_build/production/pressure-vessel-bin.tar.gz, using it to replace your
steamapps/common/SteamLinuxRuntime_soldier/pressure-vessel, and running in one of the configurations that already works, but without usingPRESSURE_VESSEL_FILESYSTEMS_RO=/gnu/store.This is built from a branch which adds the same special cases for
/gnu/storethat we already had for/nix. Hopefully that will makePRESSURE_VESSEL_FILESYSTEMS_RO=/gnu/storeunnecessary, and also silence some of the warnings.smcv commentedon Dec 7, 2021
Some of your logs seem to be getting truncated by Github, and some of them seem to be 0 bytes long. It might help to attach them as attachments instead of uploading them as a Gist; or it might help to stop applying
CAPSULE_DEBUG=tool,search(which is very verbose), and only use that if we specifically need that information.I haven't yet looked into why
BUILD_SHARED_LIBSdoesn't work well for you. I'll try to do that if time permits, but this is more likely to succeed if you can make sure the logs that are attached are complete. Note that mainstream distros like Debian and Arch generally use-DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON, which produces one biglibLLVM-X.so.Y; if Guix is doing this differently, it would be helpful to know why Guix has chosen to do that.The
ld.so.cachethings are likely to need to be resolved (or at least worked around) from the Guix side in any case before this can become fully-working.smcv commentedon Dec 7, 2021
We sort of do, but it's in code rather than data. We'll probably make it iterate through an array if a third one is needed (Nix, Guix and some third thing).
podiki commentedon Dec 7, 2021
I'll respond to your questions and get the complete logs to you in a later comment, but I wanted to make sure the lede didn't get buried earlier: Steam and Proton do work on Guix for me.
This is with the changes of:
glibcin the FHS container, with anld.so.cachefor the included libraries (not modifyingLD_LIBRARY_PATHat all)DYLIBflags you noted) and building Mesa against that LLVMPRESSURE_VESSEL_FILESYSTEMS_RO=/gnu/storeoption (will try your modified runtime build next)From what you say looks like the separate
glibcfor FHS will be needed for the time being and the issue we're examining is pressure-vessel and library capturing of LLVM when it is not compiled withDYLIB. And yes, I should test a native game (I'll try Floating Point) and make sure the basics are working, but wanted to make sure it is clear I can install and play something like Hades with my current changes.podiki commentedon Dec 7, 2021
Sorry about the logs, somehow completely missed the attaching option here.
These are the logs from the working version (LLVM with
DYLIBconfiguration):And these from the non-working version (LLVM with
SHARED_LIBS):podiki commentedon Dec 7, 2021
On the ld cache issue: I don't see Guix changing this without some good reason, though maybe they could provide an official variant that use the normal
/etc/ld.so.cacheas it could be useful for software that really needs FHS. Something to consider long term.However, it is just a one-line change to also make have a
glibcthat is just in the container that has normal ld cache reading, which is what I've done. I also generate the ld cache upon container creation, with all the libraries we provide in there, like Mesa. It would be easy enough to provide thisglibcin upstream Guix, but not sure they would want it, and Guix makes it very easy to have variant packages used in isolation. So for now I think that's what we'll use, meaning no changes needed on pressure-vessel's side as the Guix container will provide a standardglibcand/etc/ld.so.cachealready setup.podiki commentedon Dec 7, 2021
I ran with the pressure-vessel build you linked earlier. While some warnings did go away (in the System Information no more warnings like
"libGL: Can't open configuration file /home/john/.drirc: No such file or directory.), running a game (I tried Hades) did not. The last line is the same error I've seen before (in the final handoff to the runtime environment?):bwrap: execvp /usr/lib/pressure-vessel/from-host/bin/pressure-vessel-adverb: No such file or directory.Here is the System Information output: working-config-2.txt
And the log (only ran with
STEAM_LINUX_RUNTIME_LOG=1, but can re-run with whatever options you needed): slr-app1145360-t20211207T213653.log(If I reran with the same runtime you linked but still adding the
PRESSURE_VESSEL_FILESYSTEMS_RO=/gnu/storeoption, the game again loaded fine.)EDIT: Floating Point works with your runtime and the original version (both without the additional
FILESYSTEMSoption) but not Hades (guessing the Proton factor).smcv commentedon Dec 8, 2021
This usually means your
ld.sodidn't make it into the container. Are you sure you ran the correct version of pressure-vessel? Your log says you are running version 0.20211027.0, which is the production version distributed through the Steam CDN, and does not have the change that I wanted you to try. Your log also says"gnu/store/<blahblahblah>" is unlikely to appear in "/run/host", which indicates that it probably does not have the new changes.We "promoted" the beta version of "Steam Linux Runtime - soldier" to stable status recently, so perhaps your Steam client picked up that update and overwrote the modified
pressure-vessel/with the (new) production version?The way to use a modified
pressure-vessel-bin.tar.gzis to remove or renamesteamapps/common/SteamLinuxRuntime_soldier/pressure-vessel, then unpackpressure-vessel-bin.tar.gzso that it provides a newsteamapps/common/SteamLinuxRuntime_soldier/pressure-vesselwith files likesteamapps/common/SteamLinuxRuntime_soldier/pressure-vessel/bin/pressure-vessel-wrap. You should be able to runsteamapps/common/SteamLinuxRuntime_soldier/pressure-vessel/bin/pressure-vessel-wrap --versionand, if you are using the test-build I linked above, it will say this:The two configurations that I would expect to work are:
PRESSURE_VESSEL_FILESYSTEMS_RO=/gnu/storeworkaroundPRESSURE_VESSEL_FILESYSTEMS_RO=/gnu/storeworkaround is not requiredRunning the production version of pressure-vessel on Guix, without the
PRESSURE_VESSEL_FILESYSTEMS_ROworkaround, is expected to fail. That's normal: the changes that will make that workaround unnecessary are not merged yet, and I don't intend to merge them until a Guix user confirms that they work.After testing a special build of pressure-vessel, you can get back to the production version with: right-click on
Steam Linux Runtime - soldier->Properties...->Local files->Verify integrity of tool files..., or by downloading an official build from https://repo.steampowered.com/pressure-vessel/snapshots/.You can find the version number of the production version that Steam is currently shipping by looking at
steamapps/common/SteamLinuxRuntime_soldier/VERSIONS.txt. As of today, the stable and beta branches ofSteam Linux Runtime - soldierboth have version 0.20211027.0, but the beta branch will probably update to 0.20211207.0 sometime this week.In case I didn't make it clear enough: if you just install a native Linux game like Floating Point and run it, it runs with the traditional
LD_LIBRARY_PATH-based runtime, which does not involve pressure-vessel.To test pressure-vessel with native Linux games, you have to use: right-click on game ->
Properties...->Compatibility->Force the use of a specific Steam Play compatibility tool, then chooseSteam Linux Runtimefrom the list. If you do that, and also set the appropriate environment variables when starting Steam, then it will produce a log inSteamLinuxRuntime_soldier/var/slr-<something>.logjust like Proton games do.If you have one configuration that works and one configuration that doesn't, it's useful if you can share the two logs for comparison.
OK, that seems like a pragmatic approach, and I think it's similar to how this already works on NixOS.
smcv commentedon Dec 8, 2021
Hmm, this seems wrong:
And in your
findoutput, you only have./lib/libLLVMAMDGPUDisassembler.so.9. Are you sure your non-working Mesa build is linked to the LLVM build that you think it's using? And are you sure its required LLVM build is still present?Compare with the working build, which successfully finds its LLVM libraries (in this case one big library rather than a lot of little libraries):
podiki commentedon Dec 8, 2021
You are correct, the runtime you provided was overwritten, sorry I missed that. I've redone the test and it works as expected, no need for the
PRESSURE_VESSEL_FILESYSTEMS_ROflag. Great!System Information output: working-config-3.txt
Log of running Hades (default DirectX mode), no more "unlikely to appear" messages: slr-app1145360-t20211208T210238.log
podiki commentedon Dec 8, 2021
Wow. One of those classic, can't believe I didn't see it earlier obvious mistakes:
The answer to this weird LLVM lib problem was right there in front of us (really me, I should have seen this): if you'll take a look at the top line of the
findoutput you can see what directory I was running it in, that is the actual LLVM directory. The working one is/gnu/store/<hash>-llvm-for-fhs-11.0.0and the non-working one/gnu/store/<hash>-llvm-9.0.1, the last number being the LLVM version! When I rebuilt LLVM (that's the "for-fhs" label) I knew I needed LLVM 11 since Guix's Mesa is built with that, yet somehow didn't see that the non-working configuration had the wrong version LLVM libraries in the Guix FHS container until you pointed it out.(In case anyone cares about the details: Guix by default will install the most recent version of a package available, so
guix install llvmright now gives you LLVM 12. But in making packages we often have versions of things set to something (for compatibility, to prevent rebuilding everything when new versions come out, etc.). As you can guess, in writing packages writingllvmis defined as LLVM version 9. And I knew this, since I was looking right at Mesa which clearly usesllvm-11to specify version 11 of LLVM. facepalm)Sorry about all that! And sorry to myself for all this running around.
I can confirm using the proper
llvm-11in the FHS container has everything work. The problem was on my end all along, a few keystrokes error. I can provide whatever logs you may want if you are curious, but spotting that trailing.so.9was all it really was.For me this closes the original issue of driver loading in pressure-vessel on Guix. The problem in general was providing all the libraries needed to load graphics drivers, in this case LLVM for Mesa, where of course you need to match the right version. Let me summarize where we are overall with pressure-vessel on Guix:
PRESSURE_VESSEL_FILESYSTEMS_ROflag or the test build you provided (besides warnings appearing or not, they are equivalent in the end?).glibcwhich reads a cache from a/gnu/store/<hash>-package/etc/ld.so.cachelocation. AnLD_ORIGIN_PATHoverride or trickery is not enough or would require some deep changes.glibcin the FHS container for Steam.With this, Steam and pressure-vessel (and Proton) work in my testing. There may be other bugs I need to find and fix (running into a
steamwebhelperproblem that is reported elsewhere), but I'm past the GPU driver loading error and overall it works. Thanks again for your patience and seeing this through. I learned (and re-learned!) a lot and will hopefully be better equiped now for any future Guix & pressure-vessel debugging.smcv commentedon Dec 9, 2021
Now that you've confirmed that the test-build helps, I'll get that change merged soon. Expect to see it in a future beta of
SteamLinuxRuntime_soldier, probably early next year at this point.Yes. Half of the change I asked you to test is effectively the same as
PRESSURE_VESSEL_FILESYSTEMS_RO=/gnu/store(but done automatically, allowing that variable to be used independently for other workarounds if needed), and the other half just silences the warnings by acknowledging that/gnu/storeis now something that we are going to share with the host.podiki commentedon Dec 14, 2021
With the change for the filesystem mounting coming from upsteam, this issue is closed for me. But if it is better to keep it open until a beta comes out that has the change, feel free to leave it open.
Thanks again for navigating this with me and making the change!
podiki commentedon Dec 17, 2021
I see this was merged upstream, so I'll go ahead and close this. If this should remain open until an actual beta or stable release is out, feel free to reopen this until then, @kisak-valve.
smcv commentedon Jan 20, 2022
This change has gone out in
SteamLinuxRuntime_soldierbuild 0.20220120.41, which is currently on theclient_betabranch ofSteamLinuxRuntime_soldier(you can opt in to using this beta, it is not used by default). If you have the fixed version, you will seepressure-vessel 0.20220107.0or later inSteamLinuxRuntime_soldier/VERSIONS.txt.It is likely to be "promoted" into the stable releases that are used by default at some point in the future.