Search Unity

Out of memory errors at every single step. Possible reasons?

Discussion in 'Global Illumination' started by Flamacore, May 14, 2019.

  1. Flamacore

    Flamacore

    Joined:
    Dec 17, 2013
    Posts:
    140
    Hello there :)

    After doing tons of research, I've learned that proper lightmap settings are crucial for a healthy baking - NOT the highest values you can get. So obvious stuff aside, I'm having a problem with my current scene and looking for suggestions, potential leads and maybe some experimentation ideas to fix the problem.

    Using Unity 2019.2 beta.
    Progressive GPU
    1 Mixed Area Light (Huge)
    7 mixed Spot Lights
    15 Realtime Spot Lights.
    Terrain is turned off for testing purposes.

    The problem is that I'm getting "xxx job failed, out of memory" errors at every single step of the baking process. this applies to 5 jobs specifically. Progressive Lightmapper Gbuffer, Material render and AddMaterial jobs, Clustering jobs and LightTransport jobs. The requested memory ,s resulted around 28GB's of memory when I tried with Lightmap Resolution set to 16.

    Also, when the Lightmap Resolution is set to 16, the baking never finishes (even after 14 hours) and as I check from the task manager, any usage on GPU and CPU stops after a certain job fails I guess.

    Take a look at these settings:
    upload_2019-5-14_11-40-55.png

    After setting the LM resolution to 4 (joke?), I could finally get past baking and move forward to clustering and light transport phase but it took a gigantic amount of time and still did not finish after long hours as well.

    Can anyone point me to a reasonable way to solve this? Any golden checklist for example? Or key points?
    Thanks in advance.
     
  2. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    What kind of GPU do you have? Chances are, your GPU does not have an adequate amount of VRAM to fit all the lightmaps in flight.

    Have you tried the CPU lightmapper? If you happen to have a reasonable amount of system memory in your machine, CPU lightmapper should succeed in baking your scene.
     
  3. Flamacore

    Flamacore

    Joined:
    Dec 17, 2013
    Posts:
    140
    Ah good question, forgot to add that :)

    Specs:
    GTX 1060 6GB
    16GB Ram
    i7 7700K CPU

    Maybe still not tnough?
    Tried the CPU, the amount of time is clearly increased but since I could literally never finish the entire baking process, can't say the exact amount of time it took to bake. But yeah it takes much more time, that's for sure. I'm thinking about something should be wrongly set in my scene but can't think of anywhere to look into...
     
  4. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    It looks like you are using both precomputed realtime GI and baked GI, is this intentional? Enlighten precompute will require additional memory so perhaps try one or the other to narrow down what is taking too much.