Search Unity

Bug Maximum GPU upload operation count exceeded

Discussion in 'Graphics for ECS' started by StefanWo, Dec 13, 2022.

  1. StefanWo

    StefanWo

    Joined:
    May 24, 2015
    Posts:
    124
    Hello,
    i got an Exception in my tests but i had no idea why and what i can do with it.

    It happens when i test a save/load test mechanism, so a lot of entities / materials and meshes are removed from the scene and added afterwards. Can it be, that its removed and added in the same frame causing this kind of problems, or duplicate unregister calls? It not happened outside of my Unittest, but it feels that there is something wrong :)

    ps.: Debugging in the class says around 170 for numGpuUploadOperations and 340 for gpuUploadOperations.Length.

    Code (CSharp):
    1. Maximum GPU upload operation count exceeded
    2. UnityEngine.Debug:Assert (bool,string)
    3. Unity.Rendering.EntitiesGraphicsSystem:UpdateAllBatches (Unity.Jobs.JobHandle) (at Library/PackageCache/com.unity.entities.graphics@1.0.0-pre.15/Unity.Entities.Graphics/EntitiesGraphicsSystem.cs:1753)
    4. Unity.Rendering.EntitiesGraphicsSystem:UpdateEntitiesGraphicsBatches (Unity.Jobs.JobHandle) (at Library/PackageCache/com.unity.entities.graphics@1.0.0-pre.15/Unity.Entities.Graphics/EntitiesGraphicsSystem.cs:983)
    5. Unity.Rendering.EntitiesGraphicsSystem:OnUpdate () (at Library/PackageCache/com.unity.entities.graphics@1.0.0-pre.15/Unity.Entities.Graphics/EntitiesGraphicsSystem.cs:1117)
    6. Unity.Entities.SystemBase:Update () (at Library/PackageCache/com.unity.entities@1.0.0-pre.15/Unity.Entities/SystemBase.cs:416)
    7. Unity.Entities.ComponentSystemGroup:UpdateAllSystems () (at Library/PackageCache/com.unity.entities@1.0.0-pre.15/Unity.Entities/ComponentSystemGroup.cs:670)
    8. Unity.Entities.ComponentSystemGroup:OnUpdate () (at Library/PackageCache/com.unity.entities@1.0.0-pre.15/Unity.Entities/ComponentSystemGroup.cs:628)
    9. Unity.Entities.SystemBase:Update () (at Library/PackageCache/com.unity.entities@1.0.0-pre.15/Unity.Entities/SystemBase.cs:416)
    10. Unity.Entities.ScriptBehaviourUpdateOrder/DummyDelegateWrapper:TriggerUpdate () (at Library/PackageCache/com.unity.entities@1.0.0-pre.15/Unity.Entities/ScriptBehaviourUpdateOrder.cs:526)
     
  2. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    351
    This error message indicates that there is probably a bug in the Entities Graphics package code. Would it be possible for you to submit a bug report with a repro project?
     
  3. StefanWo

    StefanWo

    Joined:
    May 24, 2015
    Posts:
    124
    Thanks for the fast response, it seems its just on some special testcase. Other testcases and at runtime i didn't had that. I directly use it in my huge project, so i guess i have no chance to create it reproducable in a separate repo. I can offer a screen sharing debug session, if that's an option.
    I will keep an eye on it if i figure out more details.
     
  4. JussiKnuuttila

    JussiKnuuttila

    Unity Technologies

    Joined:
    Jun 7, 2019
    Posts:
    351
    What kind of things is the test case doing? This error happens because the Entities Graphics package has not allocated enough memory for some temporary data, and there is probably something specific going on which causes it to compute wrong values. It's curious that the computed value (170) is exactly one half of the actual value (340).
     
  5. StefanWo

    StefanWo

    Joined:
    May 24, 2015
    Posts:
    124
    Year, that x2 i also recognized. Smells a bit like the removed and added values are wrong somehow?

    Actually an integration test that's doing a save-clean-load operation. So it should it should unregister the meshes and materials, and also destroys all the entities (what maybe cause a second unregister from your side?). Maybe they are unregistered twice?

    Than its directly adding everything again, partially through scenes, partially through own registerMesh/Material calls. So my next guess would be that the Add->Remove->Add causing problems in some situations.
    The other test that is similar, but not produce that error has another clear cycle before everything.