Describe the bug
A clear and concise description of what the bug is.
SteamVR crashes when you set CAP_SYS_NICE=eip on vrcompositor-launcher.
To Reproduce
Steps to reproduce the behavior:
sudo setcap CAP_SYS_NICE=eip ~/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor-launcher
steam-run strace ~/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor-launcher
Expected behavior
A clear and concise description of what you expected to happen.
On an FHS distro it looks for libs in /lib32 /lib64 and the like. It should either do that or look under /steamrt/.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
See #71554
I booted up a Pop!_OS live env, installed SteamVR, set the CAP and straced vrcompositor-launcher.
It first started looking for libcap.so.2 in the SteamVR bin and then regular FHS paths like /usr/lib etc. where it found libcap under /lib/x86_64-linux-gnu/libcap.so.2.
On NixOS it only tries to look in a few FHS paths under ${pkgs.glibc} which is obviously nonsensical and fails.
Seems like this happends due to Nix-specific patches to dynamic linking because we're also doing something that makes vrcompositor-launcher try to preload from /etc/ld-nix.so.preload which, countrary to LD_PRELOAD, also actually works. I made use of this and modified buildFHSUserEnv to create a file in that location inside the chroot to preload libcap.so.2 and libstdc++.so.6 from the steamrt.
With these patches, SteamVR can be launched with CAP_SYS_NICE=eip set on vrcompositor-launcher.
https://github.com/Atemu/nixpkgs/tree/steamvr-lib-loading-fixes
This is obviously not a solution, only for troubleshooting. Could someone more knowledgeable about dynamic linking in Nix to have a look at this now that we know what our issue is?
While doing this I have also discovered that the chronic stuttering issue (1-3 purple spikes ever second or so) is greatly reduced or even completely eliminated (depending on the mood of SteamVR) when a preloaded ${pkgs.steamPackages.steam-runtime}/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 replaces the libSDL from the SteamVR bin it'd normally try to load. This can also be achieved by replacing the lib with a symlink to the one in the steamrt.
I'd love to hear more reports on this so that we can take this information to Valve as I had the same issue on Pop!_OS.
Notify maintainers
@jagajaga @abbradar
Metadata
Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.
- system:
"x86_64-linux"
- host os:
Linux 5.6.19, NixOS, 20.09pre233323.dc80d7bc4a2 (Nightingale)
- multi-user?:
yes
- sandbox:
yes
- version:
nix-env (Nix) 2.3.6
- channels(root):
"nixos-20.09pre233323.dc80d7bc4a2, nixpkgs-mozilla, nixos-stable-20.03.2310.fb6c3a6831c, nixos-unstable-20.09pre231796.22a81aa5fc1"
- nixpkgs:
/nix/var/nix/profiles/per-user/root/channels/nixos
Maintainer information:
# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
Describe the bug
A clear and concise description of what the bug is.
SteamVR crashes when you set
CAP_SYS_NICE=eipon vrcompositor-launcher.To Reproduce
Steps to reproduce the behavior:
sudo setcap CAP_SYS_NICE=eip ~/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor-launchersteam-run strace ~/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor-launcherExpected behavior
A clear and concise description of what you expected to happen.
On an FHS distro it looks for libs in /lib32 /lib64 and the like. It should either do that or look under /steamrt/.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
See #71554
I booted up a Pop!_OS live env, installed SteamVR, set the CAP and
straced vrcompositor-launcher.It first started looking for libcap.so.2 in the SteamVR bin and then regular FHS paths like /usr/lib etc. where it found libcap under
/lib/x86_64-linux-gnu/libcap.so.2.On NixOS it only tries to look in a few FHS paths under
${pkgs.glibc}which is obviously nonsensical and fails.Seems like this happends due to Nix-specific patches to dynamic linking because we're also doing something that makes vrcompositor-launcher try to preload from
/etc/ld-nix.so.preloadwhich, countrary toLD_PRELOAD, also actually works. I made use of this and modifiedbuildFHSUserEnvto create a file in that location inside the chroot to preload libcap.so.2 and libstdc++.so.6 from the steamrt.With these patches, SteamVR can be launched with
CAP_SYS_NICE=eipset on vrcompositor-launcher.https://github.com/Atemu/nixpkgs/tree/steamvr-lib-loading-fixes
This is obviously not a solution, only for troubleshooting. Could someone more knowledgeable about dynamic linking in Nix to have a look at this now that we know what our issue is?
While doing this I have also discovered that the chronic stuttering issue (1-3 purple spikes ever second or so) is greatly reduced or even completely eliminated (depending on the mood of SteamVR) when a preloaded
${pkgs.steamPackages.steam-runtime}/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0replaces the libSDL from the SteamVR bin it'd normally try to load. This can also be achieved by replacing the lib with a symlink to the one in the steamrt.I'd love to hear more reports on this so that we can take this information to Valve as I had the same issue on Pop!_OS.
Notify maintainers
@jagajaga @abbradar
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"and paste the result."x86_64-linux"Linux 5.6.19, NixOS, 20.09pre233323.dc80d7bc4a2 (Nightingale)yesyesnix-env (Nix) 2.3.6"nixos-20.09pre233323.dc80d7bc4a2, nixpkgs-mozilla, nixos-stable-20.03.2310.fb6c3a6831c, nixos-unstable-20.09pre231796.22a81aa5fc1"/nix/var/nix/profiles/per-user/root/channels/nixosMaintainer information: