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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Bug (IN-52428) FPS is lower when running on 2022.3 and Application time increases past 16ms

Discussion in 'Graphics for ECS' started by optimise, Aug 17, 2023.

  1. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,068
    IN-52428
    @JussiKnuuttila Now I only realize this massive regression at mobile platform that the performance of Entities Graphics 1.0.14 (600 ms+) is around 37x+ slower than 0.51.1 (16 ms) at stress test scene. Tested with Mi 9T Pro (Snagdragon 855) that it's solid 16ms for almost all the scenes at 0.51.1 but at 1.0.14 there's quite a number of scenes are extremely slow. From what I observed, seems like 1.0.14 uploads too much redundant data to GPU and quickly make it GPU bound. Note that the material is using simple shader graph instead of default regular urp lit shader.
     
    Last edited: Sep 21, 2023
  2. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    335
    Is this the stress test scene in the sample? Does the same happen if you switch URP to its regular Forward mode (it is probably Forward+ by default in 1.0)?
     
  3. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,068
    Nope. It's old 0.51 sample. I upgraded it to 1.0 and stress test it again. Tried both Forward and Forward+ still get 1-2 ms.
     
    Last edited: Aug 17, 2023
  4. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    335
    Are you sure it's GPU bound, and that there are no post processing effects or similar which could be causing issues outside of the actual draw calls?

    While there have been some changes to the shader code between 0.51 and 1.0, there shouldn't be anything drastic enough to explain a speed difference this large, so something very surprising might be happening here.
     
  5. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,068
    Yes. It's just very basic scene with no post processing and nothing fancy. See the screenshot below.

    upload_2023-8-17_17-59-37.png
     
  6. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    335
    To clarify: this is the StressTest scene in the official sample?
     
  7. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,068
    Yes at 0.51 sample but it's removed at 1.0 sample. Btw at 1.0 sample u can get similar significant slowdown at scene 9/19, 10/19, 16/19 and etc too but not super extreme at stress test scene though.
     
    Last edited: Aug 17, 2023
  8. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,068
    @JussiKnuuttila Have u found the root cause of issue? From my further testing and observation, looks like it's caused by 2022.3.7f1 brg plus vulkan and opengl regression. I believe the regression is there since 2022.2.0f1 up until latest 2022.3 release. At 2021.3.29f1, it's able to get solid 60 fps for most of scenarios i.e. camera far from scene or super near to scene and will drop certain amount of fps when camera near to certain distance but at 2022.3.7f1, at vulkan is insanely slow no matter which camera distance but at opengl camera goes quite far or goes super near to visual entities can get solid 60fps but still not as fast as 2021.3.29f1 yet. Btw currently I'm collecting all the official samples and port to dots 0.51. Let me know if u need it.
     
    Last edited: Aug 23, 2023
  9. arnaud-carre

    arnaud-carre

    Unity Technologies

    Joined:
    Jun 23, 2016
    Posts:
    97
    Hi! We also repro the perf regression even on PC. It's an issue with proper BRG batch size calculation, when using Vulkan backend only.
    We're working on a fix, thanks for your report.
     
    JesOb, DevDunk and optimise like this.
  10. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,068
    Not really. Although at 1.0 with OpenGLES3 is faster than 1.0 with Vulkan but it's still significantly slower than 0.51 with Vulkan. Btw let me know when the fix lands on which editor version after u push the fix to production. Oh yeah and also u can just run the project at case IN-52428 which I setup all the slow scenes for u to compare side by side
     
  11. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,068
    Hi. Will the fix ship at next 1.1 release or later?
     
  12. arnaud-carre

    arnaud-carre

    Unity Technologies

    Joined:
    Jun 23, 2016
    Posts:
    97
    Hi. The fix and several back ports have landed. Regarding 2022.3 the fix landed in 2022.3.10f1. ( btw it's editor fix only. (no need to update entities.graphics package)
     
    Last edited: Sep 6, 2023
    optimise likes this.
  13. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,068
    I just tried 2022.3.10f1 and see the improvement but it's still significantly slower than 2021.3.30f1. At 2021.3.30f1 most of the scenes able to get 60 fps specially 9/11 EntityCreation and 11/11 TransparencyOrdering are always solid 60 fps but 2022.3.10f1 still can't achieve it.
     
    Last edited: Sep 21, 2023
  14. arnaud-carre

    arnaud-carre

    Unity Technologies

    Joined:
    Jun 23, 2016
    Posts:
    97
    Do you know if the significantly slowdown is more GPU or CPU related? any unity timeline profiler capture of the two version could help. Also are you talking about the VK version? or GLES?
     
  15. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,068
    I believe it's more GPU related. Here's the profiler capture of the two version (https://drive.google.com/drive/folders/1HGbYD_lWVkL9iqpK5NmAI3x4DYmt4Fs-?usp=drive_link) profile from TransparencyOrdering scene. I'm talking about VK version since 0.51 release only support VK. But from my test at 2022.3.10f1, I also found that GLES version is significantly slower than VK version that one of the stress test scene is 25+ms slower.
     
  16. arnaud-carre

    arnaud-carre

    Unity Technologies

    Joined:
    Jun 23, 2016
    Posts:
    97
    seems to be GPU bound as you said. I guess your two runs ( 2021.3 and 2022.3 ) doesn't use the same URP package right? Any chance to do a GPU capture on the device? Maybe we could get some clue like some post process are active in recent URP or something else.
     
  17. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,068
    Ya. 2021.3 is using URP 12.1.12 meanwhile 2022.3 is using URP 14.0.8. Which GPU capture should I use?
     
  18. TijuThomas

    TijuThomas

    Unity Technologies

    Joined:
    Jun 5, 2019
    Posts:
    114
    Any tool will do NVidia NSight for NVidia GPUs, AMD Radeon GPU Profile or Intel GPA. If you are on mobile you can send us the capture using Android GPU Inspector. Send us captures from both and we can compare. Also even before that, it might be good to just compare the RenderDoc captures for both to see if there are extra post-processing calls or draws happening with the newer one - this won't give the timings, but might be quick to just compare if there's some extra processing happening on the GPU.
     
  19. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,068
    Here's the RenderDoc capture (https://drive.google.com/drive/folders/1GLZPB_2SdEIQ8kk8pHfTIzyOIusRvybN?usp=sharing). Btw is that official side not able to reproduce the same performance issue using similar Snagdragon 855 Android devices? My repro device is Xiaomi Mi 9T Pro. Anyway seems like at 2022.3 it spends insane amount of time to render same 3D cube model compares to 2021.3. Not sure why.
     
    Last edited: Sep 28, 2023
  20. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,068
    Last edited: Oct 4, 2023
  21. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,468
    kotbrain and optimise like this.
  22. kotbrain

    kotbrain

    Joined:
    Oct 13, 2019
    Posts:
    23
    I also have a performance regression in URP 14 on Xiaomi Mi 9T Pro.
     
  23. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,068
  24. VincentBreysse

    VincentBreysse

    Unity Technologies

    Joined:
    May 31, 2021
    Posts:
    27
    This ticket is currently under investigation. You should be notified when an update comes up.
     
    optimise and kotbrain like this.
  25. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,068
    I see but currently the status still not at In Review yet that no QA reviewing it yet
     
  26. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,068
    New update. This case confirmed by QA.
     
  27. LorinAtzbergerUnity

    LorinAtzbergerUnity

    Unity Technologies

    Joined:
    Apr 11, 2023
    Posts:
    3
    Hello. It seems the context is not the same between the 2 tests. The scene has been improved to use multiple meshes (cube, cylinder, capsule, sphere) instead of just cubes like in 0.5. The difference in rendered triangles is 12M vs 120k. When testing with only cubes and 1.0, there was actually a 1ms speed up on the total frame time.