Search Unity

Realtime GI freezing unity at runtime

Discussion in 'Global Illumination' started by snacktime, Oct 20, 2019.

  1. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    Took me forever to track this down and it's still somewhat sporadic.

    With a terrain where you have bake lightprobes for trees disabled, unity will often freeze loading the scene. Seems to mostly only happen on first scene load if it happens. I'd say around 70% of the time or so.

    When it does it's always the same pattern in the logs. The following but then followed by hundreds more JobTempAlloc warnings. Eventually they stop at around the same time the Unity process cpu usage tapers off to 0.

    Code (csharp):
    1.  
    2. gi::BakeBackendSwitch: Clear() active clients.
    3. gi::BakeBackendSwitch: switching bake backend from 3 to 1.
    4. Internal: JobTempAlloc has allocations that are more than 4 frames old - this is not allowed and likely a leak
    5.  
    So the whole light probes are missing sort of makes sense with the pattern. It's expecting something that isn't there and keeps trying to do something until eventually it ends horribly.

    I tried to make a consistent repro, but it also seems to trigger far easier in our actual game scene which has some very heavy jobs from multiple unrelated systems that are loading/calculating stuff. I tried just introducing a load in the attempted repro but didn't produce the consistent freezing. So at the least if others are having this same issue maybe the same workaround will work, which is to just toggle bake light probes for trees even if you don't have any.