OpenXR Loader: How to select runtime

The in depth descriptions are here: OpenXR® Loader - Design and Operation (with all registered extensions).
Under “Runtime Enumeration” there is a description on how all installed runtimes can be enumerated but there is no information out there which runtimes actually follow this part of the design.

The short version is:

On Linux the lowest priority is the active_runtime.json file in system wide xdg directories such as

ln -sf ~/monado/build/openxr_monado-dev.json /etc/xdg/openxr/1/active_runtime.json
ln -sf ~/.steam/steam/steamapps/common/SteamVR/steamxr_linux64.json ~/.config/openxr/1/active_runtime.json

The xdg directory in the user’s home directory takes precedence so that any user can override system wide settings locally. Noteworthy is that this does not apply to applications run with sudo/suid or that have capabilities allowing them elevated privileges, e.g. if you ran setcap cap_sys_nice+ep on an executable (this mirrors the behavior of the vulkan loader and icd files in ~/.config/vulkan/icd.d).

ln -sf ~/monado/build/openxr_monado-dev.json ~/.config/openxr/1/active_runtime.json
ln -sf ~/.steam/steam/steamapps/common/SteamVR/steamxr_linux64.json ~/.config/openxr/1/active_runtime.json

Lastly the environment variable XR_RUNTIME_JSON takes the highest priority.

XR_RUNTIME_JSON=~/monado/build/openxr_monado-dev.json
XR_RUNTIME_JSON=~/.steam/steam/steamapps/common/SteamVR/steamxr_linux64.json

On windows there’s also the registry involved.

There also are some independent GUI tools not developed or endorsed by Khronos:

https://gitlab.freedesktop.org/ryan.pavlik/xr-chooser
https://github.com/maluoi/openxr-explorer

That’s basically the state of things as it is now.

The last thing that should be mentioned is that the environment variable XR_LOADER_DEBUG=all will cause the loader to output some information about the runtime loading process.