protonscr

Feature Request: Monado OpenXR runtime intercompatibility

protonclosed Feature Request
ValveSoftware/Proton#6038 · opened 2022-07-28 by Supreeeme · updated 2024-02-06 · 12 comments · github
1 matching comments, n / p to jump
SSupreeeme 2022-07-28 github

Feature Request

I confirm:

  • [x] that I haven't found another request for this feature.
  • [x] that I have checked whether there are updates for my system available that
    contain this feature already.

Description

From my testing, the wineopenxr module reads from three registry keys that I assume are directly set by SteamVR (since I can't find any reference to the keys anywhere else within Proton) to get info from the OpenXR runtime: state, openxr_vulkan_instance_extensions, and openxr_vulkan_device_extensions. If I set these keys in the prefix of an OpenXR game (as well as disable the steam runtime), I can get OpenXR apps to work with Monado, another Linux OpenXR runtime. Obviously you wouldn't want users having to set these registry keys for every OpenXR game, so it would be beneficial to have a way of reading the info these keys relay directly from the runtime.

For the instance and device extension keys, I imagine it would be as simple as requesting the extensions from the runtime directly. The state key is a bit different in that it seems to exist to avoid a SteamVR bug where xrCreateInstance hangs if SteamVR is not running, but I imagine this can be worked around by just trying to create an instance and failing after a timeout. I could get these things into a pull request myself, but I'm sure I'm missing some context, namely why instance and device extensions need to be put into a registry key rather than queried directly, so I'd appreciate any guidance in that area.

Kkisak-valve maintainer 2022-07-28 github

Hello @Supreeeme, this feature request reads like it's written from a suboptimal perspective. Instead of asking for a manual bypass, this request should be generalized to ask for OpenXR applications to just work out of the box with Monado if that's what the default OpenXR runtime is set to on the host system.

SSupreeeme 2022-07-28 github

Yes, sorry, that's how I intended it. My point was right now Proton does things specifically for SteamVR and those things don't work if you have the runtime set to Monado, or presumably any other non-SteamVR OpenXR runtime.

DDa-Boom 2022-08-04 github

I would also like to express my support of this request - SteamVR is not as performant or reliable on Linux as Monado at this point , and feels somewhat neglected. So for titles that run in proton, I would like to be able to use Monado instead of steamVR, at least until your steamVR team at valve gets its act together regarding Linux.

BBitwolfies 2022-08-08 github

Would be kinda neat to see valve contribute to monado and use it over the current OpenXR runtime that steam provides, but thats neither here nor there.

TT-X 2023-04-17 github

Hi @Supreeeme. I'm also trying to get a game working via Lutris -> Proton-GE (7-35) -> OpenXR -> Monado, namely the DCS World Beta which supposedly has OpenXR support: https://forum.dcs.world/topic/318004-dcs-now-supports-openxr-natively/

But even with:

$ ln -s /usr/share/openxr/1/openxr_monado.json ~/.config/openxr/1/active_runtime.json
$ cat ~/.config/openxr/1/active_runtime.json
{
    "file_format_version": "1.0.0",
    "runtime": {
        "library_path": "../../../lib/libopenxr_monado.so"
    }
}

I see no BEGIN_SESSION or any reaction on "XRT_COMPOSITOR_LOG=debug monado-service" when I start DCS World Beta.

How did you set these registry keys, in which path and to which values did you set them? Via Lutris and the game's "Wine Registry" menu I can't find neither "state", "openxr_vulkan_instance_extensions" nor "openxr_vulkan_device_extensions".

The "hello_xr" application from the libopenxr-utils package on Debian Sid works fine for me via monado-service. Which windows OpenXR apps were you able to run through Proton + Monado? Any non-steam, standalone, small OpenXR windows demo apps you can recommend for first tries?


It seems that people were able to get DCS World running via Steam -> Proton -> OpenVR -> OpenOVR -> OpenXR -> Monado: https://github.com/ValveSoftware/Proton/issues/1722#issuecomment-1304850881

But it would be great to be able to skip the OpenOVR layer for OpenVR to OpenXR translation. Especially as Monado is directly available on Debian while OpenOVR is not and would need a manual installation.


Edit: The error I'm seeing from Proton on the console is the following when I try to run DCS World Beta:

...
Error [GENERAL |  | OpenXR-Loader] : RuntimeManifestFile::FindManifestFiles - failed to find active runtime file in registry
Error [GENERAL | xrEnumerateInstanceExtensionProperties | OpenXR-Loader] : RuntimeInterface::LoadRuntimes - unknown error
Error [GENERAL | xrEnumerateInstanceExtensionProperties | OpenXR-Loader] : RuntimeInterface::LoadRuntimes - failed to load a runtime
Error [GENERAL | xrEnumerateInstanceExtensionProperties | OpenXR-Loader] : Failed to find default runtime with RuntimeInterface::LoadRuntime()
Error [GENERAL | xrEnumerateInstanceExtensionProperties | OpenXR-Loader] : Failed querying extension properties
Error [GENERAL |  | OpenXR-Loader] : RuntimeManifestFile::FindManifestFiles - failed to find active runtime file in registry
Error [GENERAL | xrEnumerateInstanceExtensionProperties | OpenXR-Loader] : RuntimeInterface::LoadRuntimes - unknown error
Error [GENERAL | xrEnumerateInstanceExtensionProperties | OpenXR-Loader] : RuntimeInterface::LoadRuntimes - failed to load a runtime
Error [GENERAL | xrEnumerateInstanceExtensionProperties | OpenXR-Loader] : Failed to find default runtime with RuntimeInterface::LoadRuntime()
Error [GENERAL | xrEnumerateInstanceExtensionProperties | OpenXR-Loader] : Failed querying extension properties
...

So this seems indeed related to the missing registry keys?

TT-X 2023-04-19 github

Maybe @aeikum / @ColdPie1 or @gofmanpe, who seem to have worked on the OpenXR implementation in Proton and DXVK, might have some ideas on what would need to be done for this ticket? (and many thanks to you guys for your work on this so far!)

Ffarmboy0 2023-05-23 github

@T-X Could you try to change the relative path in active_runtime.json to be pointing to the library relative to ~/.config/openxr/1. The path you have when you just link to the file in /usr/share/... should not be valid from ~/.config/openxr/1.

TT-X 2023-06-13 github

@farmboy0 I don't quite understand your remark. hello_xr works fine with what's set in my ~/.config/openxr/1/active_runtime.json / the ~/.local/share/openxr/1/openxr_monado.json it symlinks to.

Also I was now able to manually configure everything in a Lutris installed OpenXR game. And have documented the steps I needed here: https://github.com/TheZoq2/dcs_on_linux/issues/26#issuecomment-1528227256.

So I guess the ultimate goal of this ticket would be to make all these extra steps superfluous?

Ffarmboy0 2023-06-13 github

@T-X The problem is that proton runs in a container, so its not quite the same as running wine standalone. And to make the container work with monado you need to make sure the container can see everything you need to comminucate with Monado which runs outside the container.

SSupreeeme 2023-06-14 github

I'm gonna close this because I've already solved my usecase:
This commit enables OpenXR games to launch without SteamVR through Monado + OpenComposite. Note that although OpenComposite is for OpenVR games, Proton uses OpenVR to initialize OpenXR games, so that is the only time OpenComposite will be active (during initialization). There are some other issues with using OpenComposite (specifically if you set it as your openvr runtime and try to play a non-VR game) but those are OpenComposite issues, not Proton.

CCoreforge 2024-02-04 github

Did you have to take any extra steps to get proton to use monado with OpenComposite installed? OpenComposite initializes properly for me, but wineopenxr still fails to load the xr runtime

0128:trace:vrclient:DllMain (0x7fbcb9330000, 1, (nil))
0128:trace:vrclient:VRClientCoreFactory name: IVRClientCore_003, return_code: 0x10f1e0
0128:trace:vrclient:load_vrclient got openvr runtime path: /home/ich/pi/steam/OpenComposite/bin/linux64/vrclient.so
[OC] Config:231 	 Checking for app specific config file...
[OC] wini_parse:172 	 No config file found at /media/DnD/Steam/steamapps/common/Beat Saber_new/opencomposite.ini
0128:trace:vrclient:get_winevulkan_unixlib path /home/ich/.steam/compatibilitytools.d/GE-Proton8-30/files/lib64/wine/x86_64-unix/winevulkan.so.
[OC] CheckAppEnabled:59 	 [once] Launcher configuration not yet supported on Linux
0128:trace:vrclient:create_win_interface trying to create IVRClientCore_003
0128:trace:vrclient:create_winIVRClientCore_IVRClientCore_003 -> 0x6a5a86c0
0128:trace:vrclient:winIVRClientCore_IVRClientCore_003_Init 0x6a5a86c0
[OC] CreateOpenXRBackend:115 	 Extension: XR_KHR_convert_timespec_time
[OC] CreateOpenXRBackend:115 	 Extension: XR_KHR_opengl_enable
[OC] CreateOpenXRBackend:115 	 Extension: XR_KHR_opengl_es_enable
[OC] CreateOpenXRBackend:115 	 Extension: XR_KHR_vulkan_enable
[OC] CreateOpenXRBackend:115 	 Extension: XR_KHR_vulkan_enable2
[OC] CreateOpenXRBackend:115 	 Extension: XR_KHR_composition_layer_depth
[OC] CreateOpenXRBackend:115 	 Extension: XR_KHR_composition_layer_cylinder
[OC] CreateOpenXRBackend:115 	 Extension: XR_KHR_composition_layer_equirect
[OC] CreateOpenXRBackend:115 	 Extension: XR_KHR_composition_layer_equirect2
[OC] CreateOpenXRBackend:115 	 Extension: XR_EXT_debug_utils
[OC] CreateOpenXRBackend:115 	 Extension: XR_MND_headless
[OC] CreateOpenXRBackend:115 	 Extension: XR_MND_swapchain_usage_input_attachment_bit
[OC] CreateOpenXRBackend:115 	 Extension: XR_EXTX_overlay
[OC] CreateOpenXRBackend:115 	 Extension: XR_MNDX_egl_enable
[OC] CreateOpenXRBackend:115 	 Extension: XR_EXT_hand_tracking
[OC] CreateOpenXRBackend:120 	 Num layers available: 0 
[OC] GetXRAppName:56 	 Setting application name to OpenComposite_wine64-preloader
[OC] parseExtensionsStr:14 	 Str: VK_KHR_external_fence_capabilities VK_KHR_external_memory_capabilities VK_KHR_external_semaphore_capabilities VK_KHR_get_physical_device_properties2
[OC] parseExtensionsStr:30 	 Add extension: VK_KHR_external_fence_capabilities
[OC] parseExtensionsStr:30 	 Add extension: VK_KHR_external_memory_capabilities
[OC] parseExtensionsStr:30 	 Add extension: VK_KHR_external_semaphore_capabilities
[OC] parseExtensionsStr:30 	 Add extension: VK_KHR_get_physical_device_properties2
[OC] parseExtensionsStr:14 	 Str: VK_KHR_dedicated_allocation VK_KHR_external_fence VK_KHR_external_memory VK_KHR_external_semaphore VK_KHR_get_memory_requirements2 VK_KHR_external_memory_fd VK_KHR_external_semaphore_fd VK_KHR_external_fence_fd
[OC] parseExtensionsStr:30 	 Add extension: VK_KHR_dedicated_allocation
[OC] parseExtensionsStr:30 	 Add extension: VK_KHR_external_fence
[OC] parseExtensionsStr:30 	 Add extension: VK_KHR_external_memory
[OC] parseExtensionsStr:30 	 Add extension: VK_KHR_external_semaphore
[OC] parseExtensionsStr:30 	 Add extension: VK_KHR_get_memory_requirements2
[OC] parseExtensionsStr:30 	 Add extension: VK_KHR_external_memory_fd
[OC] parseExtensionsStr:30 	 Add extension: VK_KHR_external_semaphore_fd
[OC] parseExtensionsStr:30 	 Add extension: VK_KHR_external_fence_fd
[OC] SetupSession:284 	 Started OpenXR session on runtime 'Monado: HTC Vive', hand tracking supported: 0
[OC] PumpEvents:754 	 Switch to OpenXR state 1
[OC] PumpEvents:754 	 Switch to OpenXR state 2
[OC] PumpEvents:758 	 Hit ready state, begin session...
0128:trace:vrclient:winIVRClientCore_IVRClientCore_003_GetGenericInterface 0x6a5a86c0
0128:trace:vrclient:ivrclientcore_get_generic_interface 0x7e74f870 0x2ee0d1b63
0128:trace:vrclient:create_win_interface trying to create IVRCompositor_022
0128:trace:vrclient:create_winIVRCompositor_IVRCompositor_022 -> 0x6a5a8780
0128:trace:vrclient:winIVRCompositor_IVRCompositor_022_GetVulkanInstanceExtensionsRequired 0x6a5a8780
0128:trace:vrclient:winIVRCompositor_IVRCompositor_022_GetVulkanInstanceExtensionsRequired 0x6a5a8780
0128:trace:loaddll:build_module Loaded L"C:\\windows\\system32\\wineopenxr.dll" at 00007FBCAE390000: builtin
0128:trace:openxr:__wineopenxr_GetVulkanInstanceExtensions 
0128:err:openxr:get_vulkan_extensions Could not create key, status 0x2.
0128:trace:openxr:__wineopenxr_GetVulkanInstanceExtensions host openxr loader failed to load runtime: -6

SSupreeeme 2024-02-06 github

@Coreforge If I had to guess you're missing the XR_RUNTIME_JSON variable. The OpenComposite readme has a linux specific section going over this. You may also be interested in Envision, which simplifies OpenComposite + Monado setup.

Proton versions

Upstream links

DLLs