protonscr

[BUG] `vrpathreg` misses `libopenvr_api.so` in the same directory

steamvrclosed bug
ValveSoftware/SteamVR-for-Linux#478 · opened 2021-11-10 by okawo80085 · updated 2022-03-16 · 3 comments · github
Ookawo80085 2021-11-10 github

Describe the bug
SteamVR/bin/linux64/vrpathreg needs libopenvr_api.so to function, but if you try using it without libopenvr_api.so installed on your system, you'll get this

$ ./vrpathreg
./vrpathreg: error while loading shared libraries: libopenvr_api.so: cannot open shared object file: No such file or directory

To Reproduce
Steps to reproduce the behavior:

  1. cd to <your steam installation>/steamapps/common/SteamVR/bin/linux64
  2. Run ./vrpathreg
  3. See error

Expected behavior
If you run vrpathreg without arguments it should default to the show argument, which looks something like this

$ ./vrpathreg
Runtime path = <your steam installation>/steamapps/common/SteamVR
Config path = <your steam installation>/config
Log path = <your steam installation>/logs
External Drivers:

System Information (please complete the following information):

  • Distribution: Ubuntu 20.04.3 LTS x86_64
  • SteamVR version: 1.21.1 [beta]
  • Steam client version: built Nov 9 2021 21:28:18
  • Opted into Steam client beta?: Yes
  • Graphics driver version: nvidia 470.82.00
  • Gist for SteamVR System Information: here

Screenshots
Not needed

Additional context
This tool is invaluable for driver development and deployment, this issue is not present on Windows, and requires minimal effort to fix it

Proposed workaround
Hell it can be done with 2 commands

# assuming you are in SteamVR/bin/linux64/
$ echo "LD_LIBRARY_PATH='./' ./vrpathreg $@" > vrpathreg.sh 
$ chmod +x ./vrpathreg.sh

Jokes aside, the bash script needs to be a bit more complicated

$ cat ./vrpathreg.sh

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
LD_LIBRARY_PATH=$SCRIPT_DIR/ $SCRIPT_DIR/vrpathreg $@

Now that would make a functional workaround, but for example, most of my old driver installers use ./vrpathreg without the .sh suffix, we can fix that with a one line change to our bash script and 2 move commands, this IMO is a way better work around since it doesn't require any change in usage of vrpathreg

Change ./vrpathreg.sh to he following:

$ cat ./vrpathreg.sh
#!/usr/bin/env bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
LD_LIBRARY_PATH=$SCRIPT_DIR/ $SCRIPT_DIR/_vrpathreg $@

Now the 2 move commands:

mv ./vrpathreg ./_vrpathreg
mv ./vrpathreg.sh ./vrpathreg

Now when running ./vrpathreg we'll start our bash script

Note: Commenters who are also experiencing this issue are encouraged to include the "System Information" section in their replies.

JJacekJagosz 2022-03-03 github

I am also experiencing it, would love if this could be fixed.
Thankfully building openvr patched by you fixes this problem, but it shouldn't be necessary.

System information

Distribution: Solus 4.3
SteamVR version: 1.21.10
Steam client version: Steam Client Beta - March 2
Graphics driver version: Mesa 21.3.7 (AMD Radeon)

Ookawo80085 2022-03-09 github

Yeah definitely, that missing lib is literally in the same dir with the tool, the said tool missing that lib is just sad.

Ookawo80085 2022-03-16 github

While dealing with a completely unrelated issue i found out that not in <your steam installation>/steamapps/common/SteamVR/bin/linux64, but in <your steam installation>/steamapps/common/SteamVR/bin there exists a vrpathreg.sh which does not have this issue... and also loads and prints a bunch of other things, but it works so i'm closing this.

Nothing extracted yet.