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.

Difference between revisions of "Monado"

From IQ-Station Wiki
Jump to navigation Jump to search
(Created page with my recipe for building/using Monado)
 
m (Added link to local OpenXR wiki page + fixed link to glslang)
 
(2 intermediate revisions by the same user not shown)
Line 2: Line 2:
=Monado OpenXR Runtime=
=Monado OpenXR Runtime=


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


Line 18: Line 18:


As noted, there was no package for glslang, so I cloned it from:
As noted, there was no package for glslang, so I cloned it from:
* [[https://github.com/KhronosGroup/glslang https://github.com/KhronosGroup/glslang]]
* [https://github.com/KhronosGroup/glslang https://github.com/KhronosGroup/glslang]
and used CMake to build and install it; and made a "module" file to load it.
and used CMake to build and install it; and made a "module" file to load it.


Line 43: Line 43:


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


==Running the Monado OpenXR Runtime==
==Running the Monado OpenXR Runtime==
Line 68: Line 69:


As mentioned above, I use the [https://modules.readthedocs.io/en/latest Environment Modules] system
As mentioned above, I use the [https://modules.readthedocs.io/en/latest Environment Modules] system
to control which particular versions of various tools are currently enabled via the <TT>PATH</TT> and other system environment variables.  So before running <TT>monado-service</TT> I first load the Monado module:
to control which particular versions of various tools are currently enabled via the <TT>PATH</TT>
and other system environment variables.  So before running <TT>monado-service</TT> I first load the Monado module:
<syntaxhighlight>
<syntaxhighlight>
% module load monado
% module load monado
Line 77: Line 79:


=OpenXR Applications=
=OpenXR Applications=
You can now run Applications compiled with the OpenXR SDK.  To inform such applications of the presence of the Monado runtime, the <TT>XR_RUNTIME_JSON</TT> environment variable should be set to point to the directory where the file <TT>active_runtime.json</TT> should be present. That file sets particular parameters of the runtime, such as where to find the <TT>libopenxr_monado.so</TT> shared-object file.
You can now run Applications compiled with the OpenXR SDK.  To inform such applications
 
of the presence of the Monado runtime, the <TT>XR_RUNTIME_JSON</TT> environment variable
[ASIDE: why the environment variable doesn't just directly point to the config file?  I don't know.]
should be set to point to a JSON configurattion file (e.g. <TT>active_runtime.json</TT>).
That file sets particular parameters of the runtime, such as where to find the
<TT>libopenxr_monado.so</TT> shared-object file.


Running an OpenXR application will now appear in the Monado runtime rendering window:
Running an OpenXR application will now appear in the Monado runtime rendering window:
<syntaxhighlight>
<syntaxhighlight>
% export XR_RUNTIME_JSON=/home/myhome/MonadoInstallDir/etc/xdg/openxr/1
% export XR_RUNTIME_JSON=/home/myhome/MonadoInstallDir/etc/xdg/openxr/1/active_runtime.json
% hello_xr -g OpenGL -ff hmd
% hello_xr -g OpenGL -ff hmd
</syntaxhighlight>
</syntaxhighlight>
Line 96: Line 100:
* [https://godotengine.org/article/godot-openxr-support Godot game engine] &mdash; I have not personally tried this
* [https://godotengine.org/article/godot-openxr-support Godot game engine] &mdash; I have not personally tried this
* [https://vtk.org VTK] &mdash; well, this isn't working yet, but hopefully will be soon.
* [https://vtk.org VTK] &mdash; 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=
=See Also=

Latest revision as of 11:35, 8 April 2022

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