Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug OpenXR crash with Vive Cosmos: "Loading plugin UnityOpenXR for subsystem OpenXR Input...Crash!!!"

Discussion in 'VR' started by Charlicopter, Jan 10, 2022.

  1. Charlicopter

    Charlicopter

    Joined:
    May 15, 2017
    Posts:
    123
    ==== Start Unity OpenXR Diagnostic Report ====


    [XR] [18060] [18:10:49.915][Info ] ==== Report Reason: System Shutdown ====


    [XR] [18060] [18:10:49.915][Info ] ==== OpenXR Support Details ====
    [XR] [18060] [18:10:49.915][Info ] OpenXR Runtime:
    [XR] [18060] [18:10:49.915][Info ] UNKNOWN COMPANY, which is not a Unity supported partner
    [XR] [18060] [18:10:49.915][Info ] Unity OpenXR Features:
    [XR] [18060] [18:10:49.915][Info ] HTCViveControllerProfile Standalone, KHRSimpleControllerProfile Standalone, OculusTouchControllerProfile Standalone, RuntimeDebuggerOpenXRFeature Standalone, ValveIndexControllerProfile Standalone: Unity
    [XR] [18060] [18:10:49.915][Info ] Unity Support:
    [XR] [18060] [18:10:49.915][Info ] Unity doesn't support some aspects of the runtime and Unity OpenXR Features above. Please attempt to reproduce the issue with only Unity supported aspects before submitting an issue to Unity.
    [XR] [18060] [18:10:49.915][Info ]
    [XR] [18060] [18:10:49.915][Info ] ==== OpenXR Init Info ====
    [XR] [18060] [18:10:49.915][Info ]
    [XR] [18060] [18:10:49.915][Info ] Stage 1 Missing Entry Points: (1)
    [XR] [18060] [18:10:49.915][Info ] xrInitializeLoaderKHR
    [XR] [18060] [18:10:49.915][Info ]
    [XR] [18060] [18:10:49.915][Info ] Stage 2 Missing Entry Points: (9)
    [XR] [18060] [18:10:49.915][Info ] xrGetD3D12GraphicsRequirementsKHR
    [XR] [18060] [18:10:49.915][Info ] xrGetVulkanInstanceExtensionsKHR
    [XR] [18060] [18:10:49.915][Info ] xrGetVulkanDeviceExtensionsKHR
    [XR] [18060] [18:10:49.915][Info ] xrGetVulkanGraphicsDeviceKHR
    [XR] [18060] [18:10:49.915][Info ] xrGetVulkanGraphicsRequirementsKHR
    [XR] [18060] [18:10:49.915][Info ] xrCreateVulkanInstanceKHR
    [XR] [18060] [18:10:49.915][Info ] xrCreateVulkanDeviceKHR
    [XR] [18060] [18:10:49.915][Info ] xrGetVulkanGraphicsDevice2KHR
    [XR] [18060] [18:10:49.915][Info ] xrGetVulkanGraphicsRequirements2KHR
    [XR] [18060] [18:10:49.915][Info ]
    [XR] [18060] [18:10:49.915][Info ] ==== OpenXR Provider Info ====
    [XR] [18060] [18:10:49.915][Info ] Spec Version: 1.0.17
    [XR] [18060] [18:10:49.915][Info ] Provider Version: 1.2.8
    [XR] [18060] [18:10:49.915][Info ] App: ArcSine 0.1.237 #1783486116
    [XR] [18060] [18:10:49.915][Info ] Engine: 2021.1.25f1 #1594624545
    [XR] [18060] [18:10:49.915][Info ]
    [XR] [18060] [18:10:49.916][Info ] ==== OpenXR Runtime Info ====
    [XR] [18060] [18:10:49.916][Info ]
    [XR] [18060] [18:10:49.916][Info ] Features requested to be enabled: 5
    [XR] [18060] [18:10:49.916][Info ] Name=HTC Vive Controller Profile Extension=NA Version=0.0.1
    [XR] [18060] [18:10:49.916][Info ] Name=Khronos Simple Controller Profile Extension=NA Version=0.0.1
    [XR] [18060] [18:10:49.916][Info ] Name=Oculus Touch Controller Profile Extension=NA Version=0.0.1
    [XR] [18060] [18:10:49.916][Info ] Name=Runtime Debugger Extension=NA Version=1
    [XR] [18060] [18:10:49.916][Info ] Name=Valve Index Controller Profile Extension=NA Version=0.0.1
    [XR] [18060] [18:10:49.916][Info ]
    [XR] [18060] [18:10:49.916][Info ] Features with extensions that failed to be enabled: 0
    [XR] [18060] [18:10:49.916][Info ]
    [XR] [18060] [18:10:49.916][Info ] Available Extensions: (10)
    [XR] [18060] [18:10:49.916][Info ] Name=XR_KHR_D3D11_enable SpecVersion=5
    [XR] [18060] [18:10:49.916][Info ] Name=XR_KHR_D3D12_enable SpecVersion=7
    [XR] [18060] [18:10:49.916][Info ] Name=XR_KHR_win32_convert_performance_counter_time SpecVersion=1
    [XR] [18060] [18:10:49.916][Info ] Name=XR_KHR_visibility_mask SpecVersion=2
    [XR] [18060] [18:10:49.916][Info ] Name=XR_HTC_vive_cosmos_controller_interaction SpecVersion=1
    [XR] [18060] [18:10:49.916][Info ] Name=XR_KHR_opengl_enable SpecVersion=9
    [XR] [18060] [18:10:49.916][Info ] Name=XR_KHR_vulkan_enable SpecVersion=8
    [XR] [18060] [18:10:49.916][Info ] Name=XR_KHR_vulkan_enable2 SpecVersion=2
    [XR] [18060] [18:10:49.916][Info ] Name=XR_EXT_debug_utils SpecVersion=4
    [XR] [18060] [18:10:49.916][Info ] Name=XR_KHR_convert_timespec_time SpecVersion=1
    [XR] [18060] [18:10:49.916][Info ]
    [XR] [18060] [18:10:49.916][Info ] Available Layers: (0)
    [XR] [18060] [18:10:49.916][Info ]
    [XR] [18060] [18:10:49.916][Info ] Runtime Name: Vive Reality Runtime
    [XR] [18060] [18:10:49.916][Info ] Runtime Version: 0.0.1
    [XR] [18060] [18:10:49.916][Info ]
    [XR] [18060] [18:10:49.916][Info ] Form factor: XR_FORM_FACTOR_HEAD_MOUNTED_DISPLAY
    [XR] [18060] [18:10:49.916][Info ]
    [XR] [18060] [18:10:49.916][Info ] Spec extensions enabled: (3)
    [XR] [18060] [18:10:49.916][Info ] Name=XR_KHR_D3D11_enable Version=5
    [XR] [18060] [18:10:49.916][Info ] Name=XR_KHR_visibility_mask Version=2
    [XR] [18060] [18:10:49.916][Info ] Name=XR_KHR_win32_convert_performance_counter_time Version=1
    [XR] [18060] [18:10:49.916][Info ]
    [XR] [18060] [18:10:49.916][Info ] Available Reference Spaces: (3)
    [XR] [18060] [18:10:49.916][Info ] Name: XR_REFERENCE_SPACE_TYPE_VIEW
    [XR] [18060] [18:10:49.916][Info ] Name: XR_REFERENCE_SPACE_TYPE_LOCAL
    [XR] [18060] [18:10:49.916][Info ] Name: XR_REFERENCE_SPACE_TYPE_STAGE
    [XR] [18060] [18:10:49.916][Info ]
    [XR] [18060] [18:10:49.916][Info ] Instance Id : 0x6c5c0020
    [XR] [18060] [18:10:49.916][Info ] System Id : 0x10f447
    [XR] [18060] [18:10:49.916][Info ] Session Id : 0x6c5828e0
    [XR] [18060] [18:10:49.916][Info ]
    [XR] [18060] [18:10:49.916][Info ] Available View Configuration Types: (1)
    [XR] [18060] [18:10:49.916][Info ] View Configuration Type: XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO (Selected) View configuration FovMutable=False
    [XR] [18060] [18:10:49.916][Info ] View [0]: Recommended Width=2016 Height=2380 SampleCount=1
    [XR] [18060] [18:10:49.916][Info ] View [0]: Maximum Width=2016 Height=2380 SampleCount=1
    [XR] [18060] [18:10:49.916][Info ] View [1]: Recommended Width=2016 Height=2380 SampleCount=1
    [XR] [18060] [18:10:49.916][Info ] View [1]: Maximum Width=2016 Height=2380 SampleCount=1
    [XR] [18060] [18:10:49.916][Info ]
    [XR] [18060] [18:10:49.916][Info ] Available Environment Blend Mode: (2)
    [XR] [18060] [18:10:49.916][Info ] Environment Blend Mode (XR_ENVIRONMENT_BLEND_MODE_OPAQUE) : (Selected)
    [XR] [18060] [18:10:49.916][Info ] Environment Blend Mode (XR_ENVIRONMENT_BLEND_MODE_ALPHA_BLEND) :
    [XR] [18060] [18:10:49.916][Info ]
    [XR] [18060] [18:10:49.916][Info ] System Properties: Name=Vive Reality system VendorId=2996
    [XR] [18060] [18:10:49.916][Info ] System Graphics Properties: MaxWidth=2016 MaxHeight=2380 MaxLayers=16
    [XR] [18060] [18:10:49.916][Info ] System Tracking Properties: OrientationTracking=True PositionTracking=True
    [XR] [18060] [18:10:49.916][Info ]
    [XR] [18060] [18:10:49.916][Info ] ==== OpenXR Input ====
    [XR] [18060] [18:10:49.916][Info ]
    [XR] [18060] [18:10:49.916][Info ] Action Set Data:
    [XR] [18060] [18:10:49.916][Info ] Name: htcvivecontroller Desired Profile: /interaction_profiles/htc/vive_controller
    [XR] [18060] [18:10:49.916][Info ] Name: khrsimplecontroller Desired Profile: /interaction_profiles/khr/simple_controller
    [XR] [18060] [18:10:49.916][Info ] Name: oculustouchcontroller Desired Profile: /interaction_profiles/oculus/touch_controller
    [XR] [18060] [18:10:49.916][Info ] Name: valveindexcontroller Desired Profile: /interaction_profiles/valve/index_controller
    [XR] [18060] [18:10:49.916][Info ]
    [XR] [18060] [18:10:49.916][Info ] ==== OpenXR Swapchain Details ====
    [XR] [18060] [18:10:49.916][Info ]
    [XR] [18060] [18:10:49.916][Info ] Render Mode: Single Pass Instanced
    [XR] [18060] [18:10:49.916][Info ] Depth Submission Mode: None
    [XR] [18060] [18:10:49.916][Info ]
    [XR] [18060] [18:10:49.916][Info ] Swapchain Formats: 28 [c:29] 40 45 55 20
    [XR] [18060] [18:10:49.916][Info ] Creating swapchain for view 0 with dimensions Width=2016 Height=2380 SampleCount=1
    [XR] [18060] [18:10:49.916][Info ]
    [XR] [18060] [18:10:49.916][Info ] ==== Last 20 non-XR_SUCCESS returns ====
    [XR] [18060] [18:10:49.917][Info ] [SUCCESS] xrGetReferenceSpaceBoundsRect: XR_SPACE_BOUNDS_UNAVAILABLE (3x)
    [XR] [18060] [18:10:49.917][Info ] [SUCCESS] xrPollEvent: XR_EVENT_UNAVAILABLE (1770x)
    [XR] [18060] [18:10:49.917][Info ]
    [XR] [18060] [18:10:49.917][Info ] ==== Last 20 Events ====
    [XR] [18060] [18:10:49.917][Info ] OpenXRSession::HandleSessionStateChangedEvent: XR_SESSION_STATE_UNKNOWN->XR_SESSION_STATE_IDLE
    [XR] [18060] [18:10:49.917][Info ] OpenXRSession::HandleSessionStateChangedEvent: XR_SESSION_STATE_IDLE->XR_SESSION_STATE_READY
    [XR] [18060] [18:10:49.917][Info ] OpenXRSession::HandleSessionStateChangedEvent: XR_SESSION_STATE_READY->XR_SESSION_STATE_SYNCHRONIZED
    [XR] [18060] [18:10:49.917][Info ] OpenXRSession::HandleSessionStateChangedEvent: XR_SESSION_STATE_SYNCHRONIZED->XR_SESSION_STATE_VISIBLE
    [XR] [18060] [18:10:49.917][Info ] OpenXRSession::HandleSessionStateChangedEvent: XR_SESSION_STATE_VISIBLE->XR_SESSION_STATE_FOCUSED
    [XR] [18060] [18:10:49.917][Info ] OpenXRSession::HandleSessionStateChangedEvent: XR_SESSION_STATE_FOCUSED->XR_SESSION_STATE_LOSS_PENDING
    [XR] [18060] [18:10:49.917][Info ] OpenXRSession::HandleSessionStateChangedEvent: XR_SESSION_STATE_LOSS_PENDING->XR_SESSION_STATE_STOPPING
    [XR] [18060] [18:10:49.917][Info ]

    ==== End Unity OpenXR Diagnostic Report ====


    [Subsystems] Loading plugin UnityOpenXR for subsystem OpenXR Display...
    [XR] [18060] [18:10:50.609][Info ] Available Layers: (0)
    [Subsystems] Loading plugin UnityOpenXR for subsystem OpenXR Input...
    Crash!!!
     
  2. Charlicopter

    Charlicopter

    Joined:
    May 15, 2017
    Posts:
    123
    This is a Vive Cosmos Elite with Index controllers.
    Game runs fine on original Vive, and Valve Index.

    This is a build-out of the project, not in-editor.

    OpenXR Plugin 1.2.8
    Unity 2021.1.25f1
     
    Last edited: Jan 11, 2022
  3. Thomas-Mountainborn

    Thomas-Mountainborn

    Joined:
    Jun 11, 2015
    Posts:
    489
    Have you tried using the SteamVR OpenXR runtime rather than the Vive OpenXR runtime?
     
  4. Charlicopter

    Charlicopter

    Joined:
    May 15, 2017
    Posts:
    123
    I did and it worked! Fantastic. I would never have thought to try this, so thank you.

    This does bring up a concerning issue, though...
    When I release my game, this "problem" will persist for the foreseeable future, yeah?
    So I imagine that there will be a subset of my customers who will never know that this is a setting that they have to toggle in order to get the game to run. This is guaranteed to cause confusion => unhappy customers => bad reviews => a really bad time...

    Is OpenXR + SteamVR going to address this? (Probably the wrong place to ask, but...)
     
  5. Thomas-Mountainborn

    Thomas-Mountainborn

    Joined:
    Jun 11, 2015
    Posts:
    489
    Yes, this is exactly the problem I faced with Vermillion, which is why I know of it in the first place. The only solution I have now is manually selecting SteamVR OpenXR before initializing VR, so that only SteamVR OpenXR can be used. This would normally always work fine since people who bought the game on Steam would logically also have SteamVR OpenXR, but nothing is easy on PC VR. It turns out that for some reason, SteamVR OpenXR is often not registered in the list of available OpenXR runtimes, unlike Oculus, Vive, WMR, etc. So in the case that SteamVR OpenXR was not found in the list of available runtimes, I show an error message box explaining how to set SteamVR as the OpenXR runtime, exit the game, and load up my support page which again says how to do so, with screenshots. Before I did this, I reverted to the default OpenXR runtime which happened to be installed on the user's machine, but this actually led to issues, such as the one you are experiencing, or for Oculus users where they would see distorted graphics using the Oculus OpenXR runtime. Or imagine if someone has both the Cosmos and a Quest 2. The only users for who the native OpenXR runtime can be a boon is WMR.

    Is it a S***ty user experience? Yes. Is it our fault? No. What a mess.

    Edit: I've asked on the SteamVR community if they want to list their runtime in the registry, so it'll work behind the scene for more users. https://steamcommunity.com/app/250820/discussions/8/3200371016634050916/
     
    Last edited: Jan 17, 2022
    Charlicopter likes this.
  6. Charlicopter

    Charlicopter

    Joined:
    May 15, 2017
    Posts:
    123
    Vermillion looks like a really great game. I'll have to pick it up. The color mixing system is fascinating.

    How are you intercepting the OpenXR runtime mismatch before the player crashes? And how do you initialize XR manually?
    I agree it's a bit of a mess. OpenXR is supposed to unify, not bifurcate. I'm fairly confident that things will trend toward unification eventually, though.
     
  7. Thomas-Mountainborn

    Thomas-Mountainborn

    Joined:
    Jun 11, 2015
    Posts:
    489
    Thanks!

    In the XR plug-in settings, disable Initialize on startup. Then use this repo to enumerate the available runtimes with OpenXRRuntimeJson.GetRuntimeJsonPaths(). If there's a runtime found containing "steamxr" in the name, then you set it as the system-wide default with OpenXRRuntimeJson.SetRuntimeJsonPath(). You can then use XRGeneralSettings.Instance.Manager.InitializeLoader() and XRGeneralSettings.Instance.Manager.StartSubsystems() to start VR. If it did not find the SteamVR OpenXR runtime, you can do as I do and display a message box with how to set it up, and use Process.Start() to display a support page.

    Better yet, +1 my request on the Steam community so that the amount of users who see that error is reduced to those where SteamVR OpenXR is actually not installed, not simply not set as the default.
     
  8. Chimer0s

    Chimer0s

    Joined:
    May 5, 2017
    Posts:
    8
    You are an absolute legend for sharing this. Thank you so much! I'm buying Vermillion right now as thanks (also just because it looks awesome lol).
     
    Thomas-Mountainborn likes this.
  9. Thomas-Mountainborn

    Thomas-Mountainborn

    Joined:
    Jun 11, 2015
    Posts:
    489
    Hah, thanks! Adding to that post, there used to be an error in that repo where a case mismatch on a string comparison caused it to not find SteamVR OpenXR. It's been fixed since then, so it just works now.
     
  10. OuroborosDraconis

    OuroborosDraconis

    Joined:
    Oct 4, 2022
    Posts:
    47
    Hello, I am also having trouble with Unity VR by using a Vive Cosmos Elite. Each time when I hit the play button in unity to test my VR environment something is crashing. The first time it was unity itself crashing, causing me to loose all my unsaved changes in the "game". All the other times I tryed it the Vive Console and Steam VR are crashing. The crash starts by entering the VR environment for like a second and then the display of my glasses turns black. during that second it is possible to turn the view by turning the Heasdset and also the controllers seems to be recognized by unity.

    So do you think that this is also the here described Open XR runtime problem, or might it be caused by some wrong settings I made using the unity XR toolkit?

    For the Unity VR settings I followed the instructions of this tutorial on youtube, even though unity XR changed since the release of the video:


    I interpreted "XR origin (VR)" as his mentioned "XR Origin (Action based)".
     
  11. squallfgang

    squallfgang

    Joined:
    Sep 13, 2016
    Posts:
    19
    We also had a problem with the vive cosmos crashing our game VR Giants we couldn't fully fix it yet we will try that hack with the repo next.
    But the quick fix was to set SteamVR as default OpenXR. The crash only happened when Viveport was set as default open xr.