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. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

GPU lightmapper preview

Discussion in '2018.3 Beta' started by KEngelstoft, Sep 26, 2018.

  1. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
  2. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,744
    This is great, thanks!
     
  3. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    OMG!!
    and where is 2018.3b3?
     
  4. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,334
    Awesome news!
     
    TokyoWarfareProject likes this.
  5. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,334
    27th of September
     
  6. Justin_Wingfall

    Justin_Wingfall

    Joined:
    May 15, 2014
    Posts:
    125
  7. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
  8. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Getting good speed. about 10 times the speed of baking on the CPU.

    This was a 14 core i9 CPU vs a 1080Ti graphics card.
     
  9. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    damn ... i got this warning :\
    what is this?
    Capture.JPG

    and seems that switching to CPU again :[
     
  10. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    1,183
    Really nice speed. Too bad, that it doesn't handle scaled meshes yet. I know that scaled transforms should be avoided in general, but there's usually no way around it and our level designers like to use scaling for a lot of things. Looking forward to the complete feature set. I'm liking the preview so far. :)
     
    Lars-Steenhoff and hippocoder like this.
  11. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Falling back to CPU happens when there isn't enough GPU memory available. What GPU do you have? Please attach the editor.log
     
  12. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
     

    Attached Files:

  13. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    You Geforce 750Ti card only has 2Gb of dedicated GPU memory and that is shared with the rendering in the Editor viewport. You can try the following to lower GPU memory usage:
    - Disable lightmap view prioritization
    - Disable lightmap supersampling (https://docs.unity3d.com/Manual/class-LightmapParameters.html Baked GI - Anti-aliasing Samples)
    - Disable the post processing stack if you use that.
    - Use non-directional lightmaps
    - Use a smaller lightmap size to make it fit in GPU memory.
     
    RakNet and cworld like this.
  14. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    ok ... but what about this? [totally 10 GB memory??]

    Capture.JPG
     
  15. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Those 10Gb is the combined 2Gb of dedicated GPU memory and 8 Gb of shared system memory and is not accessible for us to use on Nvidia cards as it is the driver that decides how to manage the buffers and it doesn't allow virtual GPU memory. So once you the 2Gb are used, we run out.
    On AMD cards, the driver can swap to main memory but once this happens the baking will become slower.
     
  16. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    380
    This is an exceptionally great improvement! Love it to death so far! Though now I only need to get a GPU with more memory...
     
  17. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    so ... i have to planning to buying new AMD cards with more than 16 GB of vram :rolleyes:
     
  18. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Keep in mind that this is a preview, we aim to lower memory consumption before releasing the final version.
     
    xVergilx, hippocoder and optimise like this.
  19. ReignOfDave

    ReignOfDave

    Joined:
    Oct 22, 2015
    Posts:
    51
    Im also getting the openCL issues as well on a gtx1080ti

    upload_2018-9-27_23-33-0.png
     
  20. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    well ... i hate AMD!! but seems that reality is different [specifically for using GPU lightmapper to baking large architectural scenes] ... GPU lightmapper can't use nVIDIA shared memory and gets lower speed when using AMD shared memory [means system ram] ... so, cuz nvidia don't have fair price cards with 16GB of vram , AMD is only real choice for now that have cards with 16GB of vram or at next release with over 16GB of vram maybe!?
     
    Last edited: Sep 27, 2018
  21. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    i'm just curios about Bakery [nVIDIA Based] vs GPU Lightmapper [seems that AMD based??] :cool:
     
  22. Fuzzy

    Fuzzy

    Joined:
    Feb 11, 2011
    Posts:
    266
    If they used Nvidia, I wonder if they could utilize their new RTX tech for ray traced lightmap baking.
    But hey, at least it's already way faster than before.
     
  23. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    RTX taking ages to implement in unity!! i guess :confused:
    and its expensive tech ...

    P.S: Holys**t !! i'm just testing bakery on old 750ti!! just 10 sec vs 4 hours CPU to baking an interior scene like as Archvizpro interior 1 ... its amazing!! :cool: [only nVIDIA]
     
  24. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    617
    Just tested my scene using a gtx 1080ti and it was 5 mins to bake vs over a hour with 2700x. Nice!
     
  25. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    405
    cool, and much faster...

    but I have to question the workflow.
    any small change and you are rebaking the entire level again and again and again.
    while baking the editor is slow, and again any small change will restart the baking.

    would it not make sense to preview what it looks like?
    I made a proof of concept tool like a year and a half ago...stopped cause unity announced gpu lightmapper, otoy released, and bakery asset.
    https://forum.unity.com/threads/wip-lightmapper-editor-runtime.473081/


    even 4 years ago, you were showing preview with powervr while enlighten would bake final.


    not complaining, just a critique
     
  26. Justin_Wingfall

    Justin_Wingfall

    Joined:
    May 15, 2014
    Posts:
    125
    not working. what the hell.

    Im have a i5 intel and 1080 ti. and it falls back on cpu. My Gpu has 11gbs of memory. That means I have to go into registry? Are there other steps I can take? Am I missing something. I know I'm not the only one with this setup, maes no since.
     
  27. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    It is based on RadeonRays which works on GPUs from all vendors.
    The source code is on GitHub here if you wanna contribute :)
     
    hippocoder likes this.
  28. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    With Global Illumination a tiny change in the scene can cause different visuals in other parts of the level. It is hard to cache results but we have some ideas on how to cache/speed things up in the future.
     
  29. GenOli

    GenOli

    Joined:
    Apr 21, 2013
    Posts:
    139
    Tried a small scene and it works very well, with a larger more detailed scene it just stays "Baking..."

    I have a 1080Ti.
     
  30. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    You have to provide some more info if we are to fix this. Please file a bug report if baking is stuck.
     
  31. GenOli

    GenOli

    Joined:
    Apr 21, 2013
    Posts:
    139
    It's simple to reproduce, just open the RFP2_DemoScene in the Rome Fantasy Pack II asset and try to bake it with the GPU.

    (Presumably Unity devs have access to store assets for testing).
     
  32. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,861
    Try clearing the bake first from the dropdown on the bake button.
     
  33. GenOli

    GenOli

    Joined:
    Apr 21, 2013
    Posts:
    139
    Seems restarting Unity fixed it, if it comes back I'll try that.
     
  34. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    1,801
    It seems when u bake halfway and stop it then continue to bake again u will get that issue.
     
  35. GenOli

    GenOli

    Joined:
    Apr 21, 2013
    Posts:
    139
    I tried a much bigger scene than the Rome Fantasy Pack II demoscene and it doesn't work at all, gets few minutes into baking then these errors show up (below) and then it reverts to CPU and gets stuck "Baking..."

    Code (CSharp):
    1. [PathTracer] Loaded programs and built CL kernels in 0.092 secs -> Timestamps: [471.352 - 471.444].
    2.  
    3. OpenCL Error. Falling back to CPU lightmapper. Error callback from context: CL_OUT_OF_RESOURCES error executing CL_COMMAND_READ_BUFFER on GeForce GTX 1080 Ti (Device 0).
    4.  
    5. OpenCL Error. Falling back to CPU lightmapper. Error callback from context: CL_OUT_OF_RESOURCES
    6.  
    7. OpenCL Error. Falling back to CPU lightmapper. Error callback from context: CL_OUT_OF_RESOURCES error executing clFlush on GeForce GTX 1080 Ti (Device 0).
    8.  
    9. OpenCL Error. Falling back to CPU lightmapper. Error callback from context: CL_OUT_OF_RESOURCES error executing CL_COMMAND_NDRANGE_KERNEL on GeForce GTX 1080 Ti (Device 0).
    10.  
    11. OpenCL Error. Falling back to CPU lightmapper. Error callback from context: CL_OUT_OF_RESOURCES error executing CL_COMMAND_COPY_IMAGE on GeForce GTX 1080 Ti (Device 0).
    12.  
    13. OpenCL Error. Falling back to CPU lightmapper. Error callback from context: CL_OUT_OF_RESOURCES error executing CL_COMMAND_READ_IMAGE on GeForce GTX 1080 Ti (Device 0).
    14.  
    15. OpenCL Error. Falling back to CPU lightmapper. Error callback from context: CL_INVALID_EVENT
    Error # : Number of times

    1 : 4
    2 : 14202
    3 : 4
    4: 12806
    5: 1408
    6 : 6
    7 : 4
     
  36. shredingskin

    shredingskin

    Joined:
    Nov 7, 2012
    Posts:
    235
    I have a laptop with a gtx1080, but it says the rendering device is the intelHD card.

    Is there a way to select the graphic card ? Or why is it using the onboard card ?

    EDIT: did what was mentioned in the original post via command line, still falling back to CPU baking "CL_PROFILING_INFO_NOT_AVAILABLE"
     
    Last edited: Sep 30, 2018
  37. buFFalo94

    buFFalo94

    Joined:
    Sep 14, 2015
    Posts:
    264
    It's works well on my GTX 1060 but sometimes i do experience some issues when it's says "out memory" and after that it's falls back to CPU
     
  38. Thall33

    Thall33

    Joined:
    Sep 18, 2013
    Posts:
    134
    OpenCL Error. Falling back to CPU lightmapper. Error callback from context: CL_PROFILING_INFO_NOT_AVAILABLE

    I'm just getting this error.

    Also this one, not sure if its related:

    Assertion failed on expression: 'IsCLEventCompleted(events->m_StartMarker, isStartEventAnError)'

    My specs:

    CPU - i7 7700K Intel
    GPU - EVGA 1070 GTX FTW 8GB
    RAM - Corsair Vengence Pro RBG 3200Mhz 2 x 16GB
    MB - Z270 Mark 2
     
    Last edited: Oct 1, 2018
  39. GenOli

    GenOli

    Joined:
    Apr 21, 2013
    Posts:
    139
    Seems like some sort of queue/memory management is needed to prevent this from overloading.
     
  40. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Non uniform scale will be fixed in 2018.3b6
     
  41. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,334
    And please also release the Mac version, even if its unstable, I just want to start testing and saving time already :)
     
  42. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    But it would probably fallback to cpu ;)
     
  43. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    Will Unity 2018.3 come out of beta till Unite LA?
     
  44. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,361
    Unity 2017.3 was released December 19th.

    If they stick to this plan, I guess 2018.3 will not be out of beta till Unite LA, which starts at October 23rd, thus about two month earlier than 2017.3.

    They made quite a few major changes/improvements in 2018.3, they probably need these two months to further stabilize the software.
     
  45. GenOli

    GenOli

    Joined:
    Apr 21, 2013
    Posts:
    139
    Still getting memory issues in Beta4.
     
  46. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,334
    I know what you mean but ... I have a Nvidia card running on the Mac 1080 Ti
     
  47. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yep, but those cards currently fall back to CPU too!
     
  48. GenOli

    GenOli

    Joined:
    Apr 21, 2013
    Posts:
    139
    Tried Beta 5 and 6, still falling back.

    Having a fallback at all gives me the impresion Unity isn't very confident in this new feature and their ability to implement it, I hope I am proved wrong though by the time of final release or my project will suffer greatly.
     
  49. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    617
    I haven’t had any problems. Working great on my end.
     
  50. GenOli

    GenOli

    Joined:
    Apr 21, 2013
    Posts:
    139
    Try doing it on a huge scene.