Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Steam Linux Runtime on Guix does not find driver dependencies #478

Closed
podiki opened this issue Dec 4, 2021 · 27 comments
Closed

Steam Linux Runtime on Guix does not find driver dependencies #478

podiki opened this issue Dec 4, 2021 · 27 comments

Comments

@podiki
Copy link

podiki commented Dec 4, 2021

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.

@podiki
Copy link
Author

podiki commented 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=instead option). Looks like capture will fail silently (no output) with some options, I think the if-exists part? Removing some options eventually I hit an output: it was failing to load some LLVM libraries, like libLLVMCoroutines.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 like libLLVM-11.so rather than linking Mesa against the individual ones. But I'm not sure why pressure vessel doesn't pull them in via references (ldd shows 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
Copy link
Author

podiki commented Dec 5, 2021

(Apologies for any spam, but hoping the process is helpful for others as well.)

Building LLVM with DYLIB to have a single libLLVM-11.so for Mesa linking did not help. Digging further, I'm really not sure what is going on, Steam can load the DRI radeonsi_dri.so fine 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-libs no-dependencies flag? 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 in libLLVM like in other overrides, e.g. libstdc++.so.6).

Adding the flag CAPSULE_DEBUG=tool,search (thanks #305) shows explicitly that it knows to load libLLVM and finds it, e.g. on Steam startup:

pressure-vessel-wrap[420]: I: Capturing loadable module: /gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-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-WHFKD1' '--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-WHFKD1/usr/lib/steamrt/libcapsule-knowledge.keyfile' '--dest' '/home/john/.local/share/Steam/steamapps/common/SteamLinuxRuntime_soldier/var/tmp-WHFKD1/usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/dri' 'no-dependencies:even-if-older:if-exists:if-same-abi:path:/gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/dri/radeonsi_dri.so'
capsule debug flags: 
  path    : n # path manipulation and translation
  search  : Y # searching for DSOs
  ldcache : n # loading/processing the ld cache
  capsule : n # setting up the proxy capsule
  mprotect: n # handling mprotect (for RELRO)
  wrappers: n # function wrappers installed in the capsule
  reloc   : n # patching capsule symbols into external DSOs
  dlfunc  : n # special handling of dlopen/dlsym calls
  elf     : n # detailed ELF introspection logging
  tool    : Y # command-line tools
library_knowledge_load_from_stream:Loaded library knowledge from "/home/john/.local/share/Steam/steamapps/common/SteamLinuxRuntime_soldier/var/tmp-WHFKD1/usr/lib/steamrt/libcapsule-knowledge.keyfile"
capture_pattern:no-dependencies:even-if-older:if-exists:if-same-abi:path:/gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/dri/radeonsi_dri.so
capture_pattern:even-if-older:if-exists:if-same-abi:path:/gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/dri/radeonsi_dri.so
capture_pattern:if-exists:if-same-abi:path:/gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/dri/radeonsi_dri.so
capture_pattern:if-same-abi:path:/gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/dri/radeonsi_dri.so
capture_pattern:path:/gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/dri/radeonsi_dri.so
stat_caller:initial libcapsule user is /gnu/store/hnwqyjyg4v91pdflg41dri27lv4xrwcr-fhs-union-64-0.0/lib/libc.so.6
stat_caller:  ? which is not a capsule: disabling loop protection
find_elf_constraints:elf class: 2; elf machine: 62; set from: /gnu/store/hnwqyjyg4v91pdflg41dri27lv4xrwcr-fhs-union-64-0.0/lib/libdl.so.2
dso_find:absolute path to DSO /gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/dri/radeonsi_dri.so
dso_find:resolving path /gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/dri/radeonsi_dri.so
ld_lib_open:ldlib_open: target -: /gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/dri/iris_dri.so
ld_lib_open:ldlib_open: target +: /gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/dri/iris_dri.so
ld_lib_open:[000] /gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/dri/iris_dri.so on fd #12; elf: 0x1d61e00; acceptable: 1
dso_find:target DSO is libglapi.so.0
search_ldpath:searching for libglapi.so.0 in /gnu/store/hnwqyjyg4v91pdflg41dri27lv4xrwcr-fhs-union-64-0.0/lib:/gnu/store/366pc88q085xcnavcrjz1h1bapygnmgs-fhs-union-32-0.0/lib:/gnu/store/jawarkca8jl3japfz6j00ps5wvwhdb91-glibc-for-fhs-2.33/lib:/home/john/.local/share/Steam/steamapps/common/Regency Solitaire (prefix: /)
search_ldpath:  searchpath element: /gnu/store/hnwqyjyg4v91pdflg41dri27lv4xrwcr-fhs-union-64-0.0/lib
search_ldpath:examining /gnu/store/hnwqyjyg4v91pdflg41dri27lv4xrwcr-fhs-union-64-0.0/lib/libglapi.so.0
ld_lib_open:ldlib_open: target -: /gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/libglapi.so.0.0.0
ld_lib_open:ldlib_open: target +: /gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/libglapi.so.0.0.0
ld_lib_open:[001] /gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/libglapi.so.0.0.0 on fd #13; elf: 0x1d636d0; acceptable: 1
<...>
dso_find:target DSO is libLLVM-11.so
search_ldpath:searching for libLLVM-11.so in /gnu/store/hnwqyjyg4v91pdflg41dri27lv4xrwcr-fhs-union-64-0.0/lib:/gnu/store/366pc88q085xcnavcrjz1h1bapygnmgs-fhs-union-32-0.0/lib:/gnu/store/jawarkca8jl3japfz6j00ps5wvwhdb91-glibc-for-fhs-2.33/lib:/home/john/.local/share/Steam/steamapps/common/Regency Solitaire (prefix: /)
search_ldpath:  searchpath element: /gnu/store/hnwqyjyg4v91pdflg41dri27lv4xrwcr-fhs-union-64-0.0/lib
search_ldpath:examining /gnu/store/hnwqyjyg4v91pdflg41dri27lv4xrwcr-fhs-union-64-0.0/lib/libLLVM-11.so
ld_lib_open:ldlib_open: target -: /gnu/store/x9l12rzjz87lbr635kb5gni1y7vik7ai-llvm-for-fhs-11.0.0/lib/libLLVM-11.so
ld_lib_open:ldlib_open: target +: /gnu/store/x9l12rzjz87lbr635kb5gni1y7vik7ai-llvm-for-fhs-11.0.0/lib/libLLVM-11.so
ld_lib_open:[005] /gnu/store/x9l12rzjz87lbr635kb5gni1y7vik7ai-llvm-for-fhs-11.0.0/lib/libLLVM-11.so on fd #18; elf: 0x1d6abf0; acceptable: 1
dso_find:target DSO is libffi.so.7
<...>

But in launching with an xterm in the environment and running the command from the log won't find libLLVM as it is not in the overrides or /lib or /usr/lib

(steamrt soldier 0.20211013.0)john@narya:~/.local/share/Steam/steamapps/common/Regency Solitaire$ /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-LFBZD1 --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-LFBZD1/usr/lib/steamrt/libcapsule-knowledge.keyfile --dest /home/john/.local/share/Steam/steamapps/common/SteamLinuxRuntime_soldier/var/tmp-LFBZD1/usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/vulkan no-dependencies:even-if-older:if-exists:if-same-abi:path:/gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/dri/radeonsi_dri.so
capsule debug flags: 
  path    : n # path manipulation and translation
  search  : Y # searching for DSOs
  ldcache : n # loading/processing the ld cache
  capsule : n # setting up the proxy capsule
  mprotect: n # handling mprotect (for RELRO)
  wrappers: n # function wrappers installed in the capsule
  reloc   : n # patching capsule symbols into external DSOs
  dlfunc  : n # special handling of dlopen/dlsym calls
  elf     : n # detailed ELF introspection logging
  tool    : Y # command-line tools
library_knowledge_load_from_stream:Loaded library knowledge from "/home/john/.local/share/Steam/steamapps/common/SteamLinuxRuntime_soldier/var/tmp-LFBZD1/usr/lib/steamrt/libcapsule-knowledge.keyfile"
capture_pattern:no-dependencies:even-if-older:if-exists:if-same-abi:path:/gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/dri/radeonsi_dri.so
capture_pattern:even-if-older:if-exists:if-same-abi:path:/gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/dri/radeonsi_dri.so
capture_pattern:if-exists:if-same-abi:path:/gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/dri/radeonsi_dri.so
capture_pattern:if-same-abi:path:/gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/dri/radeonsi_dri.so
capture_pattern:path:/gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/dri/radeonsi_dri.so
stat_caller:initial libcapsule user is /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/libc.so.6
stat_caller:  ⦠which is not a capsule: disabling loop protection
find_elf_constraints:elf class: 2; elf machine: 62; set from: /tmp/pressure-vessel-libs-5M2HD1/x86_64/gameoverlayrenderer.so
dso_find:absolute path to DSO /gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/dri/radeonsi_dri.so
dso_find:resolving path /gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/dri/radeonsi_dri.so
ld_lib_open:ldlib_open: target -: /gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/dri/iris_dri.so
ld_lib_open:ldlib_open: target +: /gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/dri/iris_dri.so
ld_lib_open:[000] /gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/dri/iris_dri.so on fd #5; elf: 0x1ac0a30; acceptable: 1
dso_find:target DSO is libglapi.so.0
search_ldpath:searching for libglapi.so.0 in /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/aliases:/usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/aliases (prefix: /)
search_ldpath:  searchpath element: /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/aliases
search_ldpath:examining /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/aliases/libglapi.so.0
search_ldpath:  searchpath element: /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/aliases
search_ldpath:examining /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/aliases/libglapi.so.0
search_ldcache_cb:checking libglapi.so.0 vs libglapi.so.0 [/usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/libglapi.so.0]
ld_lib_open:ldlib_open: target -: /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/libglapi.so.0
ld_lib_open:ldlib_open: target +: /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/libglapi.so.0
ld_lib_open:[001] /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/libglapi.so.0 on fd #11; elf: 0x1ac2300; acceptable: 1
dso_find:target DSO is libpthread.so.0
search_ldpath:searching for libpthread.so.0 in /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/aliases:/usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/aliases (prefix: /)
search_ldpath:  searchpath element: /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/aliases
search_ldpath:examining /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/aliases/libpthread.so.0
search_ldpath:  searchpath element: /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/aliases
search_ldpath:examining /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/aliases/libpthread.so.0
search_ldcache_cb:checking libpthread.so.0 vs libpthread.so.0 [/usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/libpthread.so.0]
ld_lib_open:ldlib_open: target -: /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/libpthread.so.0
ld_lib_open:ldlib_open: target +: /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/libpthread.so.0
ld_lib_open:[002] /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/libpthread.so.0 on fd #12; elf: 0x1ac3b10; acceptable: 1
dso_find:target DSO is libc.so.6
search_ldpath:searching for libc.so.6 in /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/aliases:/usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/aliases (prefix: /)
search_ldpath:  searchpath element: /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/aliases
search_ldpath:examining /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/aliases/libc.so.6
search_ldpath:  searchpath element: /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/aliases
search_ldpath:examining /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/aliases/libc.so.6
search_ldcache_cb:checking libc.so.6 vs libc.so.6 [/usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/libc.so.6]
ld_lib_open:ldlib_open: target -: /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/libc.so.6
ld_lib_open:ldlib_open: target +: /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/libc.so.6
ld_lib_open:[003] /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/libc.so.6 on fd #13; elf: 0x1ac5490; acceptable: 1
dso_find:target DSO is libdrm.so.2
search_ldpath:searching for libdrm.so.2 in /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/aliases:/usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/aliases (prefix: /)
search_ldpath:  searchpath element: /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/aliases
search_ldpath:examining /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/aliases/libdrm.so.2
search_ldpath:  searchpath element: /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/aliases
search_ldpath:examining /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/aliases/libdrm.so.2
search_ldcache_cb:checking libdrm.so.2 vs libdrm.so.2 [/usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/libdrm.so.2]
ld_lib_open:ldlib_open: target -: /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/libdrm.so.2
ld_lib_open:ldlib_open: target +: /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/libdrm.so.2
ld_lib_open:[004] /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/libdrm.so.2 on fd #14; elf: 0x1ac8180; acceptable: 1
dso_find:target DSO is libLLVM-11.so
search_ldpath:searching for libLLVM-11.so in /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/aliases:/usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/aliases (prefix: /)
search_ldpath:  searchpath element: /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/aliases
search_ldpath:examining /usr/lib/pressure-vessel/overrides/lib/x86_64-linux-gnu/aliases/libLLVM-11.so
search_ldpath:  searchpath element: /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/aliases
search_ldpath:examining /usr/lib/pressure-vessel/overrides/lib/i386-linux-gnu/aliases/libLLVM-11.so
search_ldpath:searching for libLLVM-11.so in /lib:/usr/lib (prefix: /)
search_ldpath:  searchpath element: /lib
search_ldpath:examining /lib/libLLVM-11.so
search_ldpath:  searchpath element: /usr/lib
search_ldpath:examining /usr/lib/libLLVM-11.so
capture_one:Some of the dependencies for /gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/dri/radeonsi_dri.so have not been found, ignoring

while it still exists from the host, e.g.

 ls /run/host/lib64/libLLVM-11.so -la
lrwxrwxrwx 1 65534 overflow 81 Jan  1  1970 /run/host/lib64/libLLVM-11.so -> /gnu/store/x9l12rzjz87lbr635kb5gni1y7vik7ai-llvm-for-fhs-11.0.0/lib/libLLVM-11.so

So the search is only within the container and not from host at this stage, but just to confirm that this is still accessible:

 ls -lah /gnu/store/x9l12rzjz87lbr635kb5gni1y7vik7ai-llvm-for-fhs-11.0.0/lib/libLLVM-11.so
-r-xr-xr-x 2 65534 overflow 99M Jan  1  1970 /gnu/store/x9l12rzjz87lbr635kb5gni1y7vik7ai-llvm-for-fhs-11.0.0/lib/libLLVM-11.so

The first part of an objdump -T -x of this radeonsi_dri.so

/gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/dri/radeonsi_dri.so:     file format elf64-x86-64
/gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib/dri/radeonsi_dri.so
architecture: i386:x86-64, flags 0x00000150:
HAS_SYMS, DYNAMIC, D_PAGED
start address 0x0000000000192bb0

Program Header:
    LOAD off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**12
         filesz 0x000000000018f7a0 memsz 0x000000000018f7a0 flags r--
    LOAD off    0x0000000000190000 vaddr 0x0000000000190000 paddr 0x0000000000190000 align 2**12
         filesz 0x0000000001552709 memsz 0x0000000001552709 flags r-x
    LOAD off    0x00000000016e3000 vaddr 0x00000000016e3000 paddr 0x00000000016e3000 align 2**12
         filesz 0x00000000004c0441 memsz 0x00000000004c0441 flags r--
    LOAD off    0x0000000001ba3fb0 vaddr 0x0000000001ba4fb0 paddr 0x0000000001ba4fb0 align 2**12
         filesz 0x0000000000250800 memsz 0x000000000046e038 flags rw-
 DYNAMIC off    0x0000000001cbd1f8 vaddr 0x0000000001cbe1f8 paddr 0x0000000001cbe1f8 align 2**3
         filesz 0x00000000000002f0 memsz 0x00000000000002f0 flags rw-
    NOTE off    0x00000000000002e0 vaddr 0x00000000000002e0 paddr 0x00000000000002e0 align 2**3
         filesz 0x0000000000000030 memsz 0x0000000000000030 flags r--
    NOTE off    0x0000000000000310 vaddr 0x0000000000000310 paddr 0x0000000000000310 align 2**2
         filesz 0x0000000000000024 memsz 0x0000000000000024 flags r--
     TLS off    0x0000000001ba3fb0 vaddr 0x0000000001ba4fb0 paddr 0x0000000001ba4fb0 align 2**3
         filesz 0x0000000000000000 memsz 0x000000000000069c flags r--
0x6474e553 off    0x00000000000002e0 vaddr 0x00000000000002e0 paddr 0x00000000000002e0 align 2**3
         filesz 0x0000000000000030 memsz 0x0000000000000030 flags r--
EH_FRAME off    0x00000000019cd3dc vaddr 0x00000000019cd3dc paddr 0x00000000019cd3dc align 2**2
         filesz 0x000000000003975c memsz 0x000000000003975c flags r--
   STACK off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**4
         filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw-
   RELRO off    0x0000000001ba3fb0 vaddr 0x0000000001ba4fb0 paddr 0x0000000001ba4fb0 align 2**0
         filesz 0x000000000011a050 memsz 0x000000000011a050 flags r--

Dynamic Section:
  NEEDED               libglapi.so.0
  NEEDED               libdrm.so.2
  NEEDED               libLLVM-11.so
  NEEDED               libexpat.so.1
  NEEDED               libz.so.1
  NEEDED               libdl.so.2
  NEEDED               libdrm_radeon.so.1
  NEEDED               libelf.so.1
  NEEDED               libdrm_amdgpu.so.1
  NEEDED               libdrm_nouveau.so.2
  NEEDED               libstdc++.so.6
  NEEDED               libm.so.6
  NEEDED               libgcc_s.so.1
  NEEDED               libpthread.so.0
  NEEDED               libc.so.6
  NEEDED               ld-linux-x86-64.so.2
  SONAME               libgallium_dri.so
  RUNPATH              /gnu/store/7ka6q940qh38sxqi5085nd53yj9avd90-mesa-for-fhs-21.2.5/lib:/gnu/store/2fk1gz2s7ppdicynscra9b19byrrr866-glibc-2.33/lib:/gnu/store/90lbavffg0csrf208nw0ayj1bz5knl47-gcc-10.3.0-lib/lib:/gnu/store/zfmf01fwy5gqk30hqms2n3wdbxz4ywi7-libdrm-2.4.107/lib:/gnu/store/x9l12rzjz87lbr635kb5gni1y7vik7ai-llvm-for-fhs-11.0.0/lib:/gnu/store/s0w7szfsajdy6cnrz2w7z4h5spyl4aaj-expat-2.4.1/lib:/gnu/store/2i0zpa5w320y8m4zbqk1va8vs6dbawv0-zlib-1.2.11/lib:/gnu/store/7pmbfp23v7apcya1y9g9hpg60lx7rzfq-elfutils-0.183/lib:/gnu/store/90lbavffg0csrf208nw0ayj1bz5knl47-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../..
  INIT                 0x0000000000190000
  FINI                 0x00000000016e2700
  INIT_ARRAY           0x0000000001ba4fb0
  INIT_ARRAYSZ         0x0000000000000248
  FINI_ARRAY           0x0000000001ba51f8
  FINI_ARRAYSZ         0x0000000000000008
  HASH                 0x0000000000000338
  GNU_HASH             0x0000000000001e90
  STRTAB               0x0000000000006628
  SYMTAB               0x0000000000001f48
  STRSZ                0x000000000000431f
  SYMENT               0x0000000000000018
  PLTGOT               0x0000000001cbf000
  PLTRELSZ             0x0000000000004110
  PLTREL               0x0000000000000007
  JMPREL               0x000000000018b690
  RELA                 0x000000000000b210
  RELASZ               0x0000000000180480
  RELAENT              0x0000000000000018
  FLAGS                0x0000000000000010
  VERNEED              0x000000000000af30
  VERNEEDNUM           0x0000000000000009
  VERSYM               0x000000000000a948
  RELACOUNT            0x000000000000fe19

Version References:
  required from ld-linux-x86-64.so.2:
    0x0d696913 0x00 32 GLIBC_2.3
  required from libgcc_s.so.1:
    0x0b792654 0x00 33 GCC_3.4
    0x0b792650 0x00 21 GCC_3.0
  required from libm.so.6:
    0x06969189 0x00 30 GLIBC_2.29
    0x06969187 0x00 25 GLIBC_2.27
    0x09691a75 0x00 12 GLIBC_2.2.5
  required from libstdc++.so.6:
    0x0297f868 0x00 37 GLIBCXX_3.4.18
    0x0bafd178 0x00 34 CXXABI_1.3.8
    0x0297f871 0x00 20 GLIBCXX_3.4.21
    0x02297f89 0x00 19 GLIBCXX_3.4.9
    0x0297f865 0x00 16 GLIBCXX_3.4.15
    0x0297f870 0x00 11 GLIBCXX_3.4.20
    0x056bafd3 0x00 10 CXXABI_1.3
    0x0bafd179 0x00 08 CXXABI_1.3.9
    0x08922974 0x00 07 GLIBCXX_3.4
  required from libdl.so.2:
    0x09691a75 0x00 06 GLIBC_2.2.5
  required from libLLVM-11.so:
    0x011b3211 0x00 05 LLVM_11
  required from libc.so.6:
    0x06969185 0x00 36 GLIBC_2.25
    0x0d696916 0x00 31 GLIBC_2.6
    0x06969196 0x00 29 GLIBC_2.16
    0x06969194 0x00 28 GLIBC_2.14
    0x069691b3 0x00 27 GLIBC_2.33
    0x09691974 0x00 26 GLIBC_2.3.4
    0x0d696914 0x00 22 GLIBC_2.4
    0x06969197 0x00 18 GLIBC_2.17
    0x09691972 0x00 17 GLIBC_2.3.2
    0x069691b2 0x00 15 GLIBC_2.32
    0x0d696913 0x00 14 GLIBC_2.3
    0x06969188 0x00 13 GLIBC_2.28
    0x0d696917 0x00 09 GLIBC_2.7
    0x09691a75 0x00 04 GLIBC_2.2.5
  required from libpthread.so.0:
    0x06969192 0x00 38 GLIBC_2.12
    0x09691974 0x00 35 GLIBC_2.3.4
    0x09691972 0x00 23 GLIBC_2.3.2
    0x09691a75 0x00 03 GLIBC_2.2.5
  required from libelf.so.1:
    0x0ab99a95 0x00 24 ELFUTILS_1.5
    0x0ab99a90 0x00 02 ELFUTILS_1.0

and for this libLLVM-11.so

/gnu/store/x9l12rzjz87lbr635kb5gni1y7vik7ai-llvm-for-fhs-11.0.0/lib/libLLVM-11.so:     file format elf64-x86-64
/gnu/store/x9l12rzjz87lbr635kb5gni1y7vik7ai-llvm-for-fhs-11.0.0/lib/libLLVM-11.so
architecture: i386:x86-64, flags 0x00000150:
HAS_SYMS, DYNAMIC, D_PAGED
start address 0x00000000008c02b0

Program Header:
    LOAD off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**12
         filesz 0x000000000087ece0 memsz 0x000000000087ece0 flags r--
    LOAD off    0x000000000087f000 vaddr 0x000000000087f000 paddr 0x000000000087f000 align 2**12
         filesz 0x0000000002f7b009 memsz 0x0000000002f7b009 flags r-x
    LOAD off    0x00000000037fb000 vaddr 0x00000000037fb000 paddr 0x00000000037fb000 align 2**12
         filesz 0x0000000001bf7ca8 memsz 0x0000000001bf7ca8 flags r--
    LOAD off    0x00000000053f3bd0 vaddr 0x00000000053f4bd0 paddr 0x00000000053f4bd0 align 2**12
         filesz 0x000000000044ff88 memsz 0x00000000004beb88 flags rw-
 DYNAMIC off    0x0000000005813ce0 vaddr 0x0000000005814ce0 paddr 0x0000000005814ce0 align 2**3
         filesz 0x00000000000002b0 memsz 0x00000000000002b0 flags rw-
    NOTE off    0x00000000053f2c78 vaddr 0x00000000053f2c78 paddr 0x00000000053f2c78 align 2**3
         filesz 0x0000000000000030 memsz 0x0000000000000030 flags r--
     TLS off    0x00000000053f3bd0 vaddr 0x00000000053f4bd0 paddr 0x00000000053f4bd0 align 2**3
         filesz 0x0000000000000000 memsz 0x0000000000000018 flags r--
0x6474e553 off    0x00000000053f2c78 vaddr 0x00000000053f2c78 paddr 0x00000000053f2c78 align 2**3
         filesz 0x0000000000000030 memsz 0x0000000000000030 flags r--
EH_FRAME off    0x0000000004f528f0 vaddr 0x0000000004f528f0 paddr 0x0000000004f528f0 align 2**2
         filesz 0x000000000008afec memsz 0x000000000008afec flags r--
   STACK off    0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**4
         filesz 0x0000000000000000 memsz 0x0000000000000000 flags rw-
   RELRO off    0x00000000053f3bd0 vaddr 0x00000000053f4bd0 paddr 0x00000000053f4bd0 align 2**0
         filesz 0x0000000000426430 memsz 0x0000000000426430 flags r--

Dynamic Section:
  NEEDED               libffi.so.7
  NEEDED               libz.so.1
  NEEDED               librt.so.1
  NEEDED               libdl.so.2
  NEEDED               libpthread.so.0
  NEEDED               libstdc++.so.6
  NEEDED               libm.so.6
  NEEDED               libgcc_s.so.1
  NEEDED               libc.so.6
  NEEDED               ld-linux-x86-64.so.2
  SONAME               libLLVM-11.so
  RUNPATH              /gnu/store/x9l12rzjz87lbr635kb5gni1y7vik7ai-llvm-for-fhs-11.0.0/lib:/gnu/store/2fk1gz2s7ppdicynscra9b19byrrr866-glibc-2.33/lib:/gnu/store/90lbavffg0csrf208nw0ayj1bz5knl47-gcc-10.3.0-lib/lib:/gnu/store/hbw4pf3plhab5kqyfpczl3mm0wr9rb39-libffi-3.3/lib:/gnu/store/2i0zpa5w320y8m4zbqk1va8vs6dbawv0-zlib-1.2.11/lib:/gnu/store/90lbavffg0csrf208nw0ayj1bz5knl47-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../..
  INIT                 0x000000000087f000
  FINI                 0x00000000037fa000
  INIT_ARRAY           0x00000000053f4bd0
  INIT_ARRAYSZ         0x0000000000001048
  FINI_ARRAY           0x00000000053f5c18
  FINI_ARRAYSZ         0x0000000000000008
  HASH                 0x00000000000002a8
  GNU_HASH             0x00000000000273e8
  STRTAB               0x00000000001106e0
  SYMTAB               0x0000000000055f90
  STRSZ                0x000000000022b8d0
  SYMENT               0x0000000000000018
  PLTGOT               0x000000000581b000
  PLTRELSZ             0x00000000000618c0
  PLTREL               0x0000000000000007
  JMPREL               0x000000000081d420
  RELA                 0x000000000034bb68
  RELASZ               0x00000000004d18b8
  RELAENT              0x0000000000000018
  VERDEF               0x000000000034b850
  VERDEFNUM            0x0000000000000002
  FLAGS_1              0x0000000000000008
  VERNEED              0x000000000034b888
  VERNEEDNUM           0x0000000000000009
  VERSYM               0x000000000033bfb0
  RELACOUNT            0x0000000000029d06

Version definitions:
1 0x01 0x0ef3344f libLLVM-11.so
2 0x00 0x011b3211 LLVM_11

Version References:
  required from ld-linux-x86-64.so.2:
    0x0d696913 0x00 32 GLIBC_2.3
  required from libm.so.6:
    0x06969187 0x00 34 GLIBC_2.27
    0x06969189 0x00 21 GLIBC_2.29
    0x09691a75 0x00 18 GLIBC_2.2.5
  required from libffi.so.7:
    0x00d1eba0 0x00 17 LIBFFI_BASE_7.0
  required from libz.so.1:
    0x0827e5c0 0x00 12 ZLIB_1.2.0
  required from libpthread.so.0:
    0x06969192 0x00 20 GLIBC_2.12
    0x09691a75 0x00 11 GLIBC_2.2.5
  required from libc.so.6:
    0x06969195 0x00 36 GLIBC_2.15
    0x09691974 0x00 28 GLIBC_2.3.4
    0x0d696916 0x00 24 GLIBC_2.6
    0x069691b2 0x00 23 GLIBC_2.32
    0x0d696913 0x00 19 GLIBC_2.3
    0x069691b3 0x00 14 GLIBC_2.33
    0x0d696917 0x00 13 GLIBC_2.7
    0x06969194 0x00 09 GLIBC_2.14
    0x09691a75 0x00 06 GLIBC_2.2.5
  required from libgcc_s.so.1:
    0x0b792653 0x00 39 GCC_3.3
    0x0b792654 0x00 33 GCC_3.4
    0x0b792650 0x00 05 GCC_3.0
  required from libdl.so.2:
    0x09691a75 0x00 04 GLIBC_2.2.5
  required from libstdc++.so.6:
    0x0297f864 0x00 38 GLIBCXX_3.4.14
    0x0297f867 0x00 37 GLIBCXX_3.4.17
    0x0297f869 0x00 35 GLIBCXX_3.4.19
    0x0bafd175 0x00 31 CXXABI_1.3.5
    0x0297f872 0x00 30 GLIBCXX_3.4.22
    0x02297f89 0x00 29 GLIBCXX_3.4.9
    0x0297f876 0x00 27 GLIBCXX_3.4.26
    0x0bafd173 0x00 26 CXXABI_1.3.3
    0x0297f868 0x00 25 GLIBCXX_3.4.18
    0x056bafd3 0x00 22 CXXABI_1.3
    0x0297f871 0x00 16 GLIBCXX_3.4.21
    0x0297f865 0x00 15 GLIBCXX_3.4.15
    0x0297f861 0x00 10 GLIBCXX_3.4.11
    0x08922974 0x00 08 GLIBCXX_3.4
    0x0297f870 0x00 07 GLIBCXX_3.4.20
    0x0bafd179 0x00 03 CXXABI_1.3.9

Note that all these /gnu/store directories are visible in the pre-game launch environment and overrides does get populated with other libraries. For some reason just seems libLLVM (or the individual LLVM libs when not a dynlib) is not also included.

Steam Runtime Version: steam-runtime_0.20211102.0

@podiki
Copy link
Author

podiki commented Dec 6, 2021

I spoke too soon, seems moving to just libLLVM-11.so did 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 just libLLVM-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
Copy link
Contributor

smcv commented 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-vessel with an unofficial build that I can provide), then I expect we can probably find a solution and include that in future official builds.

@smcv
Copy link
Contributor

smcv commented 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
Copy link
Contributor

smcv commented Dec 6, 2021

there's a lot to wrap your head around here!

Yes there is - git log says 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.

Is this because of the capture-libs no-dependencies flag?

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 with only-dependencies. Between them, they collect everything we need for the loadable module, but they have different target directories.

This is because if radeonsi_dri.so depends on libLLVMCoroutines.so, we want radeonsi_dri.so to end up in the LIBGL_DRIVERS_PATH and not the default search path for libraries (in practice it goes to /usr/lib/pressure-vessel/overrides/${tuple}/dri inside the container, where ${tuple} is either i386-linux-gnu or x86_64-linux-gnu); but we do want libLLVMCoroutines.so to end up in the default search path for libraries (in practice /usr/lib/pressure-vessel/overrides/${tuple}) so that ld.so will 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.

launching with an xterm in the environment and running the command from the log

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 bwrap process 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:

init (on host system)
\- ...
    \- pressure-vessel-wrap
        /---|------------------------------------
        |   \- contents of SLR container
        |

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:

init (on host system)
\- ...
    \- bwrap or something
        /---|-------------------------------------
        |   \- Steam (in FHS environment)
        |        \- pressure-vessel-wrap
        |            /---|------------------------
        |            |   \- contents of SLR container

@smcv
Copy link
Contributor

smcv commented 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/store or /gnu/store, and have a very long DT_RUNPATH pointing into that hierarchy. You have worked around this with PRESSURE_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 /nix with the container (not just /nix/store). What else is in /gnu on Guix, other than /gnu/store? Should we be sharing all of /gnu if it exists, or just /gnu/store, or /gnu/store and a finite number of other directories?

  • In upstream glibc and in most FHS distributions, glibc is configured so that ld.so reads /etc/ld.so.cache to 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?

    • Note that some parts of capsule-capture-libs rely on the ld.so cache existing and being reasonably complete, so that we can enumerate all the "public" shared libraries that match a pattern. I think we know how to follow DT_RPATH and DT_RUNPATH for specific, named libraries, but we cannot do that for patterns like libGLX_*.so.0.
    • I've lost track of how NixOS does this, but I think the way it works is that ld.so reads /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
Copy link
Contributor

smcv commented Dec 6, 2021

without LLVM compiled with the dynlib option, that pressure vessel won't see/capture the individual LLVM libraries needed by Mesa

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 . -ls or 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 library libLLVM-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.

@kisak-valve kisak-valve changed the title 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 Dec 6, 2021
@podiki
Copy link
Author

podiki commented 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!

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-vessel with an unofficial build that I can provide), then I expect we can probably find a solution and include that in future official builds.

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.

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?

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 because if radeonsi_dri.so depends on libLLVMCoroutines.so, we want radeonsi_dri.so to end up in the LIBGL_DRIVERS_PATH and not the default search path for libraries (in practice it goes to /usr/lib/pressure-vessel/overrides/${tuple}/dri inside the container, where ${tuple} is either i386-linux-gnu or x86_64-linux-gnu); but we do want libLLVMCoroutines.so to end up in the default search path for libraries (in practice /usr/lib/pressure-vessel/overrides/${tuple}) so that ld.so will 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.

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-libs calls. 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 libLLVM pieces. It does seem to look in the right place (all the libs were copied to the fhs directories) but yet does not load it. Log

I'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.

It's extra-confusing on NixOS and Guix ...

Indeed, there's a lot of layers here! Containers within containers (as I understand it, what made Flatpak Steam tricky too).

  • Shared libraries are physically located in /nix/store or /gnu/store, and have a very long DT_RUNPATH pointing into that hierarchy. You have worked around this with PRESSURE_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?

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.)

  • For NixOS' benefit, we automatically share all of /nix with the container (not just /nix/store). What else is in /gnu on Guix, other than /gnu/store? Should we be sharing all of /gnu if it exists, or just /gnu/store, or /gnu/store and a finite number of other directories?

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.

In upstream glibc and in most FHS distributions, glibc is configured so that ld.so reads /etc/ld.so.cache to 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?

Yes, this is a sticking point. By default Guix's glibc has disabled the ld.so.cache reading (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 a glibc that reads etc/ld.so.cache from within the store of the binary. In other words, /gnu/store/<hash>-program/bin/prog will 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_PATH can work to get Guix's glibc to read the ld.so.cache somewhere 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 glibc that reads /etc/ld.so.cache like 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.

  • Note that some parts of capsule-capture-libs rely on the ld.so cache existing and being reasonably complete, so that we can enumerate all the "public" shared libraries that match a pattern. I think we know how to follow DT_RPATH and DT_RUNPATH for specific, named libraries, but we cannot do that for patterns like libGLX_*.so.0.

This (reliance on the cache) might be why my efforts for tricking Guix's standard glibc didn'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?

  • I've lost track of how NixOS does this, but I think the way it works is that ld.so reads /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.

Similar to what I/we've done here too. Besides there not being /etc/ld.so.cache in Guix System, being in a container means we can allow access or not anyway.

  • 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.

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.

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 . -ls or 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 library libLLVM-13.so.1, but static linking uses multiple smaller static libraries such as /usr/lib/llvm-13/lib/libLLVMCoroutines.a.

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=TRUE to -DLLVM_BUILD_LLVM_DYLIB=ON and -DLLVM_LINK_LLVM_DYLIB=ON.

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.

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.

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.

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
Copy link
Author

podiki commented 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=1 and captured the logs.

Here are the logs and find . -ls in 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_LIBS instead) 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
Copy link
Contributor

smcv commented Dec 7, 2021

By default Guix's glibc has disabled the ld.so.cache reading (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 a glibc that reads etc/ld.so.cache from within the store of the binary. In other words, /gnu/store/<hash>-program/bin/prog will be able to use /gnu/store/<hash>-program/etc/ld.so.cache.

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 overriding LD_ORIGIN_PATH would 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.cache first? 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
Copy link
Contributor

smcv commented 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.

It is fun technology

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
Copy link
Contributor

smcv commented Dec 7, 2021

I think we are going to need a working ld.so.cache to 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.cache that we generate, via a symlink at some fixed path (so /gnu/guix-ld.so.cache would be OK, but /gnu/store/<hash>-steam-blahblah/etc/ld.so.cache would not be, because we can't know what the hash should be). That's also likely to be non-negotiable: we originally tried relying on LD_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.cache is 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 new ld.so.cache that 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.

As far as I know there is only /gnu/store

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 using PRESSURE_VESSEL_FILESYSTEMS_RO=/gnu/store.

This is built from a branch which adds the same special cases for /gnu/store that we already had for /nix. Hopefully that will make PRESSURE_VESSEL_FILESYSTEMS_RO=/gnu/store unnecessary, and also silence some of the warnings.

@smcv
Copy link
Contributor

smcv commented 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_LIBS doesn'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 big libLLVM-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.cache things 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
Copy link
Contributor

smcv commented Dec 7, 2021

Perhaps pressure-vessel can have a list of such "stores" that should be read-only mounted

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
Copy link
Author

podiki commented 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:

  1. Providing a more standard glibc in the FHS container, with an ld.so.cache for the included libraries (not modifying LD_LIBRARY_PATH at all)
  2. Modifying the LLVM build options to match others like Arch (the two DYLIB flags you noted) and building Mesa against that LLVM
  3. The PRESSURE_VESSEL_FILESYSTEMS_RO=/gnu/store option (will try your modified runtime build next)
  4. (And all the other FHS container setup as NixOS has done, but that was work done already by others that I've been modifying with the above changes.)

From what you say looks like the separate glibc for 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 with DYLIB. 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
Copy link
Author

podiki commented Dec 7, 2021

Sorry about the logs, somehow completely missed the attaching option here.

These are the logs from the working version (LLVM with DYLIB configuration):

  1. slr-app447150-t20211207T024531.log
  2. slr-non-steam-game-t20211207T024502.log
  3. working-config.txt
  4. working-log.txt
  5. working-find-ls-llvm.txt

And these from the non-working version (LLVM with SHARED_LIBS):

  1. config-not-working.txt
  2. not-working-log.txt
  3. not-working-log2.txt (large log when Steam log option was turned off)
  4. slr-app447150-t20211207T025435.log
  5. slr-app1493710-t20211207T025353.log
  6. slr-app1580130-t20211207T025403.log
  7. slr-non-steam-game-t20211207T025414.log
  8. not-working-find-ls-llvm.txt

@podiki
Copy link
Author

podiki commented 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.cache as 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 glibc that 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 this glibc in 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 standard glibc and /etc/ld.so.cache already setup.

@podiki
Copy link
Author

podiki commented 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/store option, the game again loaded fine.)

EDIT: Floating Point works with your runtime and the original version (both without the additional FILESYSTEMS option) but not Hades (guessing the Proton factor).

@smcv
Copy link
Contributor

smcv commented Dec 8, 2021

bwrap: execvp /usr/lib/pressure-vessel/from-host/bin/pressure-vessel-adverb: No such file or directory.

This usually means your ld.so didn'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.gz is to remove or rename steamapps/common/SteamLinuxRuntime_soldier/pressure-vessel, then unpack pressure-vessel-bin.tar.gz so that it provides a new steamapps/common/SteamLinuxRuntime_soldier/pressure-vessel with files like steamapps/common/SteamLinuxRuntime_soldier/pressure-vessel/bin/pressure-vessel-wrap. You should be able to run steamapps/common/SteamLinuxRuntime_soldier/pressure-vessel/bin/pressure-vessel-wrap --version and, if you are using the test-build I linked above, it will say this:

.../pressure-vessel-wrap:
 Package: pressure-vessel
 Version: 0.20211206.0~0.20211027.0+40+g7b812ce

The two configurations that I would expect to work are:

  1. Production version with workaround:
    • Mainstream version of pressure-vessel (currently 0.20211027.0, but a new beta with 0.20211207.0 should be available soon)
    • PRESSURE_VESSEL_FILESYSTEMS_RO=/gnu/store workaround
  2. Test version with or without workaround:

Running the production version of pressure-vessel on Guix, without the PRESSURE_VESSEL_FILESYSTEMS_RO workaround, 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 of Steam Linux Runtime - soldier both have version 0.20211027.0, but the beta branch will probably update to 0.20211207.0 sometime this week.

EDIT: Floating Point works with your runtime and the original version

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 choose Steam Linux Runtime from the list. If you do that, and also set the appropriate environment variables when starting Steam, then it will produce a log in SteamLinuxRuntime_soldier/var/slr-<something>.log just 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.

It would be easy enough to provide this glibc in 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 standard glibc and /etc/ld.so.cache already setup.

OK, that seems like a pragmatic approach, and I think it's similar to how this already works on NixOS.

@smcv
Copy link
Contributor

smcv commented Dec 8, 2021

from the non-working version (LLVM with SHARED_LIBS)

Hmm, this seems wrong:

ld_lib_open:[000] /gnu/store/5sbldxhgxwn2cjlkgak8sz1xms5paw2b-mesa-21.2.5/lib/libvulkan_radeon.so on fd #12; elf: 0x23bae00; acceptable: 1
dso_find:target DSO is libLLVMAMDGPUDisassembler.so.11
search_ldpath:searching for libLLVMAMDGPUDisassembler.so.11 in /gnu/store/9hkp0v7zc17yz3zvd3hd8lap7lygzllz-fhs-union-64-0.0/lib:/gnu/store/m9q4fxx3wdfc58naznzvjbx0bzqdkj12-fhs-union-32-0.0/lib:/gnu/store/jawarkca8jl3japfz6j00ps5wvwhdb91-glibc-for-fhs-2.33/lib:/home/john/.local/share/Steam/steamapps/common/Ape Out (prefix: /)
search_ldpath:  searchpath element: /gnu/store/9hkp0v7zc17yz3zvd3hd8lap7lygzllz-fhs-union-64-0.0/lib
search_ldpath:examining /gnu/store/9hkp0v7zc17yz3zvd3hd8lap7lygzllz-fhs-union-64-0.0/lib/libLLVMAMDGPUDisassembler.so.11
search_ldpath:  searchpath element: /gnu/store/m9q4fxx3wdfc58naznzvjbx0bzqdkj12-fhs-union-32-0.0/lib
search_ldpath:examining /gnu/store/m9q4fxx3wdfc58naznzvjbx0bzqdkj12-fhs-union-32-0.0/lib/libLLVMAMDGPUDisassembler.so.11
search_ldpath:  searchpath element: /gnu/store/jawarkca8jl3japfz6j00ps5wvwhdb91-glibc-for-fhs-2.33/lib
search_ldpath:examining /gnu/store/jawarkca8jl3japfz6j00ps5wvwhdb91-glibc-for-fhs-2.33/lib/libLLVMAMDGPUDisassembler.so.11
search_ldpath:  searchpath element: /home/john/.local/share/Steam/steamapps/common/Ape Out
search_ldpath:examining /home/john/.local/share/Steam/steamapps/common/Ape Out/libLLVMAMDGPUDisassembler.so.11
search_ldpath:searching for libLLVMAMDGPUDisassembler.so.11 in /lib:/usr/lib (prefix: /)
search_ldpath:  searchpath element: /lib
search_ldpath:examining /lib/libLLVMAMDGPUDisassembler.so.11
search_ldpath:  searchpath element: /usr/lib
search_ldpath:examining /usr/lib/libLLVMAMDGPUDisassembler.so.11
capture_one:Some of the dependencies for /gnu/store/5sbldxhgxwn2cjlkgak8sz1xms5paw2b-mesa-21.2.5/lib/libvulkan_radeon.so have not been found, ignoring

And in your find output, 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):

ld_lib_open:[004] /gnu/store/zfmf01fwy5gqk30hqms2n3wdbxz4ywi7-libdrm-2.4.107/lib/libdrm.so.2.4.0 on fd #17; elf: 0x2359550; acceptable: 1
dso_find:target DSO is libLLVM-11.so
search_ldpath:searching for libLLVM-11.so in /gnu/store/3vfvssxlk1sqgff535fhjl1gvvbsx3mp-fhs-union-64-0.0/lib:/gnu/store/y5gjda86g6k35s65zym7cja5y0sw0zn9-fhs-union-32-0.0/lib:/gnu/store/jawarkca8jl3japfz6j00ps5wvwhdb91-glibc-for-fhs-2.33/lib:/home/john/.local/share/Steam/steamapps/common/Ape Out (prefix: /)
search_ldpath:  searchpath element: /gnu/store/3vfvssxlk1sqgff535fhjl1gvvbsx3mp-fhs-union-64-0.0/lib
search_ldpath:examining /gnu/store/3vfvssxlk1sqgff535fhjl1gvvbsx3mp-fhs-union-64-0.0/lib/libLLVM-11.so
ld_lib_open:ldlib_open: target -: /gnu/store/x9l12rzjz87lbr635kb5gni1y7vik7ai-llvm-for-fhs-11.0.0/lib/libLLVM-11.so
ld_lib_open:ldlib_open: target +: /gnu/store/x9l12rzjz87lbr635kb5gni1y7vik7ai-llvm-for-fhs-11.0.0/lib/libLLVM-11.so
ld_lib_open:[005] /gnu/store/x9l12rzjz87lbr635kb5gni1y7vik7ai-llvm-for-fhs-11.0.0/lib/libLLVM-11.so on fd #18; elf: 0x235abf0; acceptable: 1

@podiki
Copy link
Author

podiki commented 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_RO flag. 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
Copy link
Author

podiki commented 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 find output 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.0 and 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 llvm right 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 writing llvm is defined as LLVM version 9. And I knew this, since I was looking right at Mesa which clearly uses llvm-11 to 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-11 in 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.9 was 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:

  1. Needs either the PRESSURE_VESSEL_FILESYSTEMS_RO flag or the test build you provided (besides warnings appearing or not, they are equivalent in the end?).
  2. Due to how tightly ingrained the ld cache is with pressure-vessel, seems unlikely to make it work with Guix's default glibc which reads a cache from a /gnu/store/<hash>-package/etc/ld.so.cache location. An LD_ORIGIN_PATH override or trickery is not enough or would require some deep changes.
  3. Instead, from the Guix side provide a standard glibc in 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 steamwebhelper problem 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
Copy link
Contributor

smcv commented Dec 9, 2021

Needs either the PRESSURE_VESSEL_FILESYSTEMS_RO flag or the test build you provided

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.

besides warnings appearing or not, they are equivalent in the end?

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/store is now something that we are going to share with the host.

@podiki
Copy link
Author

podiki commented 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
Copy link
Author

podiki commented 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.

@podiki podiki closed this as completed Dec 17, 2021
@smcv
Copy link
Contributor

smcv commented Jan 20, 2022

I see this was merged upstream

This change has gone out in SteamLinuxRuntime_soldier build 0.20220120.41, which is currently on the client_beta branch of SteamLinuxRuntime_soldier (you can opt in to using this beta, it is not used by default). If you have the fixed version, you will see pressure-vessel 0.20220107.0 or later in SteamLinuxRuntime_soldier/VERSIONS.txt.

It is likely to be "promoted" into the stable releases that are used by default at some point in the future.

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

No branches or pull requests

3 participants