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

Can anyone explain this?

Discussion in '2018.3 Beta' started by georgeq, Nov 27, 2018.

  1. georgeq

    georgeq

    Joined:
    Mar 5, 2014
    Posts:
    662
    I've been reading lots of posts about profiling, the general avise is not to rely too much on what you see on the editor. You should profile on the actual build in order to get accurate data, that's what they say, but now that I'm trying to do some serious profiling I found something that just doesn't feel right. I don't know if this is a 2018.3.0b11 specific issue or if it is some other problem involved here. As you can see in the image below, the editor reports 60 FPS while the PC build reports only 15. I would expect at least a small performance improvement on the build compared with the editor, but I'm seeing the opposite. The game doesn't feel slow or laggy on the PC Build, but the real problem is that by looking at these data, I can't feel safe making decisions based on what I see on the profiler.

    profilebuild.png
     
  2. Don't be discouraged, this shows some problem for sure. The thing is Gfx.WaitForPresent shows that *something* is stalling your graphics card during rendering. What can you do:
    - check you VSync settings and turn on and off see, if you are missing the 16ms regularly (in this case you're dropping frames constantly), even if it's just 1ms...
    - try deep profile check what it's showing
    - you can check if your built game uses dedicated gfx card (if you have on-board one as well it can be very bad if it's using it)
    - oh and the NVidia in-game overlay known to caused such issue in the past, it worth to check if it's turned on, in case you have NVidia and GeForce Experience thing

    You feel safe making decisions again as soon as you learn what type of problems WaitForPresent represents.
     
    Last edited by a moderator: Nov 28, 2018
  3. georgeq

    georgeq

    Joined:
    Mar 5, 2014
    Posts:
    662
    Ok, thanks.

    I don't think this can be the problem, in the editor the game runs very close to 60FPS, and if that was the case the frame rate would drop to 30FPS not 15, but anyways I did turned off VSync and as I expected the results were the same.

    Deep profiling doesn't show anything suspicious, except for WaitForPresent, the rest of the game seems to perform just as it does on the editor.

    hmmm... I'm afraid I don't know how or where to check this.
     
  4. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,037
    There are things the profiler might not show, like things related to sound. Some graphics cards have all sorts of sound stuff too, so weird things can happen.

    The profiler isn't actually your only tool to hunt down this problem either. You could use the frame debugger in remote mode and try to make sense of it from there.

    You can get the name of the GPU used like this:
    https://docs.unity3d.com/ScriptReference/SystemInfo-graphicsDeviceName.html

    There should also be something in the log output about devices it found, but using the above method lets you print it to the screen in a debug overlay or something.
     
  5. If you're using Windows10 then you can see it here:
    gpu.PNG
    and you can see which is which here:
    gpu2.PNG

    BTW, I just did some experiments, I used a scene from the Realistic Forest pack on built-in pipeline and with the GeForce Experience overlay I've got 30FPS-ish, after disabled it and restarted my computer I'm getting 120FPS+ stable in the profiler.

    Since I forgot to record the times (ms), I switched back the overlay, now it does not affect the frame rate too much... :D Well, computer usage isn't deterministic nowadays, so whatever.
    Maybe after a couple of hours of run time it will.
     
    Last edited by a moderator: Nov 28, 2018
  6. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,037
    Hey, Task Manager is now useful!
     
    Lurking-Ninja likes this.
  7. georgeq

    georgeq

    Joined:
    Mar 5, 2014
    Posts:
    662
    Thank you guys, very useful.