Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Bug [windows platform] Priodically drop frames in an empty scene

Discussion in 'Editor & General Support' started by Wanwu314, Dec 6, 2021.

  1. Wanwu314

    Wanwu314

    Joined:
    Feb 28, 2021
    Posts:
    10
    Hi,
    When I ran the builded scenes on Windows, I noticed that the game would periodically drop frames.
    In that frame, Gfx.WaitForGfxCommandsFromMainTread spend a lot of time(about 70ms or more). And I notice that in that frame, "calls" of Gfx.WaitForGfxCommandsFromMainTread is 2 but in other normal frame it is 1. This seems to happen every few seconds.
    I wondered if there was something wrong with the setup because I was testing in an empty project without any code.
    I find this problem in Unity 2019.4.33 and 2020.3.34.
     

    Attached Files:

    Last edited: Dec 6, 2021
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,157
    Is there a reason you're using Vulkan on Windows? Does this happen in the player with D3D11 or D3D12?
     
  3. Wanwu314

    Wanwu314

    Joined:
    Feb 28, 2021
    Posts:
    10
    I've tried all the Graphics APIs, and I've gotten the same results.
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,157
    Can you show the profiler result from D3D11?
     
  5. Wanwu314

    Wanwu314

    Joined:
    Feb 28, 2021
    Posts:
    10
     

    Attached Files:

    • 1.PNG
      1.PNG
      File size:
      40 KB
      Views:
      197
    • 2.PNG
      2.PNG
      File size:
      17 KB
      Views:
      193
    • 3.PNG
      3.PNG
      File size:
      72.3 KB
      Views:
      193
    • 4.PNG
      4.PNG
      File size:
      65.5 KB
      Views:
      192
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,157
    The profiler suggests that Unity was waiting on the GPU to finish rendering the frame. These stalls can be pretty hard to track down (usually you'd use tools like GPUView) and most of the time it's caused by something else running on the machine at the same time using the GPU or the driver decides to delay your frames for whatever reason.