VR: Difference between revisions

Ardenet (talk | contribs)
Adjust tranlate tag's placement
Pandapip1 (talk | contribs)
m Mark OC as unmaintained
 
(10 intermediate revisions by 8 users not shown)
Line 81: Line 81:


<!--T:12-->
<!--T:12-->
Note: OpenComposite is unmaintained. We recommend using [https://github.com/Supreeeme/xrizer xrizer] instead.
[https://gitlab.com/znixian/OpenOVR OpenComposite] is a compatibility layer for running OpenVR applications on an OpenXR runtime like Monado. It is comparable to tools like DXVK or vkd3d, but for translating OpenVR calls to OpenXR.
[https://gitlab.com/znixian/OpenOVR OpenComposite] is a compatibility layer for running OpenVR applications on an OpenXR runtime like Monado. It is comparable to tools like DXVK or vkd3d, but for translating OpenVR calls to OpenXR.


Line 139: Line 141:
   enable = true;
   enable = true;
   openFirewall = true;
   openFirewall = true;
  # Write information to /etc/xdg/openxr/1/active_runtime.json, VR applications
  # will automatically read this and work with WiVRn (Note: This does not currently
  # apply for games run in Valve's Proton)
    defaultRuntime = true;


   # Run WiVRn as a systemd service on startup
   # Run WiVRn as a systemd service on startup
   autoStart = true;
   autoStart = true;


   # Config for WiVRn (https://github.com/WiVRn/WiVRn/blob/master/docs/configuration.md)
   # If you're running this with an nVidia GPU and want to use GPU Encoding (and don't otherwise have CUDA enabled system wide), you need to override the cudaSupport variable.
  config = {
  package = (pkgs.wivrn.override { cudaSupport = true; });
    enable = true;
 
    json = {
  # You should use the default configuration (which is no configuration), as that works the best out of the box.
      # 1.0x foveation scaling
  # However, if you need to configure something see https://github.com/WiVRn/WiVRn/blob/master/docs/configuration.md for configuration options and https://mynixos.com/nixpkgs/option/services.wivrn.config.json for an example configuration.
      scale = 1.0;
};|name=configuration.nix|lang=nix}}
      # 100 Mb/s
      bitrate = 100000000;
      encoders = [
        {
          encoder = "vaapi";
          codec = "h265";
          # 1.0 x 1.0 scaling
          width = 1.0;
          height = 1.0;
          offset_x = 0.0;
          offset_y = 0.0;
        }
      ];
    };
  };
};}}


<translate>
<translate>
Line 233: Line 214:
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]]


=== Patching bubblewrap to allow capabilities ===
=== Patching bubblewrap to allow capabilities === <!--T:43-->
 
<!--T:44-->
By modifying the bubblewrap binary used for running Steam, you can allow processes in that FHS environment to acquire capabilities. This removes the need for patching the kernel directly. This may become unnecessary if [https://github.com/containers/bubblewrap/issues/653 bubblewrap #653] is merged and the flag is added to Steam's tooling.


By modifying the bubblewrap binary used for running Steam, you can allow processes in that FHS environment to acquire capabilities. This removes the need for patching the kernel directly.
'''As of 2026-05, this may no longer be viable:''' Steam now aggressively restores its own pressure vessel srt-bwrap on startup, however deleting <code>~/.local/share/Steam/</code> has been [https://discourse.nixos.org/t/steam-fails-to-launch-with-patched-bwrap/75167 reported] to help.
</translate>
</translate>


{{Warning|<translate>This circumvents an intended security mechanism in bubblewrap, and allows all other software launched by steam, or running via steam-run to acquire these capabilities as well.</translate>}}
{{Warning|<translate><!--T:45--> This circumvents an intended security mechanism in bubblewrap, and allows all other software launched by steam, or running via steam-run to acquire these capabilities as well.</translate>}}


{{file|/etc/nixos/configuration.nix|nix|3=programs.steam = let
{{file|/etc/nixos/configuration.nix|nix|3=programs.steam = let
Line 257: Line 241:
};
};
}}
}}
{{file|/etc/nixos/bwrap.patch|diff|3=diff --git a/bubblewrap.c b/bubblewrap.c
{{file|3=diff --git a/bubblewrap.c b/bubblewrap.c
index 8322ea0..4e20262 100644
index f8728c7..42cfe2e 100644
--- a/bubblewrap.c
--- a/bubblewrap.c
+++ b/bubblewrap.c
+++ b/bubblewrap.c
@@ -868,13 +868,6 @@ acquire_privs (void)
@@ -876,13 +876,6 @@ acquire_privs (void)
       /* Keep only the required capabilities for setup */
       /* Keep only the required capabilities for setup */
       set_required_caps ();
       set_required_caps ();
Line 275: Line 259:
     {
     {
       /* If our uid is 0, default to inheriting all caps; the caller
       /* If our uid is 0, default to inheriting all caps; the caller
}}
|name=bwrap.patch|lang=diff}}


<translate>
<translate>
<!--T:46-->
as an additional change, you may also need to replace Steam's own bwrap binary with a symbolic link to this modified bwrap binary, found at <code>~/.local/share/Steam/ubuntu12_32/steam-runtime/usr/libexec/steam-runtime-tools-0/srt-bwrap</code>.
as an additional change, you may also need to replace Steam's own bwrap binary with a symbolic link to this modified bwrap binary, found at <code>~/.local/share/Steam/ubuntu12_32/steam-runtime/usr/libexec/steam-runtime-tools-0/srt-bwrap</code>.


<!--T:47-->
Steam will periodically replace this modification with its own binary when steam-runtime updates, so you may need to re-apply this change if it breaks.
Steam will periodically replace this modification with its own binary when steam-runtime updates, so you may need to re-apply this change if it breaks.
=== Setting SteamVR as default OpenXR runtime ===
To set SteamVR as the default OpenXR runtime, you have to add the following snippet to your Home Manager config:
{{file|/etc/nixos/configuration.nix|nix|3=xdg.configFile."openxr/1/active_runtime.json".text = ''
  {
    "file_format_version": "1.0.0",
      "runtime": {
      "VALVE_runtime_is_steamvr": true,
      "library_path": "${config.home.homeDirectory}/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrclient.so",
      "name": "SteamVR"
      }
  }
  '';
}}


== wlx-overlay-s == <!--T:31-->
== wlx-overlay-s == <!--T:31-->
Line 294: Line 296:


{{Commands|
{{Commands|
# <translate>Run wlx-overlay-s and replace any running instance</translate>
# <translate><!--T:48--> Run wlx-overlay-s and replace any running instance</translate>
$ wlx-overlay-s --replace}}
$ wlx-overlay-s --replace}}


Line 303: Line 305:
* [https://lvra.gitlab.io Linux VR Adventures Wiki]
* [https://lvra.gitlab.io Linux VR Adventures Wiki]


<!--T:49-->
[[Category:Video]]
[[Category:Video]]
[[Category:Hardware]]
[[Category:Hardware]]