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"
m (Fixed a mistake with CMake arguments) |
(Updated the applications list, also added the Debian/Ubuntu package needs) |
||
(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 8: | Line 8: | ||
Monado uses Vulkan for rendering, so the primary Vulkan packages must be installed. | 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. | There are several others as well, many of which will already be installed in a typical Linux development system. | ||
===RHEL-based distro additional packages=== | |||
These are the ''additional'' packages that I had to install (for RHEL-based distro): | These are the ''additional'' packages that I had to install (for RHEL-based distro): | ||
* mesa-vulkan-devel.x86_64 | * mesa-vulkan-devel.x86_64 | ||
Line 18: | Line 20: | ||
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] | ||
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. | ||
===Debian/Ubuntu-based distro additional packages=== | |||
For Debian, Ubuntu and related distros, the packages will have these names: | |||
* mesa-vulkan-drivers | |||
* libvulkan-dev | |||
* vulkan-tools | |||
* libhidapi-dev | |||
* libudev-dev | |||
* glslang-tools | |||
* glslang-dev | |||
* xr-hardware — this package adds new <TT>udev-rules</TT> that give users permission to access VR hardware | |||
Line 49: | Line 62: | ||
% make install | % make install | ||
[...] | [...] | ||
</syntaxhighlight> | |||
===Minor modification for systems with <TT>ldd</TT> version < 2.30=== | |||
When compiling on a system that has a version of the <TT>ldd</TT> shared-object printer | |||
earlier than version 2.30 (which actually means your dynamic loader is older), then | |||
the following code change is required: | |||
<syntaxhighlight> | |||
% vi .../monado/src/xrt/auxiliary/util/u_linux.c | |||
[add: #include <sys/syscall.h>] | |||
[remove: snprintf(str, count, "tid(%i)", gettid());] | |||
[add: snprintf(str, count, "tid(%i)", (int)syscall(SYS_gettid));] | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 69: | Line 92: | ||
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 78: | Line 102: | ||
=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 | 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 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 93: | Line 119: | ||
==Obtaining OpenXR Applications== | ==Obtaining OpenXR Applications== | ||
To my knowledge, there are not (yet) many widely available OpenXR applications available for Linux. | To my knowledge, there are not (yet) many widely available OpenXR applications available for Linux. | ||
Here are | Here are some applications I'm aware of: | ||
* HelloXR — a test program provided by the OpenXR-SDK | * HelloXR — a test program provided by the OpenXR-SDK | ||
* [https://godotengine.org/article/godot-openxr-support Godot game engine] — I have not | * [https://vtk.org VTK] | ||
* [ | * [https://paraview.org ParaView] | ||
* [https://blender.org Blender] — I have not yet tried this | |||
* [https://godotengine.org/article/godot-openxr-support Godot game engine] — I have not yes tried this | |||
* I also am in the process of porting my [http://freevr.org/tutorials.html FreeVR Tutorial suite] to OpenXR | |||
* Plus I am in the process of porting my ANARI-FreeVR examples (not yet published) to work directly with OpenXR | |||
=Caveats= | |||
* Presently I can do 6-DOF tracking of my Vive when I compile Monado with [[LibSurvive]], but the tracking by LibSurvive is mediocre. There is a new <TT>steamvr_lh</TT> direct-Lighthouse driver now available, but I have not yet figured out how to configure it to work on my Linux system. | |||
=See Also= | =See Also= |
Latest revision as of 14:32, 15 August 2024
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.
RHEL-based distro additional packages
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.
Debian/Ubuntu-based distro additional packages
For Debian, Ubuntu and related distros, the packages will have these names:
- mesa-vulkan-drivers
- libvulkan-dev
- vulkan-tools
- libhidapi-dev
- libudev-dev
- glslang-tools
- glslang-dev
- xr-hardware — this package adds new udev-rules that give users permission to access VR hardware
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
[...]
Minor modification for systems with ldd version < 2.30
When compiling on a system that has a version of the ldd shared-object printer earlier than version 2.30 (which actually means your dynamic loader is older), then the following code change is required:
% vi .../monado/src/xrt/auxiliary/util/u_linux.c
[add: #include <sys/syscall.h>]
[remove: snprintf(str, count, "tid(%i)", gettid());]
[add: snprintf(str, count, "tid(%i)", (int)syscall(SYS_gettid));]
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 some applications I'm aware of:
- HelloXR — a test program provided by the OpenXR-SDK
- VTK
- ParaView
- Blender — I have not yet tried this
- Godot game engine — I have not yes tried this
- I also am in the process of porting my FreeVR Tutorial suite to OpenXR
- Plus I am in the process of porting my ANARI-FreeVR examples (not yet published) to work directly with OpenXR
Caveats
- Presently I can do 6-DOF tracking of my Vive when I compile Monado with LibSurvive, but the tracking by LibSurvive is mediocre. There is a new steamvr_lh direct-Lighthouse driver now available, but I have not yet figured out how to configure it to work on my Linux system.