Search Unity

What is the Device.Present in Unity Profiler and why does it take so long?

Discussion in 'Getting Started' started by hgdebarba, Jun 21, 2017.

  1. hgdebarba

    hgdebarba

    Joined:
    Mar 12, 2015
    Posts:
    5
    Hello,

    I am trying to understand how the processing time in my Hololens application is being spent.
    It normally runs at 30FPS, but when I consult the Unity Profiler, it says that only around 8 ms is being spent on the actual rendering.
    To run at 60FPS, it is my understanding that the GPU processing tasks should stand bellow the total time of 16.67 ms. However, the Device.Present is taking around 25ms, eating up the reminder time of a frame (~8 ms) + a full frame.
    Does anyone knows how this time is being spent? I would expect that some of it is on time synchronization with the display, but 8ms sounds like enough spare time.

    Here is a figure of the profiler

    The mesh is pretty complex, and I am using the optimized vertex lit shader from HoloToolKit.

    Thanks a lot!
    Henrique

    P.S. I know that the GPU profiler consumes resources in the device, but the software was running at 30 FPS even before connecting the profiler. Thus, the added profiler time did not altered the final behavior in any meaningful way.
     
  2. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,183
    From my limited exposure to Direct3D and OpenGL, Device.Present is an instruction sent to the graphics card to take its rendered results and present them to the output device. Additionally if VSync is enabled in your game settings or in the GPU manufacturer's control panel it will wait for the next vertical refresh before continuing execution.

    According to a developer post from a couple years ago the most likely cause of an abnormally high amount of time being spent on it is the graphics driver is waiting for the graphics hardware to catch up. Before trying to optimize your scene though I would try shutting off VSync since that's the other possibility and it's an easy check.

    You can turn off VSync from the Quality Settings in the editor.

    https://docs.unity3d.com/Manual/class-QualitySettings.html
     
    JoeStrout likes this.
  3. hgdebarba

    hgdebarba

    Joined:
    Mar 12, 2015
    Posts:
    5
    Thanks for replying Ryiah,
    v-sync is already disabled in the quality settings.
    However, I am not sure whether the Hololens is capable of caring about this setting as I have never seen tears in the displayed images.
    Could it be the case that the delay due to render calls (38 in the screenshot) and/or potential poor memory management is not accounted for in the profiler?
     
  4. kartoonist435

    kartoonist435

    Joined:
    Feb 14, 2015
    Posts:
    73
    Was there any progress on this? I'm in unity 2017 with a normals scene getting 8fps because of Device.Present and I can't figure out what's causing this.