Immersive Visualization / IQ-Station Wiki

This site hosts information on virtual reality systems that are geared toward scientific visualization, and as such often toward VR on Linux-based systems. Thus, pages here cover various software (and sometimes hardware) technologies that enable virtual reality operation on Linux.

The original IQ-station effort was to create low-cost (for the time) VR systems making use of 3DTV displays to produce CAVE/Fishtank-style VR displays. That effort pre-dated the rise of the consumer HMD VR systems, however, the realm of midrange-cost large-fishtank systems is still important, and has transitioned from 3DTV-based systems to short-throw projectors.

Monado

From IQ-Station Wiki
Jump to navigation Jump to search

Monado OpenXR Runtime

Monado is an open-source tool that provides an OpenXR runtime environment for Linux (and Android) systems. These are the steps I took to get it compiled on an RHEL-based Linux distribution.

Package Dependencies

Monado uses Vulkan for rendering, so the primary Vulkan packages must be installed. There are several others as well, many of which will already be installed in a typical Linux development system. These are the additional packages that I had to install (for RHEL-based distro):

  • mesa-vulkan-devel.x86_64
  • vulkan-loader-devel.x86_64
  • vulkan-tools.x86_64 (Optional)
  • hidapi-devel.x86_64
  • systemd-devel.x86_64 (for the Debian/Ubuntu equivalent of libudev-dev)
  • glslang (I had to compile this by hand)

As noted, there was no package for glslang, so I cloned it from:

and used CMake to build and install it; and made a "module" file to load it.


The full list of dependencies from a Debian/Ubuntu perspective are available at the Monado gitlab page:

Building Monado

Monado is available via git clone as:

% git clone https://gitlab.freedesktop.org/monado/monado.git

I set the CMAKE_BUILD_TYPE to Release, and also set CMAKE_INSTALL_PREFIX to a separate directory where I will have Monado installed. (I use the "Module" system, so I do not put installations in a mixed system directory, which makes it easier to work with multiple versions.)

Monado then built cleanly with the standard make and make install operations:

% cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=<install-dir> <source-dir> 
[...]
% make
[...]
% make install
[...]

Running the Monado OpenXR Runtime

Once Monado is built and installed, there are a handful of tools available in the bin directory. The tool that is the OpenXR runtime is:

% monado-service

The monado-service tool will then search for VR input devices, GPUs, and VR display devices. Messages will generally be reported regarding each of these searches.

In the general test case (i.e. prior to connecting an HMD), Monado will create a Dummy HMD as the default.

To quit monado, simply hit Enter in the shell in which it is run. (It is possible to setup Monado as a service, but running in a shell is the simple method.)

There are several environment variables that can be set which influence the operation of Monado. The list of those settings can be found on the Monado Getting Started page (envvars).

As mentioned above, I use the Environment Modules system to control which particular versions of various tools are currently enabled via the PATH and other system environment variables. So before running monado-service I first load the Monado module:

% module load monado
Monado version 20220223 loaded.
% monado-service
[...]

OpenXR Applications

You can now run Applications compiled with the OpenXR SDK. To inform such applications of the presence of the Monado runtime, the XR_RUNTIME_JSON environment variable should be set to point to a JSON configurattion file (e.g. active_runtime.json). That file sets particular parameters of the runtime, such as where to find the libopenxr_monado.so shared-object file.

Running an OpenXR application will now appear in the Monado runtime rendering window:

% export XR_RUNTIME_JSON=/home/myhome/MonadoInstallDir/etc/xdg/openxr/1/active_runtime.json
% hello_xr -g OpenGL -ff hmd

Building OpenXR

I have a separate Wiki entry for OpenXR.

Obtaining OpenXR Applications

To my knowledge, there are not (yet) many widely available OpenXR applications available for Linux. Here are three applications I'm aware of:

  • HelloXR — a test program provided by the OpenXR-SDK
  • Godot game engine — I have not personally tried this
  • VTK — well, this isn't working yet, but hopefully will be soon.

Caveats

  • I actually have not yet worked on setting up tracking for Monado, and so thus far have only confirmed that the rendering works.

See Also