Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

5.6.0b8 crashes while trying to add SteamVR Plugin CameraRig prefab [video included]

Discussion in 'Linux' started by Jesse_DuBord, Feb 23, 2017.

  1. Jesse_DuBord

    Jesse_DuBord

    Joined:
    Jan 15, 2017
    Posts:
    60
    See video for example of issue:
    .

    When I try to add the SteamVR's CameraRig prefab to initialize the VR components in my scene, Unity crashes. I configured all of the prerequisites as described on https://github.com/ValveSoftware/SteamVR-for-Linux.

    Running Unity 5.6.0b8 on:
    Ubuntu 16.10 x64, kernel 4.8.0-39-generic, Unity 7.5.0 desktop environment
    Xorg 1.18
    Nvidia 375.27.10 beta drivers
    Steam beta client
    SteamVR Plugin 1.2.0
     
    Last edited: Feb 23, 2017
  2. Kaare

    Kaare

    Joined:
    Jan 5, 2014
    Posts:
    12
    Same thing is happening for me (same config as Jesse_DuBord)
     
  3. Tak

    Tak

    Joined:
    Mar 8, 2010
    Posts:
    1,001
    This looks like it may be an issue of SteamVR/OpenVR requiring Vulkan and Unity using OpenGL core.
     
  4. Jesse_DuBord

    Jesse_DuBord

    Joined:
    Jan 15, 2017
    Posts:
    60
    @Tak , thanks for your reply. Do I need to file a bug report, somewhere?
     
  5. Jesse_DuBord

    Jesse_DuBord

    Joined:
    Jan 15, 2017
    Posts:
    60
    I only ask because this is critical for development of VR games & experiences on the Vive in any Linux distro.
     
  6. Tak

    Tak

    Joined:
    Mar 8, 2010
    Posts:
    1,001
    You may be able to work around the crash by adding the following block to the beginning of OpenVR.Init (openvr_api.cs).
    You'll get some errors in the console, but at least you should be able to work. There's no way OpenVR initialization can succeed here, and it's just crashing inside the OpenVR native plugin.

    Code (csharp):
    1. #if UNITY_EDITOR_LINUX
    2. return null;
    3. #endif
     
  7. Jesse_DuBord

    Jesse_DuBord

    Joined:
    Jan 15, 2017
    Posts:
    60
    Gotcha, thanks for the suggestion! I'll try it today and report back.
     
  8. Jesse_DuBord

    Jesse_DuBord

    Joined:
    Jan 15, 2017
    Posts:
    60
    @Tak , I'm having a problem locating the Init class in openvr_api.cs. Can you tell me which line I should put your code snippet in?
     
  9. Tak

    Tak

    Joined:
    Mar 8, 2010
    Posts:
    1,001
    Sorry, Init is a static method. It's around line 4757 in my copy.
     
  10. Jesse_DuBord

    Jesse_DuBord

    Joined:
    Jan 15, 2017
    Posts:
    60
    No worries! And success! I am able to add the prefab without Unity crashing. :)
     
  11. Kaare

    Kaare

    Joined:
    Jan 5, 2014
    Posts:
    12
    ..works for me as well. I just build my first little VR scene in Linux. This is great! :)

    Hopefully the preview function will work too at some point.

    Thanks, Tak!
     
    Jesse_DuBord likes this.
  12. Jesse_DuBord

    Jesse_DuBord

    Joined:
    Jan 15, 2017
    Posts:
    60
    So who do I report this issue to in order to get a proper fix that won't require a work-around? SteamVR? Unity?
     
  13. Tak

    Tak

    Joined:
    Mar 8, 2010
    Posts:
    1,001
  14. Jesse_DuBord

    Jesse_DuBord

    Joined:
    Jan 15, 2017
    Posts:
    60
    Thanks @Tak, as long as it's known and is being worked on/tracked by your team, and any fixes will be publicly announced when complete, I'm good. :) Thanks so much!
     
  15. winsteadproducts

    winsteadproducts

    Joined:
    Apr 23, 2018
    Posts:
    1
    I can't find OpenVR.Init in my openvr_api.cs file

    Can you paste what line of code I put it under in this file?

    When I put those three lines of code at the top of the openvr_api.cs file, I am able to get the camera rig in the scene without a crash. However, now I cannot enter play mode until this error is fixed.

    Assets/SteamVR/Plugins/openvr_api.cs(8,0): error CS1525: Unexpected symbol `return'

    Also running this error as well when trying to run in play mode

    Assertion failed: Reentered BeginCurrentContext
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
    Last edited: Apr 23, 2018
  16. vbschettino

    vbschettino

    Joined:
    Jul 3, 2018
    Posts:
    1
    I have the same problem as winsteadproducts and couldn't fix it even after trying to follow many workarounds described in forums. Maybe someone that had success could post an update to this? Is there some improvement for the new versions of Unity? I had no luck with 2017.3, 2018.1 or 2018.2.
     
  17. winsteadworksmedia

    winsteadworksmedia

    Joined:
    Sep 5, 2018
    Posts:
    1
  18. tculhane

    tculhane

    Joined:
    Aug 11, 2018
    Posts:
    3
    I am having the same problem using 2018.3.6. Why is this happening?