Search Unity

Bug Quest 2 Performance loss 2020.3 -> 2021.3

Discussion in 'VR' started by Cloudwalker_, Jun 20, 2022.

  1. Cloudwalker_

    Cloudwalker_

    Joined:
    Jan 3, 2014
    Posts:
    140
    Is there any known performance regression in URP v12 with Quest builds?

    Same scene from 2020.3 urp 10.9 to 2021.3 urp v12 uses 15% more gpu with nothing else changed. Toggled off additional items added in v11 / v12 as well.

    Using Oculus XR Plugin, OpenGL and Vulkan both don't matter, same issue.
     
    AldeRoberge likes this.
  2. Cloudwalker_

    Cloudwalker_

    Joined:
    Jan 3, 2014
    Posts:
    140
    Just patched URP 10.9 into 2021.3.4 and the performance came back. So definitely a URP 11 or 12 issue.
     
  3. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,043
    I have seen others with similar experiences. A bug report might help
     
  4. glenneroo

    glenneroo

    Joined:
    Oct 27, 2016
    Posts:
    231
    Yes definitely make a bug report and include a project where it's happening so they can reproduce it.
     
    DevDunk likes this.
  5. TommyTheITGuy

    TommyTheITGuy

    Joined:
    Jun 11, 2015
    Posts:
    53
    Any news on this?
     
  6. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    In my brief testing URP 14 is even more sluggish comparison to URP10.. I have a project where it's literally 100% more costly on URP14 than URP10 on Quest 2 while using stripped down URP settings - using same 2022.2 engine version.

    This is totally bonkers. Wish Unity would do device perf testing with Quest in general.
     
  7. PelvisParsley

    PelvisParsley

    Joined:
    Aug 9, 2016
    Posts:
    89
    How did you manage to get 10.9 running on 2021.3? Setting the package in manifest reverts the core and shadergraph packages back to 12.1.6
     
  8. TommyTheITGuy

    TommyTheITGuy

    Joined:
    Jun 11, 2015
    Posts:
    53
    You can, for example, remove the packages from the manifest and add them manually in the Packages folder.
     
  9. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    You can make older versions work on newer engine versions by manually placing the package file into your project folders Packages folder. Some change are required to make the thing work properly due to API change so it's not always just direct swap. As example when running 10.9 on 2021.2+ you need to do vsync fix for Quest for example, otherwise you just get like 33fps on build.

    Btw any packages you put in packages folder always override the manifest, so editing manifest to remove the other versions isn't mandatory step (altho it's cleaner that there are no duplicates even if they aren't loaded).

    Due to horrible perf on newer URP versions on Quest, I've started just backporting select features to URP10 to see which ones are still feasible to use with it. I have for example backported reflection probe blending + box projection PRs to it and it seems to have negative impact on perf even if you don't use the feat. I can only imagine there are plenty of similar things on newer URP versions that just degrade the perf despite you never setting the new features enabled from URP asset etc.
     
  10. PelvisParsley

    PelvisParsley

    Joined:
    Aug 9, 2016
    Posts:
    89
    I have similar issues on my URP builds. Would you be willing to share a repo of your implementation of URP?
     
  11. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    My repo is currently quite WIP since I still keep experimenting with things here and it also has application spacewarp which adds extra if you don't use it, sharing it in current state isn't ideal. Also API fixes vary from version to another meaning the version I've set to work for 2022.2 wouldn't necessarily work out of the box in 2021.3.

    I can share the steps how to make 10.9 run on any newer Unity version though:
    - Close Unity editor and wipe whole Library folder from your project to clean the previous shader etc cache
    - Get SRP packages for 10.9. You need ALL of the SRP packages you plan to use, not just URP because PM probably can't install old dependencies for you. This means you need core, urp and sg packages and potentially vfx graph if you use it (but this one has extra things to fix on newest Unity so would avoid it for now if going with URP10)
    - Put the packages on Packages -folder (or put file ref to manifest that points to your local git repo holding the graphics packages)
    - Do this change to fix vsync on Quest:

    - open project again and hit "yes" to all prompts from Unity, be it for upgrading materials or for updating API changes
    - there will be some warnings of some API deprecation but things will still work, you don't have to update all these unless you really want to

    and of course if you need application spacewarp, you also need to merge the oculus provided branch for it
     
  12. PelvisParsley

    PelvisParsley

    Joined:
    Aug 9, 2016
    Posts:
    89
    Thanks, I'm also using SpaceWarp in my current branch pulled from Oculus-VR/Unity.Graphics/2021-spacewarp (if I remember correctly) and I think the vsync problem is already addressed in their branch; correct me if I'm wrong. By the way, did you manage to run any XR plugin other than 2.0.0-pre.1 and 3.0.0-preview.1? Those 2 are the only ones that work for me but they don't support symmetric projection which has caused my app to freeze if I use more than one camera (strangely)
     
  13. Abended

    Abended

    Joined:
    Oct 9, 2018
    Posts:
    142
    I noticed that you are setting framerate here @ 300. I'm wondering if that will help me with my issue where in the newer unity versions ( > 2019.x) the FPS is locked for rift as well. Thanks for the screenshot!

    Edit: didn't work. I'm on a newer version and it's already set to 0 and 300. Man, why else would it be locked to 90?
     
    Last edited: Jun 29, 2022
  14. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Just to be clear this wasn't my own code, it's based on similar change Unity made on newer URP versions.
     
  15. TommyTheITGuy

    TommyTheITGuy

    Joined:
    Jun 11, 2015
    Posts:
    53
    Bump.

    Can we get someone from Unity to respond?
     
  16. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    345
    This is crazy that we just removed URP completly from our game and just that bosted the game performance to a 100%
    literally twice framerate than we got with URP on quest, and even using postprocessing and more things

    seems that unity is just making everything slower each time, we also downgraded to unity 2020.1.0f1 and got like another 80% performance increase

    just downgrading
    so in total we got like a +260% wich is like a x3.6 in performance

    so so crazy, not using URP anymore, and with a big fear of updating unity because of this :/
     
    laurentlavigne and glenneroo like this.
  17. PelvisParsley

    PelvisParsley

    Joined:
    Aug 9, 2016
    Posts:
    89
    An update from my end, somehow FPS has gone back to 90 on URP 12 (2021.3 LTS). Don't know exactly what caused it as I have made lots of changes + switched to custom shaders. Performance on a custom render pipeline was much better than URP, but I'll be sticking with URP for the while.

    Also like to add that I can only run Vulkan, OpenGL never worked for me on URP.
    I'd consider Vulkan and URP very experimental at this point for VR.
     
  18. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    345
    Hello, could you shade the exact urp version and unity version you have currently? it would help to know also what version of Input system you do have, thanks!
     
  19. PelvisParsley

    PelvisParsley

    Joined:
    Aug 9, 2016
    Posts:
    89
    I've tried the latest
    I've tried the latest one from package manager which shows as (12.1.7) but I've shifted to the Oculus SpaceWarp branch (12.1.6) and both are working well. Unity version is 2021.3.5f1 LTS, but it was working with 2021.1.16 as well, and might with some others. Important thing to note is that I can only run Oculus XR plugin 2.0.0-preview.1 and 3.0.0-pre.1. No other version works for me. Input system is 1.3.0 but is not used in my project.
     
  20. Cloudwalker_

    Cloudwalker_

    Joined:
    Jan 3, 2014
    Posts:
    140
    Urp 12 does work on quest, but uses more gpu cycles with the same feature set enabled as urp 10. Don’t let the illusion of it “working” fool you. You’re losing gpu budget if you’re on 2021.
     
  21. PelvisParsley

    PelvisParsley

    Joined:
    Aug 9, 2016
    Posts:
    89
    I have profiled on both 2020 and 2021, using OpenGL/Vulkan, URP/Built-in. I'm getting ~5 fps more on the Vulkan/URP build at the moment than the built-in / OpenGL combo. The project I'm working on is heavy and its possible that only in this scenario it's performing well but it is what it is. Regardless, it's an immense pain to set up.
     
  22. Cloudwalker_

    Cloudwalker_

    Joined:
    Jan 3, 2014
    Posts:
    140
    Any scene that I have tested in urp 10 vs 12 uses a solid 10% more gpu on urp 12. I'm not using PP so that may be the reason, it appears that URP 12 has overhead even if you're not using any of the features.
     
  23. TommyTheITGuy

    TommyTheITGuy

    Joined:
    Jun 11, 2015
    Posts:
    53
    Have you tried attaching the Frame Debugger or RenderDoc to see if there are additional draw calls in URP 12?
     
  24. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    345
    ahh so you get 90fps but only with SpaceWarp? what about without spacewarp?

    is that Im using URP 8 and dont find any other higher URP version that goes faster
     
  25. TommyTheITGuy

    TommyTheITGuy

    Joined:
    Jun 11, 2015
    Posts:
    53
    Bumping, since still no answer from Unity why newer URP versions cause performance degradation.
     
  26. Shizola

    Shizola

    Joined:
    Jun 29, 2014
    Posts:
    475
    I doubt anyone monitors this board. Would be better posting on the URP board where I've seen Unity staff comment or submitting a bug report.
     
    DevDunk likes this.
  27. glenneroo

    glenneroo

    Joined:
    Oct 27, 2016
    Posts:
    231
    Staff definitely posts in this forum, though it's rare but I've seen them comment before. Also Unity just laid off 3-400 employees a couple weeks ago, which may have had a negative impact here.
     
  28. Cloudwalker_

    Cloudwalker_

    Joined:
    Jan 3, 2014
    Posts:
    140
    So I did some more testing, it's possible the issue is with the Lit shader. I tested my scene again using Baked Lit (probably should use it anyway), and there wasn't a single drop in perf from URP 10 to 12.

    Others having the same issue are you using Lit shader?
     
    glenneroo likes this.
  29. holo-krzysztof

    holo-krzysztof

    Joined:
    Apr 5, 2017
    Posts:
    77
    glenneroo likes this.
  30. DanjelRicci

    DanjelRicci

    Joined:
    Mar 8, 2010
    Posts:
    310
    Mind that FFR does not work on Quest with Unity 2021 LTS + URP v12 + OpenGL so that might be another big reason for the performance issues. My game really needs FFR so I wasn't able to debug performance correctly in 2021.

    Meta recommends Unity 2020 LTS for developing on Quest, and personally I do too. My current setup is Unity 2020.3.36f, URP 10.9, OpenGL, OpenXR backend, and it seems to work decently and predictably. But since Quest updated to v40 firmware, I've lost some performance in general (the whole device feels sluggish compared to before). My only gripe is that Apple Silicon support is only for 2021 but no way I'm moving to that, despite the performance loss with Rosetta is quite a hit. Maybe in two years.

    Quest development has been a big mess since the beginning, I remember having to juggle between different Unity versions to find the exact combination that gave good performance and no broken features. It's mind blowing that after four years very little changed, we're still here wondering how to even setup our dev environment. Even if part of blame goes on Meta, I find it incredible how perfectly working features suddenly break, and the fix is often deployed just for the next year version.

    LTS still stands for Long Term Suffering. :D
     
    Recluse and ChescoRed like this.
  31. PelvisParsley

    PelvisParsley

    Joined:
    Aug 9, 2016
    Posts:
    89
    No, I haven't enabled Application SpaceWarp yet. The URP branch I'm using is from the SpaceWarp branch
     
    Extrys likes this.
  32. Cloudwalker_

    Cloudwalker_

    Joined:
    Jan 3, 2014
    Posts:
    140
    Yea I made sure to force ffr off when testing. I’ve spent more time with it yesterday and only see drops when using lit shaders. So far scenes using baked lit only have had no drop in perf when comparing versions.
     
  33. PelvisParsley

    PelvisParsley

    Joined:
    Aug 9, 2016
    Posts:
    89
    I'm using URP Standard Lit which are working great. However, I switched to URP MRTK shaders from here: https://github.com/microsoft/MixedRealityToolkit-Unity and performance dropped significantly. So theres definitely a shader related issue.
     
  34. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,043
    Did you already make a bug report for the issue?
     
  35. Cloudwalker_

    Cloudwalker_

    Joined:
    Jan 3, 2014
    Posts:
    140
    No, tired of wasting time on it. Reserved to complete the project in 2020.3.
     
  36. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,043
    If you already have a test project it's only submitting the report, and it could help out a lot of people (and yourself) later on.
    I personally can't really reproduce it
     
    Last edited: Aug 8, 2022
  37. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    I'm not working on this anymore so just decided to dump it into github on it's current state:
    https://github.com/0lento/Graphics/tree/app-spacewarp-2022.2-urp10

    This branch has:
    - URP 10.9 modified for 2022.2 API
    - Oculus Application Space-Warp
    - Specular highlight fix for Android builds
    - VSync fix for Quest
    - Backported option to disable post-processing
    - Backported reflection probe blending & box projection (but you'd probably not want to have this on Quest so maybe worth omitting the last commits on this if you only care about Quest)
     
  38. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,043
    glenneroo likes this.
  39. glenneroo

    glenneroo

    Joined:
    Oct 27, 2016
    Posts:
    231
  40. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,043
    Weirdly enough 2021 performed the best in my test project, but it did not for them. Not sure what happened there, but the description should give the devs enough info with stats
     
  41. Cloudwalker_

    Cloudwalker_

    Joined:
    Jan 3, 2014
    Posts:
    140
    How long did it take to get promoted to a bug report? Been waiting on the one I submitted still. I’ll get my discord to vote on this.

    edit: can you edit the report? Seconding Glenn’s point on loss of perf going from urp 10 to 12, aka 2020 to 2021. The perf loss seems more related to urp than unity versions. As standalone had similar perf when I compared 2020 and 2021.
     
  42. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,043
    I submitted it august 11th.
    You can't edit the submission after submitting, but I asked them to change it.

    Did you submit it when they moved to the new issue tracker using atlassian already? If not maybe resubmit it
     
  43. Extrys

    Extrys

    Joined:
    Oct 25, 2017
    Posts:
    345
    Yes it has to do wih the urp but there is also a performance drop on build on newer unity versions even using the same packages

    I have tested several post 2020.1+ (2020.1 is working fine for me) using URP 8

    When i update to any newer unity version, my Quest game drops its performance to the half

    if i do not update the packages, so i remain the same URP Versions and some other packages
    the performance also drops a bit, its not so heavy as the half but its almost a 15% of performance drop, just because of using a new version with the same packages
     
  44. codewing

    codewing

    Joined:
    Jan 8, 2014
    Posts:
    9
    We're seeing this issue also on the HTC Flow where the performance of an app drops almost by 1/3 from ~75 fps to 50-60.
     
  45. svenneve

    svenneve

    Joined:
    May 14, 2013
    Posts:
    80
    Yeah, we have this same issue, and reported it multiple times, and it's always crickets from Unity's side.

    Even a simple test scene consisting of literally just a camera and a sky box with a baked floor plane already shows the CPU and GPU usage increasing in the oculus ovr metrics tool on the quest.
     
  46. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,043
    Please make a bug report with both 2020 and 2021 projects attatched. Personally dont have the flow to make a report on it
     
  47. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,043
  48. Cloudwalker_

    Cloudwalker_

    Joined:
    Jan 3, 2014
    Posts:
    140
    Not fixed, looks like Unity is trying to sweep this one under the rug.
     
  49. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,043
  50. biggoron88

    biggoron88

    Joined:
    Nov 7, 2017
    Posts:
    9
    glenneroo, Thimo_, Extrys and 2 others like this.