Search Unity

Unity GPU lightmapper preview

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

  1. YuriyPopov

    YuriyPopov

    Joined:
    Sep 5, 2017
    Posts:
    99
  2. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,080
    Red means invalid texels. Please check that your UVs are correct. Does it look okay with the CPU progressive lightmapper? You have lots of warnings about overlapping UVs.
     
  3. screenname_taken

    screenname_taken

    Joined:
    Apr 8, 2013
    Posts:
    635
    EDIT: scratch that, i deleted the OpenCL dll in the Unity folder and it bakes like a charm on my 1070.
    112.87mil rays vs 8.9~10 (nVIDIA 1070 vs i7 6700)

    BUT i noticed a second thing. @KEngelstoft If i delete the OpenCL file, and try the CPU lightmapper, the light it produces is an empty (black) DTX5 file.
     
    Last edited: Dec 13, 2018
    fguinier likes this.
  4. malte_dreschert

    malte_dreschert

    Joined:
    Jun 5, 2018
    Posts:
    1
    I took the GPU lightmapper for a spin today and the performance was very good but in the end it failed to finalize everything:
    Failed to copy lightmap snapshot assets to directory: Temp/GI/9ebfcb816468e9ac45ba36c8da93c592

    Failed copying the texture from 'C:/Users/ng763d3/AppData/LocalLow/Unity/Caches/GiCache/ee/eeec558189ae049acc6957476bb58e63._comp_light.exr' to 'Temp/GI/9ebfcb816468e9ac45ba36c8da93c592/Lightmap-43_comp_light.exr'.

    These are the two messages that get spammed into the console.
     
  5. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,080
    This is not a GPU lightmapper specific issue and a known bug (case 1047087) that can happen when you exceed the GI Cache size https://docs.unity3d.com/Manual/GICache.html try increasing GI cache size and let me know if it fixes the problem. I have a fix in flight I think will address this.
     
  6. cmorait

    cmorait

    Joined:
    Nov 22, 2017
    Posts:
    58

    I hope that the final GPU light mapper will be ready soon. That will change our workflow and especially for us that we depend on mobile workstations. It will help us to scale down to a smaller form factor with more portable laptops as all the Clevo barebone based laptops i7/i9 (with desktop CPUs) and those with Ryzen 1700/2700 are heavy and not so portable.

    The crazy part is that it does not scale the GPU speed more than 600Mhz. That seems that is not taking the full advantage of the speed that the current GPU is capable. Do anyone knows why that happens?

    I would like to ask if someone has tested the GPU light mapper on a desktop with a dual GPU setup to have an opinion on how it scales in terms of performance.
     
    Last edited: Dec 14, 2018
  7. deltamish

    deltamish

    Joined:
    Nov 1, 2012
    Posts:
    53
    Hey,

    I seem to be facing an issue with the new GPU Lightmapper and CPU lightmapper to some extent.
    I know (noise)blob shape & light leaks are a common problem but I think its way too evident here.
    And if you are wondering if its the algorithm in GPU , CPU Progressive lightmapper is generating very similar result.

    2018-12-14 03_11_49-Window.png 2018-12-14 03_12_31-.png 2018-12-14 03_13_03-Window.png


    I'm running on AMD R7 265 GPU 2 Gigs VRAM and 18.9.3 driver.

    Please do let me know how i can fix it XD

    Cheers
     
  8. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,080
    Try disabling realtime GI to narrow the problem a bit. Also try increasing the indirect sample count or try the denoiser in 2019.1.
     
  9. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    102
    I've got a GTX 1080 but when I try the progressive GPU it renders on the Intel card (Intel UHD graphics 630) instead of GTX 1080. How can I select the graphics card? Thanks.

    PS: I've tried deleting the file Open CL and doesn't work.
     
    Last edited: Dec 15, 2018
  10. screenname_taken

    screenname_taken

    Joined:
    Apr 8, 2013
    Posts:
    635
    For that look at the very first post in the thread. You need to have a look around in the editor's log to tell you which device your card is on the list, and then tell unity via a command line which card to use. I'd really prefer it if there was just a tick box or a dropdown menu in the preferences.
     
  11. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    102
    thanks, I tried yesterday but I'm not sure if I'm writing ok the command line as the Hub pops up when I enter Enter up but nothing happens. On may case is 0 0
    For instance, I think there is a mistake here and its \ after Editor, instead of >
    C:\Program Files\Unity 2019.1.0a3\Editor>Unity.exe -OpenCL-PlatformAndDeviceIndices 1 0

    Does anybody enter the right one?
     
  12. screenname_taken

    screenname_taken

    Joined:
    Apr 8, 2013
    Posts:
    635
    Should be \ yes.
     
  13. deltamish

    deltamish

    Joined:
    Nov 1, 2012
    Posts:
    53
    Hey,Tried that didn't work. Had to completely remove the point light. BTW the denoise is only supported on Nvidia cards as per the docs and I have an AMD card. So I didn't install 2019.x

    Anyway I ran into a more serious issue. When I start baking my Entire PC froze up and after 15mins I had to Turn it off the entire system via power switch. This happened twice. The complexity of the scene is almost the same except there are 3 more models added which shouldn't be of an issue as they are not more than 20K tris.

    Thanks.

    Contents of the scene were the Meshes. 3 reflection Probes and a directional light.
     
  14. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    502
    Not sure if this qualifies as a bug or how I can reproduce it in a new scene, but I'm seeing drastic differences in the way the CPU vs GPU lightmapping looks:

    I've started with the GPU lightmapper and tweaked it roughly to how I want it to look:

    GPU.PNG

    Then I noticed, that when increasing the resolution too high I sometimes get an error callback saying that memory allocation failed. So, sometimes I switched back to using CPU, but soon I noticed that even on the same settings, the CPU lightmapper looks very different:

    CPU.PNG

    These are my settings:

    Settings.PNG

    I couldn't reproduce the issue in a new project, so I'm wondering what might be causing this. Any ideas? Maybe with some pointers, I can get this to reproduce. Thank you!
     
  15. Egyptman09

    Egyptman09

    Joined:
    Nov 16, 2016
    Posts:
    7
    month later and this still works but why is it not fixed yet from unity's end???
    I hope it does soon.
     
  16. fguinier

    fguinier

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    114
    The fix is in landing pattern.
     
  17. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,080
    I am sorry it isn't working for you. Please use the bug reporter to create a bug report after experiencing the freeze, that will make sure we get the project causing this, the editor log from the previous run (where the freeze happened) and the specs of your machine. Thanks!
     
  18. OP3NGL

    OP3NGL

    Joined:
    Dec 10, 2013
    Posts:
    246
    i was hoping that the gpu lightmapper would work on my end..
    pros:
    baked done in 12 secs in a complex scene which took about 4 hours on progressive.
    cons:
    when baked in progressive, my total lightmaps are below 800mb but when baked with gpu it increases to 2.1gb. why is that so?

    Sometimes when baking other scenes, gpu will fallback to cpu...

    specs:
    i7-7700k
    ram at 32gb
    GTX-1080TI
     
  19. Fallc

    Fallc

    Joined:
    Mar 13, 2015
    Posts:
    48
    Not sure if this belongs here but I recently saw this denoiser methode and it looks pretty promissing: https://github.com/superboubek/bcd


    Would be greate to have something like this, expecially since not every one has Nvidia hardware and the other denoiser options are not very strong.
     
    Shizola, fguinier and buttmatrix like this.
  20. Geez_Jesus

    Geez_Jesus

    Joined:
    Nov 17, 2016
    Posts:
    17
    I can't get my GTX1060 to work not matter what I've tried. It uses Intel HD graphics instead. I saw some command at the first page but that didn't help at all. Can you guys help me?

    Edit: OK, finally got it working. But it's kinda annoying, could you guys just put a dropdown there? I think that'd be sooo much easier
     
    Last edited: Dec 18, 2018
    screenname_taken likes this.
  21. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    196
    We are currently working on cross platform denoising that will work across the board regardless of the installed GPU.
     
    Lars-Steenhoff and Fallc like this.
  22. fguinier

    fguinier

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    114
    Starting from 19.1 the baking device will be automatically the device used by the editor for rendering.
     
  23. horeaper

    horeaper

    Joined:
    Oct 30, 2013
    Posts:
    23
    Unable to swtich to GPU Progressive Lightmapper.
    Gives 2 errors after switching:
    OpenCL Error. Falling back to CPU lightmapper. Error callback from context: CL_PLATFORM_NOT_FOUND_KHR
    OpenCL Error. Falling back to CPU lightmapper. Error callback from context: CL_INVALID_PROGRAM

    The second one just keep popping up endlessly.
    And it's a brand new empty 3D project.

    Reported here: https://fogbugz.unity3d.com/default.asp?1111015_jcql2f2d4fcohpfv
     
    M_R_M and Nobrega_ like this.
  24. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    102
    Looking forwards, so I can use it finally. How do we update to 19.1? It's not on the package manager (as far as I know)
     
  25. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    196
    https://unity3d.com/unity/alpha/2019.1
     
  26. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    102
  27. Jesper-Mortensen

    Jesper-Mortensen

    Unity Technologies

    Joined:
    Mar 15, 2013
    Posts:
    196
    It will go into beta any day now. So that's one step closer ;-)
     
  28. Ell223

    Ell223

    Joined:
    Jan 27, 2014
    Posts:
    1
    https://forum.unity.com/threads/gpu-lightmapper-preview.561103/page-3#post-3885661

    It's a Nvidia driver bug. Not sure if it's fixed in a newer driver yet.
     
  29. screenname_taken

    screenname_taken

    Joined:
    Apr 8, 2013
    Posts:
    635
    Nobrega_ likes this.
  30. horeaper

    horeaper

    Joined:
    Oct 30, 2013
    Posts:
    23
  31. horeaper

    horeaper

    Joined:
    Oct 30, 2013
    Posts:
    23
    OMG!! You FIXED IT!!!
    So I guess the OpenCL.dll shipped with Unity is not compatible with my graphics driver?
    Seriously, why Unity does such thing? This DLL already shipped with all mordern drivers, this is completely redundant, not to mention error prone, as in my case.
    From what I know, AMD made some change in 18.7 or 18.8 driver, removed OpenCL support on CPU, resulting a slightly different OpenCL driver.

    *UPDATE*
    Now there is a new problem. When I try to bake with GPU, Unity just closes (crashes), no bug report window.
    Additional info mailed to bugs@unity3d.com.
     
    Last edited: Dec 20, 2018
  32. screenname_taken

    screenname_taken

    Joined:
    Apr 8, 2013
    Posts:
    635
    Don't really know what goes on to be honest. First time i removed the file (which was suggested by someone else even) the GPU would bake but the CPU wouldn't. Then after i again closed and opened Unity, both do. Mind you, i did have Unity closed when i renamed the file's extension.
     
  33. YuriyPopov

    YuriyPopov

    Joined:
    Sep 5, 2017
    Posts:
    99
    Perhaps you have lightprobes in your scene. I'm having the same issue that I reported here
     
  34. Eiseno

    Eiseno

    Joined:
    Nov 1, 2015
    Posts:
    79
    using 2080. delete opencl.dll from editor folder from 2018.3.0f2 and gput baking started working.
     
  35. horeaper

    horeaper

    Joined:
    Oct 30, 2013
    Posts:
    23
    I use the "3D with Extras" template, it does have some lightprobes :oops:
     
  36. deltamish

    deltamish

    Joined:
    Nov 1, 2012
    Posts:
    53
    Weird darkened out effect on meshes after baking lightmaps

    Here the all the three drawer meshes are using same model and material.
    2018-12-23 19_14_27-Window.png

    the second issue is the dark shadow effect
    drawer.gif

    Any idea why this might be happening

    Cheers ;)
     
  37. homerender

    homerender

    Joined:
    Sep 14, 2012
    Posts:
    181
    >> Failed to find a suitable OpenCL device, falling back to CPU lightmapper.

    GTX 1070Ti

    Any ideas what I can do? Unity 2018.3.0f1
     
  38. homerender

    homerender

    Joined:
    Sep 14, 2012
    Posts:
    181
    OMG it's working :D
     
  39. cmorait

    cmorait

    Joined:
    Nov 22, 2017
    Posts:
    58
    In my last tests the rx580 is 10.33 times faster than an 8core Ryzen 1700 (Asus ROG 702 ZC Laptop).

    I hope unity to share a project for benchmarking as it will help to have an esrimated when we need to upgrade our laptop workstations or upgrade our desktop GPU.

    I am wondering how faster is an 2000 series Nvidia GPU from a 1000 series and if SLI will boost the performance and what will be the performance scaling with 2 GPUs. Also the max q GPUs would be nice to be tested and of course AMD GPUs.
     
  40. kev42100

    kev42100

    Joined:
    Apr 17, 2010
    Posts:
    56
    1) I removed the opencl.dll, same errors...
    2) I updated my geforce driver to the 417.35 (I have a gtx 960)
    => It works perfectly, both CPU & GPU.
     
  41. rizu

    rizu

    Joined:
    Oct 8, 2013
    Posts:
    1,158
    I still get this issue on latest 2019.1.0a13 (need to remove OpenCl.DLL to be able to use GPU lightmapper).

    Additionally, I've never had Optix denoiser enabled for me, it tells I don't have compatible hardware (I have GTX970).
     
    Lars-Steenhoff likes this.
  42. Shinobi1507

    Shinobi1507

    Joined:
    Sep 8, 2010
    Posts:
    209
    Deleting the opencl.dll from the Unity directory got it going for me too.

    Ryzen 2700x
    RTX 2080
     
    Last edited: Jan 5, 2019
    Nobrega_ likes this.
  43. cmorait

    cmorait

    Joined:
    Nov 22, 2017
    Posts:
    58
    I would like to ask is there a way to see the % of the initialization of the GPU when baking?

    I am asking because in windows monitor the GPU seems not to be initialized when it is actually baking.

    Thanks
     
  44. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    903
    I am using GPU-Z !
     
  45. YuriyPopov

    YuriyPopov

    Joined:
    Sep 5, 2017
    Posts:
    99
  46. Kichang-Kim

    Kichang-Kim

    Joined:
    Oct 19, 2010
    Posts:
    311
    Hi, I found that the GPU lightmapper consumes more memory than CPU lightmapper when baking with multi-scene setup. So baking multi-scene lightmap is failed with "CL_OUT_OF_RESOURCES" error, but when I merge multi scenes into single scene baking is succeed.
     
  47. fguinier

    fguinier

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    114
    Hey guys, just to say that 2019.1a14 will contains the fixes for :
    - random crash when probes are in the scene with GPU PLM.
    - device not found followed by a crash with recent drivers (AMD and Nvidia) ie no need to delete opencl.dll anymore :)

    Thanks for all the feedback!
     
    horeaper and Vagabond_ like this.
  48. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    903
    Great ! As these are fixes and not new features are we going to have them in 18.3 ?
     
  49. fguinier

    fguinier

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    114
    Random crash when probes are in the scene with GPU PLM
    - Will be backported/fixed in 2018.3.2f1 (soon to be released).

    Device not found followed by a crash with recent drivers (AMD and Nvidia) ie no need to delete opencl.dll anymore.
    - A partial fix improving the situation will be present in 2018.3.3f1 (soon to be released). The full fix was quite involved and is too risky to backport unfortunatly. I would advice to move to 19.1 when using the GPU lightmapper (witch get double sided gi, no shadow casting light and more actually).
     
    Last edited: Jan 11, 2019
    yian-dev, horeaper and Vagabond_ like this.
  50. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,080
    SLI will not give you any benefit for now, as only one GPU is used for baking. Multi GPU support is on the roadmap but I can't predict when it will arrive.