Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Bug Limiting FPS in playmode does NOT reduce GPU load?

Discussion in '2022.1 Beta' started by Kirsche, Dec 16, 2021.

  1. Kirsche

    Kirsche

    Joined:
    Apr 14, 2015
    Posts:
    121
    Hello,

    limiting the framrate in the editor playmode doesn't reduce the GPU load unless VSync is enabled. I don't know if these are bugs, by design or I'm using it wrong.

    Tested BIRP/URP/HDRP with their respective default empty scene on Unity version 2022.1.0b2, Windows 10 + NVIDIA GPU. Settings used for each test:

    Default

    no framerate limit

    VSync 60 Fps
    Application.targetFrameRate = -1;
    QualitySettings.vSyncCount = 1;

    1 Fps
    Application.targetFrameRate = 1;
    QualitySettings.vSyncCount = 0;

    BIRP - Default (no framerate limit)


    BIRP - VSync 60 Fps

    No picture but works normally with 16% GPU usage

    BIRP - 1 Fps


    URP - Default (no framerate limit)


    URP - VSync 60 Fps


    URP - 1 Fps


    HDRP - Default (no timeframe limit)


    HDRP - VSync 60 Fps


    HDRP - 1 Fps


    My question would be, is this working as intended?
     
    Last edited: Dec 16, 2021
  2. runner78

    runner78

    Joined:
    Mar 14, 2015
    Posts:
    792
    From the Docs: "In the Editor, targetFrameRate affects only the Game View. It has no effect on other Editor windows."
     
  3. Kirsche

    Kirsche

    Joined:
    Apr 14, 2015
    Posts:
    121
    Even when the scene view is not only hidden but closed entirely, it doesn't seem to affect the GPU load at all. So I don't think other editor windows are the reason for the high gpu load.
     
    Last edited: Dec 16, 2021
  4. runner78

    runner78

    Joined:
    Mar 14, 2015
    Posts:
    792
    Maybe you should test it with a number that is somewhat realistic? You can try to set the number to 30. Maybe there is a problem here if it is too low, but this is not a real problem because nobody sets the number to 1.
     
  5. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,334
    The game view has it's own vsync toggle:

    upload_2021-12-16_8-59-25.png
     
    sloopidoopi, hippocoder and Kirsche like this.
  6. Kirsche

    Kirsche

    Joined:
    Apr 14, 2015
    Posts:
    121
    Thank you, I forgot to enable this checkmark in my BIRP test. VSync then does work as expected.
     
    Lars-Steenhoff likes this.
  7. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Even with the editor toggles and stuff, vsync has always been iffy in editor but that's pretty pointless in bigger picture.

    What you should take away from this is that you should never make big conclusions of the game performance while running it in editor, that's just silly and doesn't give you the right data.

    Always do perf testing on actual builds if you want to have data that truly matters, even more so if comparing the performance of the different renderpipelines..
     
    Kirsche and hippocoder like this.
  8. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    In addition why do people measure with FPS? It's just for gamers and graphics card reviewers, and is really bad at examining if what you did was a worthwhile change. Developers should only use millisecs when profiling a change.
     
  9. Kirsche

    Kirsche

    Joined:
    Apr 14, 2015
    Posts:
    121
    Thank you and I fully agree. The only reason I show the FPS is so you can draw a much simpler conclusion about the following: if there's just 1 FPS rendered (in the editor playmode/gameview), should the GPU load be the about same as with 700+ FPS?

    A good reason to limit FPS during editor playmode is to have GPUs survive the crypto pandemic. I'm not concerned or criticizing the "empty scene performance".

    In standalone builds this problem doesn't exist. Regardlss whether VSync is enabled, Unity will only put as much work on the GPU as it renders.