Search Unity

HDRP baking: progressive GPU bake freezes on simple lighting setup

Discussion in 'Global Illumination' started by BigRookGames, Feb 13, 2020.

  1. BigRookGames

    BigRookGames

    Joined:
    Nov 24, 2014
    Posts:
    330
    It seems anytime I try to use progressive GPU bake on most scenes, the status bar says Baking... and never moves. I have to restart Unity everytime it does this. I have let it sit for 20-30 minutes and it never moves or gives an error or anything. If I hit cancel I cannot rebake anything with gpu or cpu. If i remove all the lights except a single light and a single object with baked lightmaps, it does the same thing.

    The weird thing is that sometimes it works fine on other scenes with very complex lighting, but then in a scene with 1 object and 1 receiving object nothing happens. cpu generally tends to work but that is not a viable solution in my use case because the lighting is very complex and it would take an hour or two every bake. I realize this is my own doing, but just wanted to see if there was any info on this, as I now have to restart Unity probably 1-3 times an hour through a 16 hour day, trying to figure out if i can change the lights to a state will will work.

    Other times, I will have all lights turned off and it takes 5 minutes to bake when, but the gpu and cpu are not running at all.

    Any idea what might be causing this when using progressive gpu?
     
  2. ModelWorksLondon

    ModelWorksLondon

    Joined:
    Nov 10, 2015
    Posts:
    12
    Yep I have the exact same issues. On 2019.0.3f the GPU Lightmapper was amazing for me, it worked fine, baked everything fast. Now on official 2019.3.1f1 and again literally can barely bake. GPU insta crashes, and CPU just hangs and takes forever. It more or less crashes my PC. I have the exact same issue of "Baking..." and it just sits there and does nothing. I find if I lower my lightmap size to 1024 instead of 2048 makes it do something, but I shouldnt have to do this. Im using a GTX 2080. Baffling
     
  3. BigRookGames

    BigRookGames

    Joined:
    Nov 24, 2014
    Posts:
    330
    Same here, 2080 ti and always have it set to 1024 due to having so many crashes. I did notice though going through and disabling lightmapping on higher geometry items helped a lot.
     
  4. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Hi, there may be information printed to the editor log file about what went wrong. The first thing that comes to mind would be memory usage. If memory usage is the culprit you can try 2020.1 alpha to see if this helps, as this version has much improved GPU memory usage characteristics. Allocating a separate GPU just for baking would be another way of testing this hypoteses.
    It would be great if you could submit a bug report so we can fix the cause af the hang, so you wont have to resort to restarting the editor.
     
  5. unit_dev123

    unit_dev123

    Joined:
    Feb 10, 2020
    Posts:
    989
    try update graphics driver
     
  6. BitAssembler

    BitAssembler

    Joined:
    Jul 13, 2017
    Posts:
    90
    Same here. We couldn't bake any of our scenes in the office. We have tried it on 5 different rigs:

    Nvidia GTX 980
    Nvidia GTX 1080 (single and double)
    Nvidia GTX 1080 TI
    Nvidia Quadro GTX8000
    AMD Radeon Pro WX 9100

    It always hangs on "Prepare Baking".
     
  7. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Which version are you on? The stackless BVH builder is quite slow and this could be what you are seeing (was introduced in 2020.1a9). Earlier versions and 2020.2 uses the fast stack based BVH.
     
  8. ModelWorksLondon

    ModelWorksLondon

    Joined:
    Nov 10, 2015
    Posts:
    12
    Lightmapper is just all over the place. I have a scene where it bakes completely fine. I create a new scene, re add my 3d from previous scene, re add all my settings and it wont bake. Just the usual "Preparing bake". I can go back to my original scene with exact same 3d and exact same settings and it bakes. Just a horribly buggy mess. This is on 2019.3.1f1

    Edit: Also when the "Preparing bake" hangs, unity cant be closed, the task needs to be ended in task manager
     
  9. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    QA took a look and it is almost certainly this issue https://issuetracker.unity3d.com/is...er-disabling-slash-enabling-static-gameobject - the fix is currently getting tested and should make it into a future patch release.
     
  10. muzboz

    muzboz

    Joined:
    Aug 8, 2012
    Posts:
    110
    I find baking in Unity completely and utterly impenetrable and frustrating.

    I've never done a successful bake, no matter how low the settings.

    So confusing, so frustrating.

    I just use realtime everything. :D

    Maybe one day it will make sense, and be practical.
     
  11. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,876
    The Progressive Lightmapper was working properly when it was a preview... but it has been having this problem since it went out of preview.
     
    BigRookGames likes this.
  12. WILEz1975

    WILEz1975

    Joined:
    Mar 23, 2013
    Posts:
    375