Search Unity

Question Vulkan Builds won't run on Quest 2

Discussion in 'VR' started by krakentanz, Dec 3, 2021.

  1. krakentanz

    krakentanz

    Joined:
    Aug 13, 2020
    Posts:
    34
    Hello!

    I recently switched my project's Graphics API from OpenGLES3 to Vulkan (by adding Vulkan to the top of the list of Graphics APIs in the Project Settings -> Player Settings -> Other Settings) in order to gain some overall performance and add FFR.
    I had no problems launching the app on the Quest 2 with OpenGLES3, but now with Vulkan all the builds I make and run are stuck on the app's system splash screen image with the three dots pulsing below. I've waited several minutes to see if it has just gotten super slow (loading took about 3 or 4 seconds before) but the device doesn't seem to be able to run the app itself.
    The project is using URP and I have tried building it with the most current releases of Unity 2019.4 (URP 7.7.1), 2020.3 and 2021.2 (12.1.1) respectively, always with the same result.
    Can anyone give me a hint on what I might be forgetting? What things need to be taken into account when switching a project to Vulkan?

    Thanks for your help!
     
  2. fuzzy3d

    fuzzy3d

    Joined:
    Jun 17, 2009
    Posts:
    228
    +1
    Unity 2021.2.3f1+ URP 12.1.1+ Oculus XR Plugin 1.10.0+ XR plugin management 4.2.0+ Oculus Integration
    Oculus Quest 2 35.0.0..
    Fresh new project without any post processing, passthrough- Passthrough API Overview | Oculus Developers

    Vulcan= black screens, OpenGLES3= O.K.
     
    Last edited: Dec 4, 2021
  3. kalineh

    kalineh

    Joined:
    Dec 23, 2015
    Posts:
    241
    Can confirm very broken for me too, either stuck at 3 dots, or flickering splash screen, or crash on startup. Using URP and OpenXR latest w/ Oculus Quest Support enabled (not the Oculus XR Plugin, or the Oculus Integration package). Unity 2021.2.1f1.

    Uploading a 9gb repro project, should be done in a couple of hours.
     
  4. Tanya_Li

    Tanya_Li

    Unity Technologies

    Joined:
    Jun 29, 2020
    Posts:
    105
    which OpenXR plugin version were you using? We recently fixed this issue in 1.3.0.
    1.3.0 Release note includes this fix:
    • Fixed bug that caused Vulkan support on Oculus to stop working.
     
  5. kalineh

    kalineh

    Joined:
    Dec 23, 2015
    Posts:
    241
    Using OpenXR plugin at 1.3.1 or 1.3.0 is reliably crashing vulkan for us, when using the OpenXR plugin provider. Tested with and without Oculus plugin installed with no change. Enabling or disabling jobs changes the vulkan stack trace. Multi-pass,etc do not fix, depth texture change does not fix. (I'm still uploading the repro project, it will probably take 15 hours)

    Using Oculus plugin provider (3.0.0-pre.1) is stuck with a flickering splash screen (not 3 dots). Still trying to diagnose if there is a combination of settings that works.

    There's also a number of small issues with gradle, like having Oculus provider enabled and having Oculus Quest Support enabled in OpenXR makes libopenxr_loader.so try to merge multiple times and fail. There's also bunch of troublesome issues caused by Library/Android/Prj/IL2CPP/Gradle not clearing properly but I don't have a repro right now.
     
  6. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,060
    Is Oculus Integration installed? (If so, update it)
     
  7. kalineh

    kalineh

    Joined:
    Dec 23, 2015
    Posts:
    241
    It is not installed, I am trying to isolate errors by adding one thing at a time because there are too many combinations. As far as I can tell, the Oculus Integration should contain the same plugins as the Oculus XR Plugin anyway.

    The black screen turned out to be an issue on our side - the editor keeps clearing all the references on some prefabs on startup for some reason. It's working now just with no controller tracking (using Oculus XR plugin provider).
     
    DevDunk likes this.
  8. kalineh

    kalineh

    Joined:
    Dec 23, 2015
    Posts:
    241
    Vulkan crash on startup bug submitted with repro: case #1386086.
     
    DINmatin likes this.
  9. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Is this Vulkan/link/PC or vulkan/Android ? Vulkan/link/PC does have some outstanding issues, including a crash.
     
  10. mrstruijk

    mrstruijk

    Joined:
    Jan 24, 2018
    Posts:
    52
    Hi! I had the same issue after upgrading from 2021.1.28 to 2021.2.5. App worked on 2021.1.28 (Vulkan), but only three dots on 2021.2.5.

    I upgraded OpenXR to 1.3.1, but still no luck.

    Also upgraded Cinemachine to 2.8.3, Progrids to 3.0.3-6, Version Control to 1.15.7, no luck (didn't expect it to, but you never know).

    Only after setting OpenGLES3 to the top of the Graphics API in Project Settings (leaving Vulkan to a lowly second place), did my app run again!

    Edit: thanks apoxol, I meant 2021.2.5, not 2022.2.5. Fixed typo
     
    Last edited: Dec 8, 2021
  11. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    I assume you mean 2021.2.5? I am installing it now and will give it a try to see what is going on. If you want to submit a bug and attach a sample project that would be the fastest way for us to look into it. If you do please post the case number here.
     
    hippocoder likes this.
  12. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    I was able to verify that this is in fact the case, vulkan will not start on device. Investigating now to see what changed and will post back if there are any workarounds.
     
  13. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Looked into this further and it seems like this was a bug that was introduced and fixed. The fix will be in 2021.2.6f1 (so the next release). At this time there are no known workaround besides using OpenGLES3 or saying on the 2021.1.28 build as I tried going back to 2021.2.0f1 and it occurs there as well.

    https://issuetracker.unity3d.com/issues/xr-vulkan-oculus-crash-launching-app-on-quest
     
  14. kalineh

    kalineh

    Joined:
    Dec 23, 2015
    Posts:
    241
    @the_real_apoxol The crash repro I submitted was for Vulkan/Android. The Vulkan/link/PC build was working fine. I'll take another look once 2021.2.6f1 is out.
     
  15. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    Yes the crash that is fixed in 2021.2.6f1 will fix the crash on Vulkan/Android
     
    fuzzy3d and kalineh like this.
  16. mrstruijk

    mrstruijk

    Joined:
    Jan 24, 2018
    Posts:
    52
    Thanks for this @the_real_apoxol! I will upgrade to 2021.2.6 when it comes out. I hope that it will also fix my new issue where the frame rate has tanked on Quest build using OpenGLES3.
     
  17. benbarefield-lighthaus

    benbarefield-lighthaus

    Joined:
    Sep 16, 2019
    Posts:
    7
    We're also having this issue, but also have some additional problems making 2021.2.5 not work for us at all:
    1. Making a build using OpenGLES3 results in the right eye rendering mostly correctly and the left eye rendering random colors
    2. When trying to play from Unity using AirLink I get black in both eyes, except some triangles in the right eye where I can see the scene rendering a bit.

    I'm wondering if anyone knows of a setting that I might be missing? I've tried using the OculusXR plugin 1.10 and 3.0.0-pre.1.
     
  18. krakentanz

    krakentanz

    Joined:
    Aug 13, 2020
    Posts:
    34
    Thanks for the replies and for fixing this issue in the upcoming release of 2021.2.6f1. In the meantime, I indeed got working Vulkan builds using 2021.1.28f1.
    Unfortunately -and I can't say what's the culprit here; if it's the updated URP or Vulkan instead of OpenGLES3- the game runs a lot slower when building with this version of Unity and Vulkan API selected, even after turning on FFR level 4 (the highest setting that should render a lot less pixels). Sadly, the expected performance boost using Vulkan did not happen for us at all.
     
  19. kalineh

    kalineh

    Joined:
    Dec 23, 2015
    Posts:
    241
  20. mrstruijk

    mrstruijk

    Joined:
    Jan 24, 2018
    Posts:
    52
    Updates to 2021.2.6 does fix the Vulkan issue. It now runs using Vulkan.

    But the frame rate is still abysmal. With every head move I have black borders on the edges indicating that it's not fast enough to actually render the frame.

    For me it has a Gfx.WaitForRenderThread of between 20 and 50ms. On the Render thread it's not doing anything at the same time.

    I will try the experiments that @kalineh has indicated in their other thread.
     
  21. mrstruijk

    mrstruijk

    Joined:
    Jan 24, 2018
    Posts:
    52
  22. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,060
    Disable depth, there is a massive performance issue about this (already in the issue tracker). In URP it's in the urp asset and rendering asset called stencil
     
  23. mrstruijk

    mrstruijk

    Joined:
    Jan 24, 2018
    Posts:
    52
    Thanks for the tip @DevDunk! Are these the ones you mean?

    UniversalRenderPipelineAsset.png UniversalRenderPipelineAsset_Renderer.png
    Because if so, they were already off. Or should I be looking in another place?
     
  24. krakentanz

    krakentanz

    Joined:
    Aug 13, 2020
    Posts:
    34
    I just put this in Start()

    Unity.XR.Oculus.Utils.SetFoveationLevel( 4 );
     
    mrstruijk likes this.
  25. benbarefield-lighthaus

    benbarefield-lighthaus

    Joined:
    Sep 16, 2019
    Posts:
    7
    In 2021.2.6 we're still seeing rendering in a single eye. This happens as early as the Unity Logo. Has something changed in how the XR integration needs to be used? (Turning off multithreaded rendering did not make a difference)
     
  26. the_real_apoxol

    the_real_apoxol

    Unity Technologies

    Joined:
    Dec 18, 2020
    Posts:
    467
    I recommend any issues you are seeing that you submit bugs with test projects if possible and post the issue numbers you are assigned here. With graphics related issues bugs are the fastest way to a resolution.
     
  27. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,060
    Yep, it's good that way. Performance optimisation can just be a bitch sometimes sadly
     
    mrstruijk likes this.
  28. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    I've reported the mentioned Vulkan perf regression with depth buffer in past. Case #1387325. I can paste my report content here too since it can help others understand what's happening:

    While running native Quest 2 build with URP and Vulkan, it's impossible to reach acceptable framerate or GPU load when depth texture or depth priming options are enabled on the URP assets. This wasn't an issue while using Unity 2020.3 LTS or while using GLES3 as renderer. I've tracked the issue to happen after this PR: https://github.com/Unity-Technologies/Graphics/pull/4488. If I revert that PR, everything runs fine on Quest despite enabling either of those mentioned deph options. The reason why performance with GLES3 (instead of Vulkan) is fine is because this PR actually reverted the previously mentioned PR for GLES3 specifically: https://github.com/Unity-Technologies/Graphics/pull/4705
     
  29. ImpossibleRobert

    ImpossibleRobert

    Joined:
    Oct 10, 2013
    Posts:
    530
    Is this issue resolved by now?
     
  30. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    if you mean the issue I mentioned on the previous post then.. I think not. Unity just closed my report claiming the repro project just crashed the editor. I already even pinpointed the PR that caused the issue and in addition their editor crashing on a project should have warranted extra investigation as well but instead of doing either, they just closed the report.

    I can't be bothered to resubmit the repro project if they don't even bother looking further after sending them detailed notes on what went wrong. Repro project was just a blank project anyway.

    In case some Unity employee is still interested on this, further details are still in issue report #1387325. This happens on all URP projects with the steps mentioned here (quest + vulkan + depth buffer).
     
    Last edited: Apr 19, 2022
    DevDunk likes this.
  31. brad_penbach

    brad_penbach

    Joined:
    Aug 16, 2017
    Posts:
    12
    I really and truly hope Unity isn't just considering this a case closed. URP and Vulkan cooperating with one another is one of the most important parts of developing realistic standalones.
     
    DevDunk likes this.
  32. Vanz

    Vanz

    Joined:
    Nov 19, 2013
    Posts:
    374
    how are you finding Vulkan vs. GLES3 in VR?

    I've had issues with Vulkan and MSAA 4X on Quest 2...
     
  33. cbboyer

    cbboyer

    Joined:
    Jun 2, 2014
    Posts:
    20
    Sadly, we've been hearing that Vulkan, FFR, and MSAA would be working smoothly on Quest "any day now" since ~2019. At this point I've completely given up hope and just focus on optimizing for GLES3.
     
    Vanz likes this.
  34. Vanz

    Vanz

    Joined:
    Nov 19, 2013
    Posts:
    374
    Damn, I wish I would have seen that a month ago... :(
     
  35. chantey

    chantey

    Joined:
    Mar 5, 2017
    Posts:
    49
    fuzzy3d and ariza-oscar like this.
  36. Elliott-Mitchell

    Elliott-Mitchell

    Joined:
    Oct 8, 2015
    Posts:
    88
  37. ThatRaincoat

    ThatRaincoat

    Joined:
    Jul 12, 2017
    Posts:
    27
    I’m having this issue as well when building with Vulkan.

    I tracked it down to the Depth Texture option in the URP Pipeline Asset.

    When Depth Texture is checked the game will hang on the splash screen on quest. When turned off the game loads normally. (Unfortunately without depth texture support)
     
  38. fuzzy3d

    fuzzy3d

    Joined:
    Jun 17, 2009
    Posts:
    228
  39. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,060
    Yet all the new features such as phase sync and spacewarp require vulkan, and unity puts it as stable already
     
  40. fuzzy3d

    fuzzy3d

    Joined:
    Jun 17, 2009
    Posts:
    228
    Great news! Can you post link to "Unity: Vulcan for Quest 2 is stable already"?
     
  41. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,060
    fuzzy3d likes this.
  42. fuzzy3d

    fuzzy3d

    Joined:
    Jun 17, 2009
    Posts:
    228
  43. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Please note it was 2021.2 that introduced a fix to depth prepass / MSAA. So if you were using MSAA then Vulkan would be really slow, but prior to this version of Unity, anything could enable it internally like SSAO or some effect and so on. That may well be an issue for some. Check the project on 2021.2 if that's the case

    Note this was not MSAA's fault, it was just a trigger.
     
    DevDunk likes this.
  44. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,060
    Wasnt that fixed in a recent update?
     
  45. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Unity changed a lot of stuff involving tile deferred hardware and depth prepass etc. I'm just passing on info as so many people have hit a snag with vulkan on URP and Quest 2.
     
    fuzzy3d and DevDunk like this.
  46. wrensey

    wrensey

    Joined:
    Mar 12, 2017
    Posts:
    15
    I'm on 2021.3 and I still get a black screen when I try to build a Quest 2 app with Vulkan
     
    chantey likes this.
  47. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,060
    Latest oculus integration asset?
     
  48. wrensey

    wrensey

    Joined:
    Mar 12, 2017
    Posts:
    15
    Yep I'm on version 40.0 set up this project his week :(
     
  49. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,060
    And you followed the oculus quest unity setup on the oculus page?
     
  50. PelvisParsley

    PelvisParsley

    Joined:
    Aug 9, 2016
    Posts:
    89
    I can also confirm a black screen with URP on both Vulkan and OpenGLES on Quest 2, tried on 2021.2.16 and 2021.3 LTS, latest plugins and integration. Logcat doesn't seem to provide any info or errors as if execution just stopped.