Search Unity

Unity Progressive GPU Lightmapper preview

Discussion in 'Global Illumination' started by KEngelstoft, Sep 26, 2018.

  1. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,148
    We are working on making it possible to bake lightmaps in smaller chunks, no firm eta but should land in 2020.x.
     
    xVergilx likes this.
  2. Vern_Shurtz

    Vern_Shurtz

    Joined:
    Mar 6, 2009
    Posts:
    264
    I'm also getting the following error. Is this ever going to get resolved?

    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 1070 (Device 0).
     
    DINmatin likes this.
  3. Crystalline

    Crystalline

    Joined:
    Sep 11, 2013
    Posts:
    143
    So unstable. It bakes the scene now... but a hour later, or another day (no changes to the scene) and it wont bake anymore, instead saying its out of memory and switches to cpu.
    1060 6GB.
     
  4. JamieVRcade

    JamieVRcade

    Joined:
    Oct 21, 2012
    Posts:
    23
    I would like to additionally add that, while the RX 580 allowed me to lightmap and fix all of my problems that I have been having for the better part of a year, the RX 590 works equally well.
     
  5. LubosCzech

    LubosCzech

    Joined:
    Apr 7, 2018
    Posts:
    3
    I have problem with GPU light mapper, I bought 5700 xt to replace my gtx 1060, but when using GPU mapper, it writes me in console:
    OpenCL Error. Falling back to CPU lightmapper. Error callback from context: CL_INVALID_KERNEL

    So it fallbacks to CPU.

    Anyone know, what can be problem?
     
  6. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,148
    The fix for that issue landed in 2019.3.0b7
     
  7. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,455
  8. Werti100

    Werti100

    Joined:
    Aug 3, 2018
    Posts:
    21
    Keep up the good work guys, ever since we've updated to 2019.2 I've been enjoying the heck out of the GPU light mapper. It's not perfect but it does a pretty good job, looking forward to the upgrades coming in future updates.
     
    Kuba, Rich_A and KEngelstoft like this.
  9. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,148
    Hi Lars, it is greyed out because the Radeon denoiser isn't available on macOS yet, it is on the roadmap so rest assured we will add support in a future release.
     
    Lars-Steenhoff likes this.
  10. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,148
    A couple of improvements just landed and will appear in 2020.1.0a15 :)
    • Compute device can be selected in a dropdown in the Lighting window.
    • Limit memory allocations for light probes to fit in available memory when baking with progressive lightmappers.
     
    Lars-Steenhoff likes this.
  11. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,148
    One more improvement landed in 2020.1a15: A-Trous filtering for GPU lightmapper :)
     
    ROBYER1, Lars-Steenhoff and Mauri like this.
  12. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,392
    @KEngelstoft just curious, any plans to add BentNormal baker?
     
  13. Loards

    Loards

    Joined:
    May 2, 2013
    Posts:
    105
    Hi! i was having a lot the issu of fall back to CPU today and i changed to the 2019.3b12 and now i don't have any baking at all (along with the still persistent fallback to CPU error) it get stuck in the "preparing to bake" text and that's it, i can work and use unity, but just don't bake.

    Is there an ETA to when the GPU will be stable? or out of preview?

    Now it's not even falling back to CPU, just getting stuck in "preparing to bake"

    Thanks!
     
    Last edited: Nov 22, 2019
  14. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    943
    Same here. Once the lightmapper failed, it than stucks at baking every next time you try to bake not matter what even when switching to CPU and then back to GPU unless you restart the engine.
     
    Loards likes this.
  15. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,148
    We don't have it on the roadmap, but perhaps you can generate your own bent normal map using the intensity and directionality components of the lightmap.
     
  16. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,148
    We are hoping to have it feature complete in 2020.2.It will go out of preview once it is deemed stable and production ready.
     
  17. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,392
    I'm bit confused, you mean we can use the existing baked map directly and treat them as bent normal in shader?. Or doing another precompute to convert the maps into new bent normal texture?
     
  18. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,148
    My suggestion is to do your own conversion based on the intensity and directionality maps. Please create a new thread if you get stuck, as this is not specific to the GPU lightmapper.
     
    Reanimate_L likes this.
  19. Polkatuba

    Polkatuba

    Joined:
    Oct 31, 2014
    Posts:
    77
    "OpenCL Error. Falling back to CPU lightmapper. Error callback from context: CL_MEM_OBJECT_ALLOCATION_FAILURE error..."

    Unfortunately this issue has not been fixed in 2019.3
    Light probes are still unusable with GPU baking.
     
  20. SquallLiu

    SquallLiu

    Joined:
    Jun 19, 2017
    Posts:
    28
    Do the following adapters support progressive GPU lightmapper?
    Nvidia Quadro RTX 8000
    Nvidia Quadro RTX 6000


    We want to build a PC that aims to bake lightmap only,
    and need to make sure whether these adapters can work with progressive GPU lightmapper.
    We're afraid of lacking VRAM.

    Thanks,
    Squall
     
    Last edited: Dec 6, 2019
  21. ROBYER1

    ROBYER1

    Joined:
    Oct 9, 2015
    Posts:
    743
    Anyone else getting these beautiful Black square artifacts produced by having Optix filtering on or Filtering set to 'Auto'?

    Reproduced on Unity 2020.1.0a14 at Case 1203538

    whyyyyyy.PNG
     
  22. hasseyg

    hasseyg

    Joined:
    Nov 16, 2013
    Posts:
    42
    Hi, I have been having a problem where using the CPU lightmapper I get the results I want but when I switch to using the GPU, it has a different undesirable result. As you can see from the screenshot below the directional light comes through the window and bounces from the floor, up onto the ceiling. However when switching to the GPU this does not happen. The indirect intensity is set to 1.4 and the mesh only has 1 material. I am using 2019.3.0f1. Is anyone else having problems like this?

     
    Last edited: Dec 7, 2019
  23. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,148
    Light probes memory usage is addressed in 2020.1 so please use that version if possible.
     
  24. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,148
    Yes, I can confirm that Quadro RTX8000 works with the GPU lightmapper.
     
  25. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,148
    Can you please test on latest 2020.1 alpha and let me know if it still happens there? The output should be identical to CPU.
     
  26. hasseyg

    hasseyg

    Joined:
    Nov 16, 2013
    Posts:
    42
    Hi, yes the result is the same. The CPU and GPU still bake differently. I am using a 2060 Super. thanks
     
    Last edited: Dec 17, 2019
  27. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,148
    Please file a bug report so I can investigate and fix this. Thanks!
     
  28. hasseyg

    hasseyg

    Joined:
    Nov 16, 2013
    Posts:
    42
    Hi, I have filed a bug report: Case 1206157
    thanks
     
    KEngelstoft likes this.
  29. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    6,438
    Can I ask some details about the Russian Roulette Start Bounce features?

    From what I can gather, it enables terminating bounces early if it deems them to not really contribute much to the scene (kinda like inverse importance sampling? :p ), giving a speed boost.

    That sounds fine, but the tooltip (and other info I can find), says that using the feature might increase noise, which means I'll need more rays, which means it'll become slower, meaning I'm probably losing whatever speed gains I got by using the feature?

    Or does it make things so much faster that even with the bump in samples, it's probably still faster? (also I'm guessing it's highly scene dependent, but so far I'm having trouble imagining on what types of scenes it'll work better).
     
  30. ADufay

    ADufay

    Unity Technologies

    Joined:
    Jan 2, 2020
    Posts:
    1
    Hello, yes it is highly scene dependent and there is no short answer for this.
    To explain it a little bit more: when you bake a lightmap 60-90% of the computation time is spent on shooting rays in the 3D scene (resolving visibility betweens triangles). So the longer a light path is (more bounces) the longer it is to be computed.
    To make the bake faster Russian roulette tries to shorten light paths (stop making them bounce) when the path is supposed to have a low contribution to the lightmap.
    The problem is that, knowing if a path will have a low contribution can't be fully known without making more bounce. Russian roulette uses some a priori criterion, in our case, the albedo of the different materials encountered on the previous bounce to estimate the contribution of the light path.
    It can then bring more noise if you have light sources in your scene that are hard to reach by a light path, i.e. that need a light path with a lot of bounces. Think about a room with no lights, a slightly open door and light sources outside that room. You will need 3 or more bounces for a light path to gather light for all the walls in the room.

    I would say that for most typical scenes, where your light sources are inside the room 2 bounces are enough and you won't see noise with using RR at bounce 2.
     
    AcidArrow likes this.
  31. pjpalomaki

    pjpalomaki

    Joined:
    Apr 20, 2019
    Posts:
    2
    What sort of GPU would be optimal for this once it's out of preview? I assume NVidia? Quadro RTX8000?
     
  32. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,148
    The GPU lightmapper works fine on both AMD and Nvidia hardware.
    Once out of preview you should be able to get by with much less memory than the 48GB that the Quadro RTX8000 has. A card like the Radeon VII or other cards with 16GB of memory is more than enough for most scenes at the moment. Once out of preview 8GB or even 4GB cards should suffice, especially if you dedicate a GPU just for baking. Memory usage is very scene dependent and if you only have one GPU, it also has to accommodate the usage by the Unity Editor, lightmap denoisers, usage by other applications and what the OS is using for itself.
     
    Lars-Steenhoff likes this.
  33. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    252
    I have a problem with the GPU lightmapper. The progress bar stucks at "Preparing Baking" forever and my scene glows like a nuclear explosion. Does this has something with Emissive materials? But my scene only uses realtime emissives.
     
  34. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    432
    Try setting GI contribution for your emissive materials to None, and see if that helps.
     
  35. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,148
    I am happy to announce that Baked LOD support has landed in 2020.1.0a20 and it is very fast compared to the CPU version.
     
  36. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,392
    Oooh need to see this in action, any specific detail that we need to prepare on the LOD meshes?
     
  37. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,148
    No, if the meshes have lightmap UVs it should just work.
     
    Reanimate_L likes this.
  38. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,392
    Awesome
     
  39. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    252
    How can I determine what are the highest settings that my GPU can bake with Unity?
    I ran into an issue when I want to bake a rather small scene with a lightmap size of above 1024px but it aborts and switches to CPU lightmapper.
    I have a RTX 2060.

    OpenCL Error. Falling back to CPU lightmapper. Error callback from context: CL_MEM_OBJECT_ALLOCATION_FAILURE error executing CL_COMMAND_WRITE_BUFFER on GeForce RTX 2060 (Device 0).

    And my device has two GPUs. How can I use that extra power for the lightmapper?
     
  40. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,148
    We have improved the memory usage of the GPU lightmapper since it came out as a preview and will continue to improve it, to bring it to a production ready state. Memory usage depend on which version you are on, but latest 2020.1 has the lowest memory footprint so far.
    You can choose to assign one GPU for the editor and a different one for the GPU lightmapper. This way you can dedicate an entire GPU's memory and compute power to the lightmapper if this is what you need. See the `How to select a specific GPU for baking` section here https://forum.unity.com/threads/progressive-gpu-lightmapper-preview.561103/
     
  41. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    252
    I'm using the latest Beta of 2019.3 and cannot switch just for Lightmapping.
    But perhaps I could bake my scene with 2020.1 and transfer the lighting assets back to my 2019.3 version? Is lighting data asset compatible? I also use light probes.

    I rather mean using two gpu for the lightmap baking procress. Cannot beliebe my new RTX is that slow for baking a small screen. Just hoped the new technology is more worth the price ...
     
  42. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,148
    Memory usage when using light probes is much improved in 2020.1. Your graphics card has 6GB of memory so I think you will be limited to 1K lightmaps or smaller in 2019.3.
    Multi GPU is on the roadmap but we will focus on memory usage, stability and more performance before looking at parallel multi GPU support. We are not using hardware accelerated raytracing yet so your RTX card might feel faster in a future version ;-)
     
  43. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    252
    I really hope Unity will use the full potentional of RTX cards soon, seeing all other creative applications supporting it mentioned in a Nvidia article. It read about up to 40% faster with the hardware raytracing and for Blender up to 4 times faster. So what do you think how much faster the Unity gpu lightmapper then will be?

    I see video ram is an issue. When I tried to bake 2048px, I get that gpu baking cancelling right at the start. So then I tried to decrease the texel. That worked until just a small portion of the scene was not lightmapped and then it suddenly decides to fall back to cpu baking.
    So can we have a toggle or information if the whole scene can be baked by gpu lightmapper with the resolution at once? I really hate to wait just to get an error just the last remaining minutes.
     
    Last edited: Jan 16, 2020
    Shizola likes this.
  44. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    461
    @KEngelstoft Hi. will the Light probe memory usage fix be backported to 2019.3?
     
  45. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    461
    @KEngelstoft Also, my project is failed to bake with NVIDIA Geforce 2080 (included lightprobes). So I will change my GPU to NVIDIA Titan RTX (24GB VRAM). Before upgrade, I want to know Titan RTX can be used for GPU lightmapper.

    I used 2019.3 (and fixed 2019 cycle for final release maybe), light probe can be baked with large VRAM gpu? (it seems that 2019.3 has lightprobe memory issue but I want to know can I avoid it by using more VRAM).
     
  46. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    252
    Can somebody please tell me why I get that ugly glowing rectangle on my lightmap? That looks out of place and just wrong.
     

    Attached Files:

  47. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,148
    No. We don't want to risk destabilizing 2019.3 by backporting new features. Please use 2020.1 if you need this.
     
    laurentlavigne likes this.
  48. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,148
    Yes, Nvidia Titan RTX is supported.
    You could also try collapsing all your light probes into one Light Probe Group if you don't want to upgrade to 2020.1 where this workaround is not needed any more.
     
  49. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,148
    It could a NaN value but it is hard to narrow the cause down from a single screenshot. Can you please try again and disable the denoiser?
     
  50. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    461
    Thanks for clarification. My project already has single LightprobeGroup (but many light probes, about 10K~30K). Is this not affected from LightProbe gpu lightmapper issue?
     
unityunity