Cannot bake lightmap with GPU in Unity 2022.3 and URP

Hi,

I’m using Unity 2022.3 and URP to bake the lightmap in my large terrain (4000x4000). I split the terrain in to 4 parts and also split the objects in the maps into multiple scenes. I put one directional light on the terrain scene (DaytonIsland).

Here is my light settings:

Issues:

  • Everytime I bake the lightmap, it always falls back into CPU and show the warning below. I’m using RTX 4090 + AMD 7950x + 64 GB RAM
    OpenCL Error. Falling back to CPU lightmapper. Error callback from context: Not enough GPU memory to fit lightmap in memory, even in tiled baking mode. Available GPU memory: 0 B

  • After finishing baking, the Lighting Data Asset is not assigned into the Baked Lightmaps windows in all the scenes except the one with terrains. I have to drag the each Light Data Asset into that field.

  • Some objects in terrain scene doesn’t have indirect lightmap from the objects from other scenes (objects only, no terrain). I don’t know whether this is caused because they are from different scenes (I bake lightmaps in multi-scenes setup)?

  • As the information from this post , I should set the light intensity of the directional light object somewhere 400. However, the map is very bright when I set to 10 already. So which value I should set?

Hey, this looks like Unity 2022.3, not 2023.3. Is that correct?

Just to be clear, this will try to bake all of those scenes together. It’s likely that even with your graphics card that’s just not possible because of the size of the scene / lightmaps. You can try to decrease the ‘Max Lightmap Size’ to perhaps make it easier for the Lightmapper to handle.

Yes. I tried to bake all scenes together since there is no way to bake each scene with terrain (I have 1 scene with the terrain split in to 4 part and 20 other scene with objects on the terrain). Or you could share with me how to split the scene to bake?

I will try to reduce the lightmap size then but even with lightmap resolution 2, why this could be a problem?

@giorgos_unity I reduced the Size to 512 and can bake with resolution 4-6. However, I cannot increase the Resolution over 6.

I’m having the exact same issue. I feel it’s quite unlikely my GPU has ‘0B’ available, and this is a leak within Unity.

“OpenCL Error. Falling back to CPU lightmapper. Error callback from context: Not enough GPU memory to fit lightmap in memory, even in tiled baking mode. Available GPU memory: 0 B”

@MetaDOS can you send a bug report about this issue so we can take a look?

Sent long ago.
IN-64371

Great! I’ll push for it to reach us. Thanks.