Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

GPU Light mapper Failing

Discussion in 'Global Illumination' started by Ghost_Tales, Sep 20, 2019.

  1. Ghost_Tales

    Ghost_Tales

    Joined:
    Sep 22, 2018
    Posts:
    6
    Hello there, recently got around to baking parts of my project. Ran into a problem. No matter how low I set the lighting settings, the light mapper fails to bake in GPU mode. I have a 980Ti, so the memory should not be an issue. The errors I get are the following,

    "OpenCL Error. Falling back to CPU lightmapper. Error callback from context: CL_MEM_OBJECT_ALLOCATION_FAILURE error executing CL_COMMAND_NDRANGE_KERNEL on GeForce GTX 980 Ti (Device 0)"

    "OpenCL Error. Falling back to CPU lightmapper. Error callback from context: CL_MEM_OBJECT_ALLOCATION_FAILURE"

    "OpenCL Error. Falling back to CPU lightmapper. Error callback from context: CL_MEM_OBJECT_ALLOCATION_FAILURE error executing CL_COMMAND_WRITE_BUFFER on GeForce GTX 980 Ti (Device 0)"

    Any suggestions or help would be appreciated, thank you.

    Edit: My Unity Version is 2019.2.5f1
     
    Last edited: Sep 20, 2019
  2. Polkatuba

    Polkatuba

    Joined:
    Oct 31, 2014
    Posts:
    79
    I'm having the same issue with GTX1080 8GB. It started happening when I added several large objects made with probuilder.
     
  3. Ghost_Tales

    Ghost_Tales

    Joined:
    Sep 22, 2018
    Posts:
    6
    Interesting. Did removing the large objects completely fix your problem?
     
  4. Polkatuba

    Polkatuba

    Joined:
    Oct 31, 2014
    Posts:
    79
    I haven't tried that, but reducing lightmap resolution from 40 texels to 20 seemed to help, for now.
     
    horeaper likes this.
  5. Eudaimonium

    Eudaimonium

    Joined:
    Dec 22, 2013
    Posts:
    131
    I'm seeing the same thing, it's rare occurence to get the GPU mapper going.
    It seems to be related to the new option in the mesh renderers.

    If you mark "Receive Global Illumination", two options are presented, via Lightmaps or via Light Probes.
    Apparently the "Light Probes" option is supposed to replace the old hack of using "0" in lightmap scale value when you wish for the object to affect baked light but not be lightmapped itself.

    However, using the Light probe option apparently assigns some INSANE lightmap scale to the mesh anyway. A couple of rocks filled up my entire 4096 x 4096 map. I forgot to turn off that option for a couple of trees and here I am, fresh machine reboot and looking up the forums to see if anybody has this problem.

    Is the new Light Probe option bugged? Anybody else seeing this?
     
  6. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Hi, right now you need a 16GB card if you want to bake a 4K lightmap, but 2020.1 should improve the memory usage situation a lot. If you don't have more than 8GB of GPU memory, go with 1K maps and you should have a much better time with the GPU lightmapper.
     
  7. Eudaimonium

    Eudaimonium

    Joined:
    Dec 22, 2013
    Posts:
    131
    Huh I could've sworn I baked 4096x4096 maps on my GTX1080 (8GB VRAM). Are there any other variables at play here that can influence the memory usage?
     
  8. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Perhaps the objects in your scene fit into a 2K map so a 4K map wasn't generated after all?