Search Unity

Bug [Quest] URP performance degradation form Unity 2019.4 to Unity 2020.2

Discussion in 'Universal Render Pipeline' started by DanjelRicci, Mar 16, 2021.

  1. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    310
    Copy-pasting a message I left yesterday on the SideQuest developers' Discord:

    ----
    Following unexplainable cases of bad performance I've been having for a couple months, I've been running experiments on my game for the last three hours or so with Unity 2019.4, Unity 2020.2, URP, OpenGL and Vulkan, all on Quest 1. Turns out URP in Unity 2020.2 (which I updated to two months ago) performs way worse than URP in Unity 2019.4- nothing more, that's it.

    I tested the same scene multiple times, initially on 2020.2 then downgrading to 2019.4. The scene only uses built-in URP shaders. Average results:
    Unity 2020.2 + OpenGL: CPU level 3, ~45% | GPU level 5, ~90% | 72fps mostly stable
    Unity 2020.2 + Vulkan: CPU level 2, ~45% | GPU level 4, ~85% | 72fps unstable, random dips
    Unity 2019.4 + OpenGL: CPU level 2, ~45% | GPU level 4, ~80% | 72fps stable
    Unity 2019.4 + Vulkan: CPU level 2, ~50% | GPU level 4, ~95% | 72fps unstable, random dips

    Previous tests on Unity 2020.2 with OpenGL, using only ShaderGraph shaders, resulted in bad framerate and lots of stale frames, but I don't have test data for it. I still haven't tried ShaderGraph shaders with Unity 2019 but I will do it in the next days.
    -----

    I have no idea if this is something specific to my case, but during my time spent on 2020.2 I kept optimizing every single bit out of the game and I still couldn't make it run as smooth as it was before. I thought it was slow because I was using many custom ShaderGraphs (despite 90% of the fillrate was by Unlit stuff), but I've been having this feeling that the issue was just having upgraded to 2020.2 for some time.

    I'm glad I decided to try a downgrade. I liked 2020.2, but at this point I will stick to 2019.4 LTS + OpenGL for the time being with this project. I don't really feel like doing further tests with this, I've spent too many hours already on performance debugging.
     
    Last edited: Mar 16, 2021
    Pandazole, DanielRC7 and Fewes like this.
  2. Fewes

    Fewes

    Joined:
    Jul 1, 2014
    Posts:
    259
    I'm very glad I found this post, because I was starting to go a bit mad here doing exactly this. I'm working on a desktop VR app using OpenVR and I've also seen a massive performance regression on newer versions of URP, with "Late start"s (CPU bottleneck, manifests as stuttering) being reported all over the place by OpenVR. Performance in the editor is particularly bad. I've tested lowering my 2020 engine version to get back to URP 9.x and I did see some perf regained. Will try going back to 2019 and see if that improves it further.
     
    Last edited: Mar 16, 2021
    DanielRC7 and DanjelRicci like this.
  3. Halfspacer

    Halfspacer

    Joined:
    Sep 13, 2014
    Posts:
    23
    Yep, OVR Metrics Tool shows me maxing out GPU at level 4 and struggling with around 65fps using URP and Unity 2020 for Oculus Quest in an empty scene. Switching to Built-In has framerate shooting back up to a stable 90fps and GPU level 2.
     
    DanjelRicci likes this.
  4. ThomasZeng

    ThomasZeng

    Unity Technologies

    Joined:
    Jun 24, 2019
    Posts:
    86
    Hi guys,
    Thanks for sharing! For the openVR/SteamVR performance issue, that is a known regression and we already put up a fix(https://issuetracker.unity3d.com/issues/xr-sdk-urp-performance-regression-when-using-urp-11-plus).
    For the Quest performance regression issue, please feel free to submit bug and we will look into it. We have Quest performance test suite running against URP that supposed to catch Quest perf regression issues. I am more than happy to add your use case to the test suite if that is not being covered yet.
     
  5. Fewes

    Fewes

    Joined:
    Jul 1, 2014
    Posts:
    259
    Thank you for the reply! Regarding the OpenXR bug, does the staging status on the tracker mean it is not available yet or can one test it via beta/alpha already? I'd love to check it out and see if it helps my case ASAP.
     
  6. Rib

    Rib

    Joined:
    Nov 7, 2013
    Posts:
    39
    Hi @ThomasZeng I just wanted to bump this discussion and hoping you might be able to help us because it looks like the referenced issue has stalled with no fix making its way back into a 2020 LTS release so far. I think there are several VR devs now that are queuing up hoping for this to be fixed before we can migrate from Unity 2019.4.
     
  7. DanielRC7

    DanielRC7

    Joined:
    Feb 20, 2021
    Posts:
    1
    We are experiencing the same issue with quest 2.

    In our case, a scene runs 90fps stable (GPU level 2 ~ 70%) with Unity 2019.4 and URP 7.4.3.

    The same scene with the same parameters runs 90fps unstable (GPU level 4 ~ 90%) with Unity 2020.3 and URP 10.5.

    We also tested Unity 2020.1 and URP 8.3.1 and the performance was similar to the 2019.4 with URP 7.4.3, but slightly worse.
     
  8. RoughSpaghetti3211

    RoughSpaghetti3211

    Joined:
    Aug 11, 2015
    Posts:
    1,709
    same issue here, will a fix be backported to 2020 LTS. we are really suffering from many bugs not being backported. please please .. please turn (LTS) Long Term Suffering back to Long Term Support ;)
     
  9. polygonfuture

    polygonfuture

    Joined:
    Feb 4, 2016
    Posts:
    20
    Noticing what may be a similar issue on a project in 2020.3 LTS and URP 10.5. Please a fix would be great.
     
    QGGameDesign and Pandazole like this.
  10. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    310
    Lmao thanks for the laugh, I am going to call LTS this way forever. Reflects well how's been lately with LTS, especially for crucial bigfixes not making into the supported version, but magically making it into experimental versions.
     
    QGGameDesign likes this.
  11. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    345
    Any news on this? I'm also stuck on 2020.1.0f1 with fear to update
    planning to downgrade to 2019 if that really improves a bit of performance
     
  12. mutp

    mutp

    Joined:
    Oct 1, 2018
    Posts:
    79
    We're facing the same issue in 2021.1.7f1 and URP 11. Inexplicable drop in performance on Quest.
     
  13. mutp

    mutp

    Joined:
    Oct 1, 2018
    Posts:
    79
  14. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Hey all, dropping a comment here as I was the one who filed the original issue report mentioned on this threads issue tracker link (case 1312513) . Knowing the original issue quite well, I don't think that issue was in any way related to the issues people are discussing on this thread.

    What my original issue report was about (and what was fixed) was that somehow URP frame timing got totally destroyed by some Quest hack in URP's VR code and they did this quick fix for it: https://github.com/Unity-Technologies/Graphics/pull/3708/files. This wasn't some 10-20% perf degrade people are talking on this thread but game literally going from 90 fps to 30 fps crawl while gpu and cpu sat still.

    I've personally tested (by the time I reported the issue) that URP 10 didn't have this issue, it was first introduced in UPR 11 (so there's nothing to backport to 2020.3 LTS regarding this issue). Unity has fixed the reported issue on 2021.1 and 2021.2.
     
  15. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    It's been fixed since 2021.1.1f1.2209
     
    mutp likes this.
  16. Daniiii

    Daniiii

    Joined:
    Nov 13, 2013
    Posts:
    24
    One thing that happened when I upgraded from 2019.4 to 2020.3 was that I needed to update Oculus Integration to work with 2020.3.30.
    When updating this it prompted me to use the OpenXR backend in the Oculus Integration instead of the legacy LibOVR and VRAPI backends.

    Using the OpenXR backend in the Oculus Integration disabled the extra latency mode (you can see if it's enabled using OVR Metrics) which caused performance to be worse, switching back to the legacy backends brings me similar performance as in 2019.4.

    Not saying that this is the cause for the issues reported above, but just wanted to leave this here in case somebody comes across the thread while googling, I thought it may be helpful to know that.
     
  17. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    345
    I should try that, Thanks!
     
  18. n_saikiran

    n_saikiran

    Joined:
    Sep 1, 2016
    Posts:
    20
    @Daniiii Thanks man, that really worked for me. I could see the change in the performance.
    It's a lot smoother when switched to the legacy backend.

    But for passthrough to work, it requires the OpenXR backend:(
    Have you figured out a way to achieve the same performance with OpenXR backend as well with a few changes/tweaks in the settings?
     
  19. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    345
    I think that something is limiting the framerate to the half, maybe the new AplicationSpaceWarp? could it be that oculus is forcing the framerate to be half because it things the ASW is enabled, or maybe its in fact enabled but not interpolating?
    i say this because it seems to me that its limiting the framerate always to the half

    also want to say that the game runs at 120 stable fps on Quest 2 on 2020.1.0f1 (the one im using)
    once i update to 2020LTS its keeps the framerate between 30 and 60 which is unaceptable
    and i just can not build a debug version on 2020.1.0f1 because seems to be a bug that doesnt let me to build debug builds just release, i could send the profiling data of the build made with 2020LTS, but i can not compare both builds wich is my main problem for identifying this slow down
     
    Last edited: Apr 19, 2022
  20. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    If you see your framerate splitting to half, it can be just perf regression (if it can't render at full speed, you get half the framerate with a VR headset).
     
  21. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    345
    Yeah but that would make sense that the performance stays at 90 then instead of 60
    and where its supposed to go at 90 it moves to 45, its not just the jump it makes to sync with the device hz

    i used to have 7~6 ms in the game's lobby on Quest 2, thats more than enough for rendering at 120hz, and i cant even render at 90 on the 2020lts, thats like an increase of more than 3~4ms, this is a nonsense

    Im aware of that framerate fixing that oculus does, but the weird thing is that even the lowest framerate profiles, are halfed, its like if it were using the ASW for oculus quest, and maybe as i dont have the Oculus custom URP i cant fully use the interpolation, so the framerate is always halfed but doesnt generate the interpolated frames

    thats my theory, i just have to see if there is some way to disable the ASW of Quest, that thing, may be just active by default
     
  22. Daniiii

    Daniiii

    Joined:
    Nov 13, 2013
    Posts:
    24
    no sorry, I'm back on 2019.4 and legacy backend after too many headaches with unity 2020 and all the other stuff (especially Unity OpenXR)
     
    Last edited: Apr 20, 2022
  23. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    345
    This may mean that maybe when unity detects youre using th eold OculusVR plugin, and so, when it sugest you to automatically change to open XR maybe it is activating the ASW mode to true, so it is alwais just halfing the framerate for AWS to "improve" it, and since you still needing the custom URP for using the valid vector/depth data, it just seems to flicker because aws is working but can not be seen, so that may have sense that even in empty scenes i can not pass the 90 pfs unless ASW determines, that not interpolating may be better than doing it in some cases

    JUST TEORIZING, now i will be checking this to verify, i will keep you updated
    upload_2022-4-20_14-1-43.png
     

    Attached Files:

  24. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    @Extrys if you set any VR headset to render at 90Hz and it can't keep up, it will just run at 45 fps, this is how vsync works. It will not fall back to 60Hz or to any other supported frequency your VR headset may have.

    As for the ASW, you don't have to speculate this. Just install OVR Metrics Tool on your quest and you can see there if ASW is active or not.

    Biggest chance for you to see Quest 2 drop to 45 fps or below is that something is stalling it from being able to run 90 fps. There can be numerous reasons for this, could be perf issue or a bug. I've sent multiple bug reports to Unity for different root causes that have caused this to happen in past but even without the issues around, it's not easy target to hit with Quest 2.
     
  25. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    345
    After some tests i noticed that the Input package wastes a lot of ms, in fact in oculus quest, i use several Input actions (that by the way these had names like the variables but versions newer than 1.0.0 dont and make them confusing to use, here is an example on how these looked on prior versions)
    upload_2022-4-25_0-20-50.png


    Well apart of that seems that this version were much more performant than newer ones, in the moment my controlers get off on oculus quest by inactivity the performance improves a lot, from 90 to 120fps
    it just happens in a quest build

    it still happening in 1.0.0 but is much much less notorious, almost passable

    But the true thing that improved everything is the next

    I just was testing i took ALL the packages i were using on 2020.1.0f1 and made them embed, then i updated to 2020.3 LTS
    upload_2022-4-25_0-25-4.png

    And voilá i can use the newest version without the performance degradation at all, i may even notice a slightly improvement? not sure it may be just my brain that want to think that


    What i think it downgraded the performance is the universal render pipeline going from 0.8.0 to 0.10.0
     

    Attached Files:

  26. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    345



    Now the next step is slowly de-embeing the packages and restore these to their lastest version
    until i find the package or packages that decreases the performance

    im pretty sure that its a combination between URP and New imput system but not sure at all
     
  27. jana553

    jana553

    Joined:
    May 31, 2018
    Posts:
    7

    Is there any way to enable extra latency mode when using OpenXR backend?
     
    chen70 likes this.
  28. VResearch

    VResearch

    Joined:
    Jan 6, 2021
    Posts:
    21
    Will it ever be fixed for 2020 as well? I am on MRTK and it does not work for 2021
     
  29. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Since you referred to my comment about specific bug report, I also wrote this right before the message you quoted:
    That being said, there's been several different causes for performance regression with URP along the way.
     
  30. steve18624

    steve18624

    Joined:
    Sep 16, 2018
    Posts:
    3
    I experienced the same degradation issue when upgrading from 2019.4 to Unity 2021.3 and the XR Plug-in Management. After many hours of profiling and debugging, I switched the OVRPlugin to Legacy LibOVR+VRAPI backend which solved my performance degradation issue. Based on my experience, I would not recommend using OpenXR at this time.

    I also noticed that the Extra Latency Mode appears to be is disabled. The LAT metric in the OVR Metrics Tool is 0, when a value of 1 implies that it's activated. This occurs even when I enable Phase Sync in the XR Plugin; which from my understanding is how you enable Extra Latency Mode now (i.e. Extra Latency Mode = Phase Sync).
     

    Attached Files:

  31. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    345
    i have been testing 2022.1.16, using OVRPlugin (not in OpenXR (i need to test on this version yet)) And well im somewhat more happy with unity, i saw that on quest the performance now doesnt drop like a 30~50% now it just drops like 10% or less, but stills noticeable
    then i switched to Vulkan and woah! its much much better for me in perfomance, its almost comparable to the other version i use unity on (2020.1.0f1 URP 0.8)
    Now i need to compare both versions to see if there is real performance gain or its only my brain wanting unity new versions to be as performant as old ones

    im using 2022.1.16, urp
    13.1.8
    Entities 0.51.1-preview.21 (modified for making it work on this version)

    i think now i should try to modify the new URP to remove all unwanted features and see if that improves the performance a bit more, if thats the case, i could finally update unity, my dream maybe becomes true...
     
  32. livj

    livj

    Joined:
    Feb 8, 2019
    Posts:
    10
    I just started up with Unity 2021 LTS, URP and Oculus Quest 1...

    I noticed a small lag with just the XR Origin(VR) in my scene. I can already see the lag when the new Unity logo shows up in the beginning.

    I did not have this small lag in Unity 2020 - it worked fine there. I use the URP Balanced since i used the medium version of URP in Unity 2020.

    Is there someone else having this lag in Unity 2021 LTS? Any workaround ? Or should I just keep on working with Unity 2020 LTS?

    Update:
    So I tried changing to URP Performant instead of Balanced and it worked so I do not have the lag anymore BUT what is the biggest different between the Perfomant and the Balanced? Performant feels so ... basic.. it is ths simpler one of the three URPs.
     
    Last edited: Sep 19, 2022
  33. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    345
    What do you mean with three URP is there more than one? if so where could i get them?
     
  34. livj

    livj

    Joined:
    Feb 8, 2019
    Posts:
    10

    Oh sorry! I ment there is three different templates for URP in qualitysettings... performant, balansed and the best one.. do not remember its namn.
     
  35. BuzzJive

    BuzzJive

    Joined:
    Mar 6, 2014
    Posts:
    75
    If you start a new Unity project and use the URP Template it will create 3 different assets you can select from for the Render Pipeline. UniversalRP-LowQuality, UniversalRP-MediumQuality and UniversalRP-HighQuality

    You can see all the settings in the inspector, but primarily the difference is that Shadows are completely off and Lighting is very minimized on the LowQuality one. There's other settings tweaked a bit, but that's probably why you're seeing it as "basic".
     
  36. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    345
    ahh those. ok, i tough it was some other custom render pipeline