VR: Difference between revisions

m Fix the WiVRn spacing again?
Haruki7049 (talk | contribs)
Add translate tags
Line 1: Line 1:
<translate>
== Monado ==
== Monado ==


Line 4: Line 5:


Monado can be configured using its NixOS options since 24.05:
Monado can be configured using its NixOS options since 24.05:
</translate>


{{file|/etc/nixos/configuration.nix|nix|3=services.monado = {
{{file|/etc/nixos/configuration.nix|nix|3=services.monado = {
Line 10: Line 12:
};}}
};}}


<translate>
In order to configure Monado, you might want to add additional environment variables:
In order to configure Monado, you might want to add additional environment variables:
</translate>


{{file|/etc/nixos/configuration.nix|nix|3=systemd.user.services.monado.environment = {
{{file|/etc/nixos/configuration.nix|nix|3=systemd.user.services.monado.environment = {
Line 17: Line 21:
};}}
};}}


<translate>
=== Hand Tracking ===
=== Hand Tracking ===


Line 22: Line 27:


To disable hand tracking, modify the environment variable to include <code>WMR_HANDTRACKING = "0";</code>, so that it will look like this.
To disable hand tracking, modify the environment variable to include <code>WMR_HANDTRACKING = "0";</code>, so that it will look like this.
</translate>


{{file|/etc/nixos/configuration.nix|nix|3=systemd.user.services.monado.environment = {
{{file|/etc/nixos/configuration.nix|nix|3=systemd.user.services.monado.environment = {
Line 29: Line 35:
};}}
};}}


<translate>
To get hand tracking to work, you require <code>git-lfs</code> to be enabled.  The standard way of enabling <code>git-lfs</code> is through the configuration below
To get hand tracking to work, you require <code>git-lfs</code> to be enabled.  The standard way of enabling <code>git-lfs</code> is through the configuration below
</translate>
{{file|/etc/nixos/configuration.nix|nix|3=programs.git = {
{{file|/etc/nixos/configuration.nix|nix|3=programs.git = {
   enable = true;
   enable = true;
Line 35: Line 44:
};}}
};}}


<translate>
After making sure <code>git-lfs</code> is enabled, run these commands and restart <code>monado-service</code>
After making sure <code>git-lfs</code> is enabled, run these commands and restart <code>monado-service</code>
</translate>
{{Commands|
{{Commands|
$ mkdir -p ~/.local/share/monado
$ mkdir -p ~/.local/share/monado
Line 42: Line 54:
}}
}}


 
<translate>
For further information about available environment variables and tweaks, read the [https://lvra.gitlab.io/docs/fossvr/monado/ Linux VR Adventures wiki] and the [https://monado.freedesktop.org/getting-started.html#environment-variables Monado documentation about environment variables]
For further information about available environment variables and tweaks, read the [https://lvra.gitlab.io/docs/fossvr/monado/ Linux VR Adventures wiki] and the [https://monado.freedesktop.org/getting-started.html#environment-variables Monado documentation about environment variables]
</translate>


<translate>
== OpenComposite ==
== OpenComposite ==


Line 56: Line 70:


An example configuration for enabling OpenComposite may look like this:
An example configuration for enabling OpenComposite may look like this:
</translate>


{{file|~/.config/home-manager/home.nix|nix|3=# For Monado:
{{file|~/.config/home-manager/home.nix|nix|3=# For Monado:
Line 83: Line 98:
'';}}
'';}}


<translate>
If you are planning to play any OpenVR game on Steam or OpenXR games through Proton, you will have to use OpenComposite in this manner. In most cases you also have to allow access to the socket path of your OpenXR runtime to Steam's runtime, by using the following launch options for XR applications on Steam: <code>env PRESSURE_VESSEL_FILESYSTEMS_RW=$XDG_RUNTIME_DIR/monado_comp_ipc %command%</code>. This example is for Monado, while other XR runtimes might differ.
If you are planning to play any OpenVR game on Steam or OpenXR games through Proton, you will have to use OpenComposite in this manner. In most cases you also have to allow access to the socket path of your OpenXR runtime to Steam's runtime, by using the following launch options for XR applications on Steam: <code>env PRESSURE_VESSEL_FILESYSTEMS_RW=$XDG_RUNTIME_DIR/monado_comp_ipc %command%</code>. This example is for Monado, while other XR runtimes might differ.
</translate>


<translate>
== WiVRn ==
== WiVRn ==
WiVRn is an OpenXR streaming application built around Monado. It wirelessly connects a standalone VR headset to a Linux computer. If your headset is not wireless, look at [[VR#Monado|Monado]] instead.
WiVRn is an OpenXR streaming application built around Monado. It wirelessly connects a standalone VR headset to a Linux computer. If your headset is not wireless, look at [[VR#Monado|Monado]] instead.
Example usage of the WiVRn module:{{File|/etc/nixos/configuration.nix|nix|3=services.wivrn = {
Example usage of the WiVRn module:
</translate>
 
{{File|/etc/nixos/configuration.nix|nix|3=services.wivrn = {
   enable = true;
   enable = true;
   openFirewall = true;
   openFirewall = true;
Line 122: Line 143:
};}}
};}}


<translate>
Like Monado, you will also have to add the launch argument for WiVRn to allow access to the socket: <code>PRESSURE_VESSEL_FILESYSTEMS_RW=$XDG_RUNTIME_DIR/wivrn/comp_ipc %command%</code>
Like Monado, you will also have to add the launch argument for WiVRn to allow access to the socket: <code>PRESSURE_VESSEL_FILESYSTEMS_RW=$XDG_RUNTIME_DIR/wivrn/comp_ipc %command%</code>
</translate>


<translate>
== Envision ==
== Envision ==
Envision is an orchestrator for the FOSS VR stack. It handles the building and configuration of Monado, WiVRn, OpenComposite, and other utilities of the FOSS VR stack such as the Lighthouse driver, OpenHMD, Survive, and WMR. You can enable it with the Envision module:
Envision is an orchestrator for the FOSS VR stack. It handles the building and configuration of Monado, WiVRn, OpenComposite, and other utilities of the FOSS VR stack such as the Lighthouse driver, OpenHMD, Survive, and WMR. You can enable it with the Envision module:
</translate>
{{File|/etc/nixos/configuration.nix|nix|3=programs.envision = {
{{File|/etc/nixos/configuration.nix|nix|3=programs.envision = {
   enable = true;
   enable = true;
Line 131: Line 157:
};}}
};}}


<translate>
== SteamVR ==
== SteamVR ==
[https://store.steampowered.com/app/250820/SteamVR/ SteamVR] is a proprietary OpenVR runtime with compatibility for OpenXR. It is part of [[Steam]] and doesn't need any additional setup on NixOS apart from enabling Steam.
[https://store.steampowered.com/app/250820/SteamVR/ SteamVR] is a proprietary OpenVR runtime with compatibility for OpenXR. It is part of [[Steam]] and doesn't need any additional setup on NixOS apart from enabling Steam.
Line 139: Line 166:


{{Note|Steam is run in a bubblewrap-based FHS environment. This environment runs Steam in a user namespace, which prevents it from using any capabilities or setuid binaries. This means that asynchronous reprojection can not be used on NixOS, without patching the kernel to remove these restrictions completely. See this [https://github.com/NixOS/nixpkgs/issues/217119 Nixpkgs issue]}}
{{Note|Steam is run in a bubblewrap-based FHS environment. This environment runs Steam in a user namespace, which prevents it from using any capabilities or setuid binaries. This means that asynchronous reprojection can not be used on NixOS, without patching the kernel to remove these restrictions completely. See this [https://github.com/NixOS/nixpkgs/issues/217119 Nixpkgs issue]}}
</translate>


<translate>
=== Patching AMDGPU to allow high priority queues ===
=== Patching AMDGPU to allow high priority queues ===


Line 145: Line 174:


{{Warning|This removes intentional restrictions from the kernel, and it could cause scheduling issues. While it has not been reported that it does cause issues, this should be considered an unsupported configuration.}}
{{Warning|This removes intentional restrictions from the kernel, and it could cause scheduling issues. While it has not been reported that it does cause issues, this should be considered an unsupported configuration.}}
</translate>


<translate>
==== Applying as a NixOS kernel patch ====
==== Applying as a NixOS kernel patch ====


To workaround the <code>CAP_SYS_NICE</code> requirement, we can apply a kernel patch using the following NixOS configuration snippet:
To workaround the <code>CAP_SYS_NICE</code> requirement, we can apply a kernel patch using the following NixOS configuration snippet:
</translate>


{{file|/etc/nixos/configuration.nix|nix|3=boot.kernelPatches = [
{{file|/etc/nixos/configuration.nix|nix|3=boot.kernelPatches = [
Line 162: Line 194:
}}
}}


<translate>
It is also possible to just patch amdgpu and build it as an out-of-tree module, as described in [[Linux_kernel#Patching_a_single_In-tree_kernel_module]]
It is also possible to just patch amdgpu and build it as an out-of-tree module, as described in [[Linux_kernel#Patching_a_single_In-tree_kernel_module]]
</translate>


<translate>
== wlx-overlay-s ==
== wlx-overlay-s ==
[https://github.com/galister/wlx-overlay-s wlx-overlay-s] is a lightweight OpenXR/OpenVR overlay for Wayland and X11 desktops. It works with SteamVR as well as Monado/WiVRn natively.
[https://github.com/galister/wlx-overlay-s wlx-overlay-s] is a lightweight OpenXR/OpenVR overlay for Wayland and X11 desktops. It works with SteamVR as well as Monado/WiVRn natively.
</translate>


<translate>
==== SteamVR autostart ====
==== SteamVR autostart ====
When launching wlx-overlay-s in SteamVR (or any OpenVR compositor) it will register an autostart manifest. Currently, this manifest will reference a Nix store path of wlx-overlay-s, which might get garbage collected after rebuilds of your NixOS/Nix profile. A workaround is to regularly run the following command to update the manifest's store path:{{Commands|
When launching wlx-overlay-s in SteamVR (or any OpenVR compositor) it will register an autostart manifest. Currently, this manifest will reference a Nix store path of wlx-overlay-s, which might get garbage collected after rebuilds of your NixOS/Nix profile. A workaround is to regularly run the following command to update the manifest's store path:{{Commands|
# Run wlx-overlay-s and replace any running instance
# Run wlx-overlay-s and replace any running instance
$ wlx-overlay-s --replace}}
$ wlx-overlay-s --replace}}
</translate>
<translate>
== See also ==
== See also ==


Line 178: Line 218:
[[Category:Desktop]]
[[Category:Desktop]]
[[Category:Gaming]]
[[Category:Gaming]]
</translate>