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.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Too much Gfx.WaitForPresentOnGfxThread on Android

Discussion in 'Universal Render Pipeline' started by dev_dash, Dec 30, 2022.

  1. dev_dash

    dev_dash

    Joined:
    Jul 26, 2020
    Posts:
    15
    I have build and run my game for Android with the Development build and Autocompile profiler. And the gfx.waitforPresent is presented more than 80% for just couple of UI Buttons in a scene.
    My project is using the URP and I turned off the vSync(Don't sync) for every Quailty settings. And I have removed or turned off every postprocessing and shadow, lighting that can affect performance.
    And here are my script settings.

    Code (CSharp):
    1. Application.targetFrameRate = 60;
    2. QualitySettings.vSyncCount = 0;
    Because of the waitForPresent thing, the game has about 30~40 fps even in simple UI scene.
    This problem occur on specific devices.

    Here is my profiling snapshot.

    I have heard that this is about the GPU that has much rendering burden. But on the device, It says it can't use GPU profiler so that I can't figure out what makes GPU problems.

    Any helps would be very appreciated. Thanks.

    -- I have digged more, the wait thing wait gpu work done. But the problem is that the GfxDeviceVK.present that on render thread is waiting something too. I think VK stands for Vulkan. Don't know anymore to solve this.









    And Here is same game profiler on cheaper device.

     
    Last edited: Dec 30, 2022
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,456
    As you said yourself, it's most likely a GPU issue (rendering + vsync).
    There are other ways like apps from the appstore which can measure GPU utelization.

    Disable post processing, optimize and atlas as much as possible, and more
     
  3. dev_dash

    dev_dash

    Joined:
    Jul 26, 2020
    Posts:
    15
    Like I said, I turned off every effects. Im gonna try gpu measure util.
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,456
    And it does run at 30 fps on an older device, so that's good.
    Probably still some tweaks which are possible
     
  5. dev_dash

    dev_dash

    Joined:
    Jul 26, 2020
    Posts:
    15
    Other games are running well on the device. I think there is something I don't know. Thanks anyway.