Using 6.2 beta, I tried to bake lights in a medium sized scene with about 10m tris rendering at a given moment. The first time I tried to bake lights, my editor completely crashed. The second time, my editor completely bugged out and was using so many resources to the point where I could barely move my cursor. What is causing this to be so buggy?
#Potential causes of editor permanently freezing or crashing during light baking process?
1 messages · Page 1 of 1 (latest)
If it fails without an error I'd usually expect a GPU incompatibility or driver issue
Could be a scene complexity issue too, if it's just way too much to bake
10M tris sounds like too much
Lightmapper is not effective at baking anything high-poly, and lightmapping in general works the best on flat surfaces
I've never experienced this issue when baking lights before so i doubt that's it
so how is light baking handled in hyper realistic games? is it usually realtime lighting only?
When it happened to me it occurred quite randomly
Could happen when editor version changes, or when something's different in the temporary editor files of your project, or if something in the OS changes about how the editor and the GPU communicate I suppose
It's very cryptic so updating drivers and baking in test scenes and test projects is always worth it to ensure you're not looking for issues in the wrong place
If you assume the problem is in your scene or lighting settings, and it's somewhere above them you can spend forever testing solutions to no avail
On the contrary, baked GI and anything else that can be baked when it's an option
Precomputing is much cheaper and with lighting gives you realistic light bouncing for free
i dont think I was very clear with my question. Since you said that the scene might be too complex for baking, I was asking what other alternatives there were if that was truly the case.
Did you try looking at the editor logs for the reason of the crash?
Light baking can get very intensive and possibly cause a GPU timeout(which would result in a crash). There should be some info in the logs about the type of crash.
If it is a GPU timeout indeed, increasing the tdr delay might just fix your problem. The editor would still be not very responsive during the baking though. But this is normal.
Basically, you need to investigate the issue.
thanks for the response. i tried looking at the logs after the crash, but the logs dont update afterwards. I just tried baking the same scene again and my editor crashed, but the logs that show are from a few hours ago
what is tdr delay and where can I find that in the light settings?
Hmm... Was there no crash report or something popping up?
yes, there was a pop up
It's a windows setting. You can Google ways to configure it.
Also, I'd look at the manual if you didn't yet. It has some info on the GPU light mapping requirements and the impact of different settings:
https://docs.unity3d.com/6000.0/Documentation/Manual/GPUProgressiveLightmapper.html
That being said, the fact that unity doesn't output a crash report(at least in the logs) is very weird.
i see. but if that was the case, wouldnt all other processes that are utilizing the GPU and are also running at the same time also crash (like chrome)?
Additionally, you could try looking in Event Viewer → Windows Logs. That should record any instances of apps shutting down incorrectly.
Not necessarily. Each app creates their own "GPU device instance".
on another note, i tried rebaking my scene without setting any of my lights to baked, and my editor didnt crash, but it did spit out these errors
ah i see
Buut, if it's a timeout, then yeah, probably everything should crash.
What graphics api do you have set in the player setting BTW?
im on windows running dx11 i believe
Because opencl is something related to vulkan AFAIK.
this is all so confusing
Hmm... Maybe not. It seems to support many different platforms.
ok so i just tried baking lights again and it seemed to work...?
my editor didnt crash, but it doesnt feel like it worked even though it says it finished
yeah im getting the same fps as i did before so im inclined to believe that nothing actually happened
Did you actually mark objects as lighting static and change lights to baked?
yeah i just checked again and my setup seems fine
shouldnt it show the lightmaps that were baked in this area? or is that URP only? im new to HDRP so im not too sure
I think it should. Though to be honest, I don't have much experience with hdrp myself...
1700 lightmaps? that cant be right, can it?
Sounds like a lot indeed.
And it wouldn't be complete in 3 min for sure.
Or was it hours?
no you're right. it was 3 mins
Maybe try clearing the lighting data and trying again.
Also, did you try to use the cpu light mapper instead?
i just let that bake finish and it took 3 mins, but i keep getting these 2 errors again
i think that would blow up my pc 😅 im running a 9th gen core i5
i'll give it a shot though
This sounds like not enough vram for the operation.
ah that could be it. i only have 8 gbs vram
It should be fine as long as you have enough memory. Might take a long time though.
Make sure you don't have any other apps that consume a lot of vram running at the same time. The manual says you need to have at least 4 GB.
the only other things i have open are discord and chrome 😔
Maybe unity itself is also getting in the way. How much vram does it use before baking?
only 2.5gbs apparently
while baking, it climbs to 8 but doesnt seem to hit 8 at all
Well, if it tried to allocate more than 200 in this state, it would definitely cause a crash.
Though, I'd assume it's implemented in a way where this shouldn't happen
yeah but it only climbs this high very early on during the baking process. afterwards, it doesnt seem to push more than 5gb before it crashes
What does the light mapper progress window shows?
seems to progress normally apart from sometimes blanking and showing nothing
Does it show how many light maps there are?
just so we're clear, you're talking about the background tasks window, right?
No. The bottom of the lighting tab with the baking settings.
no it always shows this ^
just the bake time and the device
i assume any lightmaps that were generated before the baking process crashed (if any) get deleted after the crash
okay
ugh i'm not sure if i'll ever find a solution so i think it's best if i just call it quits on trying to bake lights for this scene specifically. thanks for the input @remote cypress @mint dock yall rock
Ah yes
Most of the time not everything needs lightmaps, and not everything needs to contribute to GI
Small or complex meshes can be set to receive GI from probes instead, or to not contribute at all
Also if you intend to bake lightmap for a level, you learn to avoid the kind of geometry that's inefficient to lightmap from the get-go
That's fine, though there's plenty of troubleshooting methods you could have used
Mainly test bakes on only parts of the scene to confirm that it doesn't fail regardless of what's in the scene