Search Unity

Game Optimization questions (profiler)

Discussion in 'Scripting' started by TheDavid8, Aug 31, 2021.

  1. TheDavid8

    TheDavid8

    Joined:
    Nov 19, 2013
    Posts:
    52
    When I cap my framerate at 60fps, I get a consistently low framerate from in between my rendering, scripts, physics and animation. However, when I remove the cap they spike. I've excluded the statistics on Vsync and "other" to cleanly illustrate.

    Also, My gpu is always showing 0 ms, and I have one about 1/3 as powerful as a gtx 460 which leads me to believe its not being profiled correctly.

    If anyone has any ideas please let me know.

    Thank you kindly,
    -David
     

    Attached Files:

  2. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,460
    I can't tell for sure without seeing the Timeline view for the capped and uncapped spike frames but I'd assume that when they are uncapped, the rendering spikes are waiting for the GPU. When capped the GPU has time to finish while the CPU is waiting vor VSync (the Editor doesn't actually vSync but simulates vSync on the CPU).

    Not sure what's going on on the GPU here. If recording it didn't work, the Profiler should tell you so and why. So this looks somehow broken. Could you please file a bug report?

    Also that very big spike in the end is garbage collection.
     
  3. TheDavid8

    TheDavid8

    Joined:
    Nov 19, 2013
    Posts:
    52
    That would make sense that CPU is waiting on GPU, I was able to solve the problem by creating a new scene and now the profiler works so I could not reproduce it for a bug report, must have been something scene specific I suppose. Upon testing GPU performance I notice a lot of time is spent on ScriptableRenderPass.Configure. I'm not sure what this means and haven't been able to dig up any information. Here's the GPU performance, thanks! upload_2021-9-1_17-12-1.png
     

    Attached Files:

  4. TheDavid8

    TheDavid8

    Joined:
    Nov 19, 2013
    Posts:
    52
    So just to experiment I tried baked lighting, and after this the ms from this function went to 0. Is there any other way to look at gpu performance other than profiler?
     
  5. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,460
    I'm not sure either but there's something on this being connected to clearing depth, which would possibly show up as sub samples to ScriptableRenderPass.Configure, if you'd unfold that in the Hierarchy there. Based on the API documentation it seems to be about configuring Render Targets.


    There is the FrameDebugger and Platform/GPU Manufacturer specific GPU Profilers (just google
    GPU profiler
    with the name of the GPU manufacturer or platform).
     
  6. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,460