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

SteamVR fails to load into games #71554

Closed
Flameslice opened this issue Oct 21, 2019 · 21 comments
Closed

SteamVR fails to load into games #71554

Flameslice opened this issue Oct 21, 2019 · 21 comments

Comments

@Flameslice
Copy link
Contributor

Describe the bug
SteamVR fails to load into games due to failing get superuser access. Manually setting the permissions it expects also leads to unexpected behaviour.

To Reproduce
Steps to reproduce the behavior:

  1. Install a fresh version of Steam and SteamVR, I'm using an HTC Vive
  2. When trying to launch, it will open a zenity instance asking for superuser permissions
  3. Choosing either option will yield an error saying setup is incomplete, check a log.
  4. The log reads "Error: setcap of vrcompositor-launcher failed.", the setcap is trying to set cap_sys_nice

Expected behavior
I'd expect to install steamvr, give it the permissions it asks for, either manually or through the zenity dialogue, then be able to play supported games.

Screenshots
fresh install
perms set manually

Additional context
Using the troubleshooting steps from here yielded no results.
Additionally, overriding the steam package to be build with libcap did not change anything.
hardware.steam-hardware.enable = true; is set in my config.nix.
If you continue after it fails to get access, games will load, but accept no input and the HMD will be stuck at the loading screen instead.
When the permissions it wants were manually set the HMD did not show any output, and games would not load.
Launching steam via terminal and reading the output shows the error is thrown in ~/.local/share/Steam/steamapps/common/SteamVR/bin/vrstartup.sh
Here's the steam console output with the perms set
and without

Metadata

  • system: "x86_64-linux"
  • host os: Linux 4.19.79, NixOS, 20.03pre196836.1c40ee6fc44 (Markhor)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.3.1
  • channels(root): "home-manager, nixos-20.03pre196836.1c40ee6fc44"
  • channels(kristian): "home-manager"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:nixpkgs.steam
# a list of nixos modules affected by the problem
module:
@davidak
Copy link
Member

davidak commented Nov 13, 2019

I'm able to reproduce the issue with a Valve Index HMD.

Error: setcap of vrcompositor-launcher failed.

I see the SteamVR Home and i can launch a game, but the game is not streamed to the HMD.

gamestream/gamestreamsystem.cpp (829) : Assertion Failed: pState->m_nProcess == nProcess
gamestream/gamestreamsystem.cpp (829) : Assertion Failed: pState->m_nProcess == nProcess
gamestream/gamestreamsystem.cpp (829) : Assertion Failed: pState->m_nProcess == nProcess
 SDL_GetWindowWMInfo failed
 SDL_GetWindowWMInfo failedMain.cpp (332) : Assertion Failed: Fatal Error:  SDL_GetWindowWMInfo failed
Main.cpp (332) : Assertion Failed: Fatal Error:  SDL_GetWindowWMInfo failed
Installing breakpad exception handler for appid(steam)/version(1573019481)
crash_20191113104336_120.dmp[9621]: Uploading dump (out-of-process)
/tmp/dumps/crash_20191113104336_120.dmp
crash_20191113104336_120.dmp[9621]: Finished uploading minidump (out-of-process): success = yes
crash_20191113104336_120.dmp[9621]: response: CrashID=bp-94dc8d4c-8896-4687-9e72-8919b2191113
crash_20191113104336_120.dmp[9621]: file ''/tmp/dumps/crash_20191113104336_120.dmp'', upload yes: ''CrashID=bp-94dc8d4c-8896-4687-9e72-8919b2191113''
Exiting on SPEW_ABORT
VR Server (v1573603529)

See the full log: steamlog.txt


Running Steam on nixos 19.09.1208.ef8c34c4721

@notgne2
Copy link
Contributor

notgne2 commented Nov 16, 2019

Can also reproduce with a Vive Pro on my system. I tried moving Steam from my home-manager packages to system packages (fixes some issues with Steam URI stuff it seems), but didn't change anything. I also attempted to setcap the file myself but hit a library error, so tried wrapping the file in a script with LD_PRELOAD, but that failed with the "Something is wrong" error. Tried adding libcap and libcap.lib to Steam's extraLibraries but as mentioned above did not help.

tl;dr I couldn't find any workarounds at all, or system (mis-)configurations causing it.

If anybody cannot reproduce this but has any ideas I'm happy to try poking around with things some more, and potentially working into a true fix.

@danielfullmer
Copy link
Contributor

danielfullmer commented Nov 17, 2019

Here's an extremely hack-ish workaround. I've tested this as working with a couple of VR games that use Proton (VTOLVR and Thrill of the Fight).

Run:

sed -i 's/LD_LIBRARY_PATH=/                /g' $HOME/.local/share/Steam/steamapps/common/SteamVR/bin/vrclient.so
sed -i 's/LD_LIBRARY_PATH=/                /g' $HOME/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrclient.so

(getting the correct number of spaces in the above command is important--and this will break every time SteamVR updates)

Partial explanation:
The vrclient.so files have some strings such as:
STEAM_RUNTIME=0 LD_LIBRARY_PATH= lsusb -d %x:%x > /dev/null
STEAM_RUNTIME= LD_LIBRARY_PATH= QT_PLUGIN_PATH= pidof
and apparently their overriding the LD_LIBRARY_PATH like this seems to break things.
I don't have the logs conveniently available, but I recall seeing error messages about missing libGL, which is normally passed in to the steam environment with LD_LIBRARY_PATH pointing to /run/opengl-driver/lib.
It doesn't make a whole lot of sense why programs like lsusb or pidof would be complaining about missing libGL--but here we are.

The issue with setcap described in the earlier comments is still unresolved, however, but is not necessary in order to run some games. Presumably, we'd get better performance if that was fixed.

@notgne2
Copy link
Contributor

notgne2 commented Nov 17, 2019

That fix works perfectly for me, thanks! From what I could find, setcap is only necessary to enable async reprojection, which seems relatively new to SteamVR Linux and only supports AMD GPUs (which I unfortunately do not have right now anyway).

Would a slightly better workaround be to include each of the OpenGL libraries (I'm not sure how they get selected) in the Steam FHS library path? Or will the usual locations not be in the search path either

@Myaats
Copy link
Member

Myaats commented Nov 22, 2019

I messed around with trying to get vrcomposistor-launcher to work with libcap. I am not sure if it could be related to the chroot being restricted or something related but I am not able to get it working either.

But I did find an alternative workaround which does not involve patching the vrclient libs

mv $HOME/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor-launcher $HOME/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor-launcher.backup
ln -s $HOME/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor $HOME/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor-launcher

@aiverson
Copy link

This problem currently exists on my system. I tried the workaround suggested by the previous person involving creating a symbolic link, and it didn't have any effect. I haven't been able to find any system misconfiguration; steamVR Home works perfectly for every feature I have tried, but none of the handful of other games I've tried has successfully launched to the HMD. For example, BeatSaber in steam linux runtime mode fails to launch at all, and in proton mode it launches to the title screen, but displays it on the monitor rather than the HMD, it doesn't accept any input from the controllers, and needs to be force-killed.

@aiverson
Copy link

Update. Changing the steamvr beta branch from linux_temp to no betas, deleting the steamvr.vrsettings file, reinstalling steamvr, then applying the workaround proposed by m4tsa fixed this problem on my system.

@Atemu
Copy link
Member

Atemu commented May 27, 2020

The superuser permissions are only needed to give the vr launcher executable thingy the capability to set a nice below 0 for better performance. This is optional of course and has nothing to do with the actual issue.

A few things you might want to do:

  1. Restart Steam/SteamVR, Reboot and re-plug. Yes, I know it's obvious but you wouldn't believe how often this has fixed my VR setup. I had the same error seen in OP's second screenshot yesterday and fixed it by restarting Steam and SteamVR.
  2. Make sure it actually works on Windows, SteamOS and/or Ubuntu; this might not be a NixOS problem.
  3. Try different ports for HDMI and USB
  4. Try a different DE/windowManager

I'm on unstable with i3 and works just fine on my Vive* after a bit of twiddling but getting VR to work properly is a bit of a process anyways.

* Well, about as fine as it can work on Linux currently. No power management or motion smoothing and bad stuttering on Nvidia :(

@Atemu
Copy link
Member

Atemu commented May 27, 2020

We should totally fix that superuser popup though, it's pretty annoying.

@Myaats
Copy link
Member

Myaats commented May 27, 2020

The superuser permissions are only needed to give the vr launcher executable thingy the capability to set a nice below 0 for better performance. This is optional of course and has nothing to do with the actual issue.

It is also required to enable async reprojection last time I checked, which is very important feature for having a stable framerate submitted to the HMD.

@aiverson
Copy link

aiverson commented Jul 7, 2020

In my experience, giving it the cap_sys_nice that it asks for just breaks everything.

@ashkitten
Copy link
Contributor

it seems like it works oob here, i don't know if async reprojection works though (how can i test?). the superuser popup is annoying to dismiss every time but i didn't have to fix any paths or anything

@Atemu
Copy link
Member

Atemu commented Jul 8, 2020

The superuser popup is supposed to set cap_sys_nice on vrcompositor-launcher, that's all it does.

If you don't allow that, SteamVR works but if you do it manually, the executable apparently takes a different code path and can't find libraries it depends on anymore.

Perhaps we should get in touch with Valve at this point, I'm pretty sure it's their application doing something weird now; not us.

I'll get a FHS compliant distro and check where SteamVR expects to find the libraries with the cap, maybe that can give us a hint.

@Atemu
Copy link
Member

Atemu commented Jul 9, 2020

This issue has gotten a bit bloated and most of the discussion has nothing to do with OP's problem, so I've created two new issues (see links above). One for the popup issue and one for the vrcompositor-launcher issue.

In the latter I have also made progress investigating why it works on other distros but not NixOS.

@Atemu
Copy link
Member

Atemu commented Nov 5, 2020

Is anyone still able to reproduce this bug?

@Atemu Atemu closed this as completed Nov 19, 2020
@jasonodoom
Copy link
Member

@Atemu Yes I'm currently experiencing this issue.

@jasonodoom
Copy link
Member

steam.txt
So I'm just realizing it's unable to find some of the library paths as it is using the traditional paths and this is NixOS..... What's the best way to fix this as even some of the scripts point to /bin/bash

@jasonodoom
Copy link
Member

I read the opengl wiki and gave it another shot. Still having the same issue. Please consider the file attached the most recent and relevant log. @davidak I don't want to pull you into this but I know we were chatting briefly regarding the issues I've been having. Another weekend is quickly approaching and I'd love to use this because I could use some escape :)

steam.txt

@jasonodoom
Copy link
Member

*I also want to mention that I'm running Okapi (21.05) on Linux 5.4.99, Pantheon DE with GTK 3.24.24

@jasonodoom
Copy link
Member

jasonodoom commented Mar 6, 2021

@m4tsa's suggestion worked and I was able to get SteamVR running last night.

ln -s $HOME/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor  
$HOME/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor-launcher
setcap CAP_SYS_NICE+ep ~/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrcompositor-launcher

Btw, you only need to do this once unless you reinstall SteamVR or SteamVR updates.

@Atemu
Copy link
Member

Atemu commented Mar 7, 2021

I'd recommend you to look into these error messages:

sh: /lib64:/lib32:/steamrt/amd64/lib/x86_64-linux-gnu:/steamrt/amd64/lib:/steamrt/amd64/usr/lib/x86_64-linux-gnu:/steamrt/amd64/usr/lib:/steamrt/i386/lib/i386-linux-gnu:/steamrt/i386/lib:/steamrt/i386/usr/lib/i386-linux-gnu:/steamrt/i386/usr/lib:/run/opengl-driver/lib:/run/opengl-driver-32/lib:/usr/lib:/usr/lib32: No such file or directory

and/or erase all Steam state in your home dir (except for games).

Anyhow, make new bug reports from now on please. A ton of things have changed since the original report in this issue.

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

10 participants