Search Unity

  1. Tune in to get all the latest Unity news live from Berlin on June 19, 6pm CEST. Set up a YouTube reminder!
    Dismiss Notice
  2. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  3. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  5. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  6. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice


Discussion in 'Editor & General Support' started by jordi_boni, Nov 15, 2013.

  1. Nition


    Jul 4, 2012
    Yeah, that is weird. Certainly seems like either a Unity or a graphics driver bug rather than anything you're doing.

    I don't think it belongs in a Gfx.WaitForPresent thread though. The reason you've got big Gfx.WaitForPresent spikes is that your GPU FPS is ~130 and your CPU FPS is like a thousand, so it's spending tons of time waiting on the GPU. The real question is wtf the GPU is doing.
  2. Zolden


    May 9, 2014
    I just tried to load GPU alot with a compute shader. And what I got? Huge Gfx.WaitForPreset. The more I load GPU, the bigger the time Gfx.WaitForPreset consumes. Conclusion: Gfx.WaitForPreset represents the time CPU has to wait until GPU finishes its job for the current Update() frame.
  3. JBR-games


    Sep 26, 2012
    So i was have a hugh issue with this and for the life of me a couldnt figure out why i was having such a hugh lag in a fairly simple scene.. Then after checking this thread i realized (im assuming ) a windows 10 update broke my current graphics driver. So after finding and installing the latest driver it seems to be working as expected..
    Zolden likes this.
  4. bitinn


    Aug 20, 2016
    Hello to everyone at the gfx.waitForPresent community, I was running into this "high gfx.waitForPresent time" situation earlier today, and would like to share some basic practice on how to troubleshoot this.

    So first of all, let's prepare 2 standalone development builds: one without vsync and one with vsync.

    Without Vsync (click for larger image)

    Screen Shot 2018-02-25 at 13.29.45.png

    With Vsync (click for larger image)

    Screen Shot 2018-02-25 at 13.49.00.png

    (It may appear my screenshots are flipped, but no, they are not: "WaitForTargetFPS" doesn't show when profiling a standalone build, for reasons I don't understand. But the game is absolutely sync to 60fps, I have an in-game fps monitor to double-check it.)

    One would assume, with vsync set to 0, the game will run as fast as GPU allowed. But confusingly, in my case, it was running just above 60fps (less accurate than vsync, but still around 60fps, the time is largely shown as gfx.waitForPresent).

    For a direct comparison, here is a graph show both no-vsync build (left) and vsync build (right), you can see the actual camera rendering cost about the same. The scene contains only very simple UI, so by all means it could render faster. (click for larger images)

    Screen Shot 2018-02-25 at 14.02.08.png

    Screen Shot 2018-02-25 at 14.02.16.png

    In fact, it was running faster in the Editor, above 90fps. I have an in-game monitor to verify this. In a standalone build, also without vsync, the same scene can run at best around ~60 fps, but never quite as fast as 90 fps.

    Screen Shot 2018-02-25 at 14.11.42.png

    Then I realize what was going on: I was fillrate bound, not texel fillrate, but pixel fillrate! My MacBook Pro 2015 Intel GPU just can't push that much pixels onto screen. Changing the resolution, toggle between fullscreen and window mode, all has a huge impact on my game even though very little texture processing was happening.

    I am also on deferred rendering which is even more dependent on ROPs (to process g-buffer).

    So that's it, feel free to point out any mistakes in my summary :)
    Last edited: Feb 25, 2018
    JBR-games and JJC1138 like this.
  5. bitinn


    Aug 20, 2016
    Oh and one more thing: this is why Unity GPU profiler is not enabled by default - it doesn't work on every platform. In my case, an "Intel Iris Graphics 6100" on MacBook Pro 2015. So I have to figure out my issue the hard way.

    (click for larger image)

    Screen Shot 2018-02-26 at 15.44.46.png
    awesomedata likes this.
  6. RafaelF82


    Oct 28, 2013
    I wonder when this GPU profiler actually works.
    I have an AMD R9 290 and a nVidia GTX 745, the profiler doesn't work in either of them, drivers updated obviously.
  7. Paul-Kirby


    Jul 27, 2013
    I have a nVidia GTX 960 and it shows stuff when using DirectX11 in Unity shown below:

    However its blank for DirectX12 shown below:

    What I have noticed is an issue where its not displaying all the Timeline sections shown in this video I have created:

    I have not yet tried it in the beta version yet, so it may or may not already of been fixed.

    Peter77 likes this.
  8. qoobit


    Aug 19, 2014
    Not sure if people are still having this issue but my specific case got a response a while back and it had to do with the GeForce Experience overlay causing these issues. If you've already disabled VSYNC probably try to turn off or uninstall GeForce Experience to see if that helps.
    daisyDynamics likes this.
  9. daisyDynamics


    Dec 29, 2011
    Thank you! Disabling GeForce Experience Overlay instantly fixed the issue - made a massive difference.
  10. Peter77


    Jun 12, 2013
    Excellent catch!

    Did you submit a bug-report to Unity Technologies for this? I'm asking because if they don't have a bug-report for it, they're probably not aware of the problem and thus not going to fix it.
  11. DanJa512


    Dec 14, 2015
    I don't think it's a bug in Unity.. It also does this when using EVGA Precision X software, likely for the same reason (overlay).