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

[2019.3.0f3] CPU spikes in "PutGeometryJobFence"

Discussion in '2019.3 Beta' started by mpgholden, Jan 13, 2020.

  1. mpgholden

    mpgholden

    Joined:
    Aug 21, 2014
    Posts:
    38
    I'm seeing CPU spikes throughout my game in 2019.3.0f1 and 2019.3.0f3 that I was not seeing in 2018.3.x, and was curious to see if it's a known issue. When I make builds without multithreaded rendering and profile in an area with light rendering requirements, I can see spikes showing up in "PutGeometryJobFence" under CullScriptable -> CullResults.CreateSharedRendererScene.

    This is seen on Oculus Quest using URP 7.1.7. I can't reproduce the issue in the editor.
     

    Attached Files:

    Last edited: Jan 14, 2020
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,609
  3. mpgholden

    mpgholden

    Joined:
    Aug 21, 2014
    Posts:
    38
  4. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    Are you able to report a bug for this?
    And post a screenshot of the Timeline Profiler, so we can see what the job threads are doing during this time?

    Thanks for letting us know!
     
  5. mpgholden

    mpgholden

    Joined:
    Aug 21, 2014
    Posts:
    38
    On the timeline, it's coinciding with MeshSkinning.Skin. The spikes do appear to scale with the number of animated SkinnedMeshRenderers in the scene.

    I submitted a small repro project (case 1211503), but in that repro, the cost is mostly sustained. It's very spiky in our main project (as you can see below).

    upload_2020-1-14_11-1-35.png
     
    LeonhardP and richardkettlewell like this.
  6. mpgholden

    mpgholden

    Joined:
    Aug 21, 2014
    Posts:
    38
    I've continued looking into this, and I've got a few more data points to add. The spikes still happen when:
    • reducing the number of skinned mesh renderers in the scene
    • swapping out our skinned meshes for very low LOD versions (under 1k verts).
    • disabling all animators in the scene
    • reducing eye texture resolution scale to 50%
    If there's any more data or troubleshooting I can try here, please let me know! We're trying to lock down our art specs for this game and it's a little scary to go wide on asset creation before we know if what we're building will run. We _think_ it should run based on the games we've made for Gear VR, Daydream, Go, etc, but we are hoping to use some of the URP's lighting features in this game.
     
    richardkettlewell likes this.
  7. mpgholden

    mpgholden

    Joined:
    Aug 21, 2014
    Posts:
    38
    This is still happening in 2019.3.3, and killing our performance on Quest. MeshSkinning sometimes takes upwards of 20ms on the render thread one frame, than 3-5ms on the next few. Frequency definitely scales with the number of skinned meshes onscreen.

    I provided a new repro project and directions as requested on the bug (1211503), but haven't heard back in a few weeks. Any help here would be much appreciated!
     
    Peter77 and richardkettlewell like this.
  8. mpgholden

    mpgholden

    Joined:
    Aug 21, 2014
    Posts:
    38
    I uploaded a new repro project to the same case number that exhibits the problem using nothing but a bunch of copies of a character model in a scene with a looping animation - no scripts. I also confirmed this happens with legacy rendering, in addition to with the URP.

    Also uploaded an APK of a Quest dev build that shows the issue very clearly in the profiler.

    If there's a place I should start a new topic on this issue since this is an archived forum, please let me know. Determined to get the bottom of it!
     
    richardkettlewell likes this.
  9. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
  10. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,609
  11. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    I've "curated" that user's comment :D
     
    Peter77 likes this.
  12. mpgholden

    mpgholden

    Joined:
    Aug 21, 2014
    Posts:
    38
    Thank you! It certainly sounds related, but to make sure this is actually the same issue - I can reproduce this without URP, and the spikes from my repro projects are showing up under MeshSkinning.Skin or PutGeometryJobFence rather than Semaphore.WaitForSignal.