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. Dismiss Notice

Huge drop in render performance on 2020.2

Discussion in 'High Definition Render Pipeline' started by snacktime, Dec 21, 2020.

  1. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Upgraded from 2020.1/SRP 9.x to 2020.2 SRP 10.x. Frame rates dropped by around 20. Taking our game scene and disabling all renderers one by one didn't provide a clue. Empty scene with vsync off won't even hit 60fps.

    Render thread seems to be where it's at although there are some new GFX entries here I haven't seen before.

    Tried all the settings I could think of. Our own HDRP settings and also the defaults that come with a new 2020.2 project. Nothing moves the needle. High/Low makes very little difference there is some new overhead in 2020.2/10.x that I just cannot identify.

    Video card isn't the latest GTX 1050, but even so the issue here is the massive increase in main thread cpu time on the same hardware even in a minimal scene.

    upload_2020-12-21_13-24-27.png
     
    BozoBill likes this.
  2. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,450
    The profiler has become more accurate, if you measure can measure in milliseconds and not frame rate.
    16 millisecond budget for 60 fps
     
  3. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Well obviously I can't profile in 2020.1 since the project is upgraded. Framerate is the only stats I have of 2020.1. Which isn't helpful in terms of specifics but it's still relevant in terms of the difference.
     
  4. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    This amount of difference is something that someone on the team has a clue about, it's too big to not be something known. The difference in an empty scene is around 200fps.
     
  5. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    You can calculate the total cpu cost per frame just fine, just divide 1000 by fps and you get cost in milliseconds. Then check the difference between the two versions.

    Giving fps drop of 200 fps without even telling the baseline tells us nothing, for all we know perf drop could be 0.1ms or 100ms.
     
  6. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Not sure what you mean here by no baseline. Empty scene with the same HDRP configs as a new 2020.2 project is about as baseline as you can get for an existing project. As I stated I can't just go back to 2020.1 to look in detail at the profiler differences. Well I could but given it's around a 5 hour import not the first option I'm taking.

    Render thread cpu time in a new 2020.2 project empty scene hits 4ms tops. That's around 12 less then what I'm seeing in our project with the same HDRP configs.

    We have basically no third party assets outside of an ocean shader. We do use DOTS heavily so I'm a bit suspect of Hybrid Renderer synchronizing something in a place that causes problems in 2020.2. Going to test that theory now.
     
    BozoBill likes this.
  7. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    By baseline I just meant that if you tell what fps the game ran before and after Unity upgrade, it at least gives some meaningful data. But just telling the framedrop in fps without telling the original or final framerate tells absolutely nothing else than the direction (but could still be 0.1ms tai 100ms for all we know).
     
  8. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Ah ok I see what you mean. Before it was around 74fps but fluctuated based on settings. After upgrading it stuck right below 60 fps pretty much regardless of settings or what was being rendered. Which is a curious number it implies something was capping it.

    And something was. But it was one of two things because I didn't go through a proper letting the change completely reload to know for sure because reloading itself changed in 2020.2.. I had two old defines. One was an old HR define needed in a past beta, not even sure if it's still in the code and it doesn't seem likely it would have an impact.

    The other was for vegetation studio which I had just to reference some of the compute shaders but wasn't using. But I had deleted that after upgrading. But VS define did trigger some scripting defines. Even though none of the scripts in question were even present anymore I think it might have triggered something else to synchronize at a bad point which definitely could cause the behavior I was seeing. Or maybe it somehow triggered vsync. Who knows it's all working as expected now.

    But in the end that was all triggered by some change in 2020.2.
     
    Last edited: Dec 21, 2020
  9. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Hmm spoke too soon the problem came back need to spend more time tracking it down.

    I've been loading some stuff in RuntimeInitializeLoadType.BeforeSceneLoad. It now fails sporadically for reasons unknown but when it does frame rates shoot up. There is some UI stuff being loaded there so could still be rendering related. Or it could just be some other waiting being forced that spills over into rendering and it's not even rendering related per say. WIll have to do some more debugging.
     
  10. btschumy

    btschumy

    Joined:
    Jul 31, 2019
    Posts:
    91
    I'm also seeing a dramatic drop in my FPS in the past couple of days. One of the big changes is the 2020.2 upgrade. Even with all my objects disabled (unchecked), I'm only getting 60-120 FPS.
     
  11. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Just for the record this ended up not being rendering. It just shows up that way with how waits can cascade and what data the timeline shows. Time spent is going to show up somewhere but if something doesn't have an explicit entry, it can show up several times removed from the source. So that combined with several new changes to entries in the profiler that I wasn't up to speed on made it easy to misdiagnose.
     
  12. sietse85

    sietse85

    Joined:
    Feb 22, 2019
    Posts:
    99
    In my case my render thread suddenly got from 1ms to 10 - 13ms. And SRP batcher (URP/HybridRenderV2) checken makes all the meshes don't render so had to turn that off... any ideas what it might be?
     
  13. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    The render thread thing is profiler changes. It's reflecting wait time that doesn't originate from anything to do with rendering.

    So if your total cpu time is the same as it was, it's all good basically. If total cpu time is different good luck tracking it down. Enough was changed in how the profiler presents data in 2020.2 that it's impossible to do an apples to apples comparision to older Unity versions using just the timeline. You need to dig through the hierarchy and also the entity debugger if using DOTS, and then correlate that with the timeline to make sense of it all.
     
  14. Camarent

    Camarent

    Joined:
    Feb 19, 2014
    Posts:
    168
    I also met this problem after upgrading from version 9 to version 10. Tested in Editor, Windows build and console build. For more high end hardware it was less noticeable but still appeared.
    I filled a bug report for that problem.

    As I understand from profiler data the problem lies inside Inl_HRenderPipelineRenderCamera. It started to spent much more time on cpu.
    I added few screenshots with UnityEditor profiler. As you can see Inl_HDRenderPipeline increased from around 2 ms to 3 ms. Yes, it is not so big but this difference will be significantly bigger if you test it on lower hardware. From my testings on console it caused me 7 - 15 frames drops depends on optimization level I choose. I find a way to understand how this will affects my fps by measuring this method in hdrp 9 then multiplying by around 1,5-1,6 and combining with remaining frame time.

    The main question for me is it a bug or this is result of some architecture changes?

    HDRP 9
    Profiler timings for HDRP 9 in Editor.png

    HDRP 10 Profiler timings for HDRP 10 in Editor.png
     
    iDerp69 and DavidDreamer like this.