Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Official Progressive GPU Lightmapper preview

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

  1. Harrier

    Harrier

    Joined:
    May 11, 2015
    Posts:
    8
    So after reboot CPU lightmapper works again, but when i try GPU others lightmapper stop working again.
     
  2. YuriyPopov

    YuriyPopov

    Joined:
    Sep 5, 2017
    Posts:
    237
    Hi there,
    I'm experiencing a instant crash to desktop with light probes present in the scene(if the light probe group is active) on a Radeon RX580. Any ideas for a workaround ?
     
  3. V_Kalinichenko

    V_Kalinichenko

    Unity Technologies

    Joined:
    Apr 15, 2015
    Posts:
    16
    Hello,

    For those of you, who experience the issue with no ability to bake lighting with GPU Lightmapper on NVIDIA GPUs using NVIDIA 416.81 driver ("OpenCL Error. Falling back to CPU lightmapper. Error callback from context: CL_INVALID_PROGRAM") - this is a known bug and is caused by the fact that the latest NVIDIA driver 416.81 doesn't have support for OpenCL.
    We are contacting NVIDIA at the moment to solve this issue as soon as possible.

    As a workaround, we suggest reverting your NVIDIA driver to the latest stably working one - which is 416.34.
    We will keep you informed about this problem.

    Sorry for the caused inconveniences.
     
    AlterMannn, buttmatrix, Nehrk and 2 others like this.
  4. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    I tried to implement RadeonRays and its methods could not detect my nVidia GPU as opencl device.

    upload_2018-11-13_13-49-20.png

    "OpenCL" methods however detects it with latest drivers

    upload_2018-11-13_13-43-48.png

    upload_2018-11-13_13-45-34.png
     
  5. fguinier

    fguinier

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    146
    Hi Vagabond_,

    Hum that is weird! can you run `clinfo` and see if the nvidia device is listed?

    Quite surprisingly latest NVidia driver does not seems to provide OpenCL like it should/used to be (the release note actually say it should, we have warned Nvidia). As explained by @V_Kalinichenko above downgrading to driver 416.34 should fix it.

    PS: the code you are running is actually very similar to the one we have, but from the test we have run both clinfo and the code below will fail to list the nvidia hardware on 416.81: openclenumeration.PNG
     
    Last edited: Nov 13, 2018
  6. fguinier

    fguinier

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    146
    Hi Harrier, driver 18.9.3 seems to be the current stable one, could you please try with it please?

    Also a usefull thing would be that you report a bug with the currently failing driver so we can see the exact hardware and editor.log
     
  7. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    upload_2018-11-13_15-59-38.png

    Seems to find it.

    I will try to run your code and see if it is finding the GPU !
     
  8. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    As far as I can see, the r9 270 has 2GB of GPU memory so it should work fine for smaller lightmaps.
     
  9. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    I am able to get platforms and GPU device with your code !

    upload_2018-11-13_17-38-2.png

    GPU light mapper switches to CPU in 2018.3b9 however !
     
    Last edited: Nov 13, 2018
    fguinier likes this.
  10. fguinier

    fguinier

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    146
    Hum ok, good and bad news :) Could you attach the editor.log or better open bug?
     
  11. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Ok @fguinier i found something.

    Just deleting the OpenCL.dll file from the editor folder seems to fix the issue.
    May be you need a newer OpenCL.dll version file (it actually runs without this file though ) !?
    I now can see the GPU and it is actually used for baking !

    upload_2018-11-15_10-23-5.png
     
  12. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Baked in 15 seconds and the GPU is utilized at around 80% !

    upload_2018-11-15_10-27-49.png
     
  13. fguinier

    fguinier

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    146
    Hey Vagabond_ you rock! Thanks a lot for the investigation will take a look at that dll version !
     
  14. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Cool :)

    and i am actually now able to bake sponza at 40 texels resolution ( it took like 1:30 minutes on this 750 Ti GPU )
    Last time i successfully baked sponza model was at around 4 texels resolution !

    Not getting any warnings other than memory allocation on a bigger scene !
     
    V_Kalinichenko and KEngelstoft like this.
  15. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    This worked for me as well lots of errors in an infinite loop (possibly didn't leave it running). Deleted OpenCL.dll and it works.
     
  16. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    Question could clustering be calculated on GPU as it's very slow on my CPU?
     
  17. Harrier

    Harrier

    Joined:
    May 11, 2015
    Posts:
    8
    Hi 18.9.3 is working fine, i just had to decrease lightmap res to 2K.
     
  18. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    No, clustering is for Enlighten precomputed realtime GI and will remain on CPU.
     
  19. Rastapastor

    Rastapastor

    Joined:
    Jan 12, 2013
    Posts:
    589
    Can anyone enlighten me, why the GPU lightmapper doesnt detect the Nvidia GPU ? Anyone knows if the model mentioned below even supports it ?

    Drivers: 416.94
    Device: gtx960m

    Code (CSharp):
    1. -- Listing OpenCL platforms(s) --
    2. * OpenCL platform 0
    3.     PROFILE = FULL_PROFILE
    4.     VERSION = OpenCL 2.1
    5.     NAME = Intel(R) OpenCL
    6.     VENDOR = Intel(R) Corporation
    7.     EXTENSIONS = cl_intel_dx9_media_sharing cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_d3d11_sharing cl_khr_depth_images cl_khr_dx9_media_sharing cl_khr_fp64 cl_khr_gl_sharing cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_icd cl_khr_image2d_from_buffer cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_spir
    8. -- Listing OpenCL device(s) --
    9. * OpenCL platform 0, device 0
    10.     DEVICE_TYPE = 4
    11.     DEVICE_NAME = Intel(R) HD Graphics 530
    12.     DEVICE_VENDOR = Intel(R) Corporation
    13.     DEVICE_VERSION = OpenCL 2.1 NEO
    14.     DRIVER_VERSION = 23.20.16.4973
    15.     DEVICE_MAX_COMPUTE_UNITS = 24
    16.     DEVICE_MAX_CLOCK_FREQUENCY = 1050
    17.     CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE = 3399876608
    18.     CL_DEVICE_HOST_UNIFIED_MEMORY = true
    19.     CL_DEVICE_MAX_MEM_ALLOC_SIZE = 3399876608
    20.     DEVICE_GLOBAL_MEM_SIZE = 6799753216
    21.     DEVICE_EXTENSIONS = cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_fp16 cl_khr_depth_images cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_icd cl_khr_image2d_from_buffer cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_intel_subgroups cl_intel_required_subgroup_size cl_intel_subgroups_short cl_khr_spir cl_intel_accelerator cl_intel_media_block_io cl_intel_driver_diagnostics cl_intel_device_side_avc_motion_estimation cl_khr_priority_hints cl_khr_subgroups cl_khr_il_program cl_khr_fp64 cl_intel_planar_yuv cl_intel_packed_yuv cl_intel_motion_estimation cl_intel_advanced_motion_estimation cl_khr_gl_sharing cl_khr_gl_depth_images cl_khr_gl_event cl_khr_gl_msaa_sharing cl_intel_dx9_media_sharing cl_khr_dx9_media_sharing cl_khr_d3d10_sharing cl_khr_d3d11_sharing cl_intel_d3d11_nv12_media_sharing cl_intel_simultaneous_sharing
    22. * OpenCL platform 0, device 1
    23.     DEVICE_TYPE = 2
    24.     DEVICE_NAME = Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
    25.     DEVICE_VENDOR = Intel(R) Corporation
    26.     DEVICE_VERSION = OpenCL 2.1 (Build 611)
    27.     DRIVER_VERSION = 7.6.0.611
    28.     DEVICE_MAX_COMPUTE_UNITS = 8
    29.     DEVICE_MAX_CLOCK_FREQUENCY = 2600
    30.     CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE = 131072
    31.     CL_DEVICE_HOST_UNIFIED_MEMORY = true
    32.     CL_DEVICE_MAX_MEM_ALLOC_SIZE = 4249845760
    33.     DEVICE_GLOBAL_MEM_SIZE = 16999383040
    34.     DEVICE_EXTENSIONS = cl_khr_icd cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_depth_images cl_khr_3d_image_writes cl_intel_exec_by_local_thread cl_khr_spir cl_khr_dx9_media_sharing cl_intel_dx9_media_sharing cl_khr_d3d11_sharing cl_khr_gl_sharing cl_khr_fp64 cl_khr_image2d_from_buffer cl_intel_vec_len_hint
    35. -- GPU Progressive lightmapper will use OpenCL device 'Intel(R) HD Graphics 530' from 'Intel(R) Corporation'--
    36.    use -OpenCL-PlatformAndDeviceIndices <platformIdx> <deviceIdx> or -OpenCL-ForceCPU as command line arguments if you want to select a specific adapter for OpenCL.
    37. [PathTracer] Loaded programs and built CL kernels in 7.822 secs -> Timestamps: [20.653 - 28.475].
     
  20. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    Try removing (delete it then recycle it if needed) the OpenCL.dll in your Editor folder it fixes things for my AMD gpu.
     
    Rastapastor likes this.
  21. Rastapastor

    Rastapastor

    Joined:
    Jan 12, 2013
    Posts:
    589
    Helped, thank You!! :)
     
  22. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
    benchmarks
    GTX780 3G vs i7 3770
    CPU: 3 min and 22 seconds
    GPU : 27 seconds
     
  23. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    103
    on 2018.3.11 it doesn't recognize my gtx 1080, instead says baking on intel... (I guess the one it comes with the i7)
    Any ideas how to select the Nividia gtx 1080? Thanks
     
  24. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    Ditto as above try deleting the OpenCL.dll in the Editor folder.
     
  25. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    103
    Thanks but I haven't that file on the editor folder :(
     
  26. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    You should be looking in the folder where the editor exe file is located, for example inside:
    (Windows) C:\Program Files\Unity\Hub\Editor\2018.3.0b11\Editor
     
  27. GorkaChampion

    GorkaChampion

    Joined:
    Feb 6, 2018
    Posts:
    103
    Thna
    Thanks, I didn't know the file was on that root folder. Restarting Unity to test if it works....

    EDIT: Nothing.... Do I need to do any extra step? It's my first time testing it
     
    Last edited: Nov 25, 2018
  28. Gametyme

    Gametyme

    Joined:
    May 7, 2014
    Posts:
    618

    Worked for me too.
     
    Vagabond_ likes this.
  29. IainSwales

    IainSwales

    Joined:
    Jul 5, 2013
    Posts:
    2
    first test I got 24x speed increase from cpu to gpu. amazing. spent more time looking for info on creating cleaner lightmaps than actually rendering. this plus multi gpu will change things a lot for me. mainly doing interior viz. meanwhile i'm just upping the values on the settings til it breaks! main bug i found, is that between bakes i have to delete all the old lightmaps etc, or i just get black. using the alpha 2019 for these tests. hope thats ok in this forum. i saw a little while ago the unity guys doing a network render at some hacking session. this plus network plus multi GPU. YES
     
  30. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Using 2019.x versions and alphas is more than fine, we are not backporting features to 2018.3 - the 2019.x versions will get all the features and improvements. This is the version we would like you to test out :)
    The sampling algorithm will be changed to match the CPU lightmapper more before going out of preview. Also, we are looking into multiple importance sampling and denoising which should make it easier to get clean output.
    Multi GPU will arrive before network render, but no ETA for that yet.

    Could you please file a bug report on the black lightmaps issue?
     
  31. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    Now that the GPU progressive lightmapper will speed things up remarkably, can I request the 100k indirect rays limit to be bumped up?

    There are cases where 100k indirect rays are not enough (at least, if I don't plan to use any filtering) and if I'm willing to leave the baking go on overnight, I don't see why I should resort to using filtering when in that amount of time I could easily get to much higher than 100k rays.
     
  32. koolhausbuilder

    koolhausbuilder

    Joined:
    Jun 4, 2013
    Posts:
    3
    I am experiencing the same exact issue on the RX580, with the OP's recommended drivers (18.9.3). Funny how Unity advertises this feature with Radeon but it is a complete non-starter on a pretty popular Radeon GPU. There is also no solution in this or any other thread. The lightmapper is definitely trying to use the 580, the log says so, and the 580 starts filling up its VRAM before crashing.

    Disabling the light probe group makes it work, but only with smaller texel resolutions. In comparison, a GTX1070 has the same amount of VRAM, and runs circles around the RX580 for me. I can crank up texel resolution higher and enable heavy light probe groups with no crash or fallback to CPU.
     
  33. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    We have several RX580 cards in the dev team and they work great. It sounds like you are hitting a very rare bug with light probes that we are having trouble reproducing. Please file a bug report using the built in bug reporter and attach your scene. Thanks!
     
  34. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    It would also be interesting to know which Unity version you are using. Could you please provide that info as well? Thanks!
     
  35. YuriyPopov

    YuriyPopov

    Joined:
    Sep 5, 2017
    Posts:
    237
    I was able to reproduce the bug on 2018.3.b7 to b12. The size or complexity of the scene does not matter as long as there is one default light probe group when uaing the gpu lightmapper the entire edito ctd's without even an error
     
  36. koolhausbuilder

    koolhausbuilder

    Joined:
    Jun 4, 2013
    Posts:
    3
    Thank you for the responses. It has been difficult to get an actual crash report with this. As pointed out by YuriyPopov, the editor just exits without a crash prompt. Even the log most of the time doesn't show anything. One time with a certain driver version I was trying out, I did get a note regarding AMD OpenCL access violation, but I don't remember which driver it was unfortunately.

    I can't really attach my scene but I will try to get the log error about opencl again and send it to you.

    I have tested 2018.3 b09, 2018.3 b12 and 2019.1 a10 and it happens in all of them. The card is an XFX RX-580P8DFD6.
     
  37. dadude123

    dadude123

    Joined:
    Feb 26, 2014
    Posts:
    789
    Hi Unity Team!

    The new "optix" denoise option in 2019 a11 is pretty good. Unbelievably good actually, it's still giving acceptable results even with very low sampling counts!
    Is there anything planned to make it available in the Progressive GPU mode as well?
     
    Lars-Steenhoff likes this.
  38. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,521
    Is Optix denoiser planned for the Mac version too?

    I really hope it will be, I see on the nvida website that mac is a supported platform.
    So I hope the windows only requirement is a temporary thing.

    Mac has support for mordern nvida cards via external gpu, with the help nvida webdrivers. I know apple is not doing a single thing now to support nvida cards, but they work.
     
  39. houghtob123

    houghtob123

    Joined:
    Aug 25, 2017
    Posts:
    5
    Hello,

    I have no idea if this is a bug or if this is just me doing something wrong. I haven't seen this crop up before in other scenes but the GPU light mapper is giving some really odd results. This has been happening in the scene in betas 2018.3b9-12. Bug or do I just suck this bad?

    CPU Light mapper:

    GPU Light mapper:

     
  40. sabotage3d

    sabotage3d

    Joined:
    Nov 10, 2014
    Posts:
    5
    Hi,
    I tried the light-mapper with RTX 2070 but I am getting instant crash without any log or debug information. I have the latest drivers. Do I need anything else in order to get it working?
     
  41. houghtob123

    houghtob123

    Joined:
    Aug 25, 2017
    Posts:
    5
    Other replies here say that the last working drivers were 416.34. I don't know if the RTX series even support that early, but try rolling back if you can.
     
  42. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    2019.1 adds a lot of improvements to the CPU lightmapper, some of them are relevant for your use case:
    2019.1a9 improved the sampling algorithm for the CPU lightmapper, by introducing proper round robin sampling between supersamples.
    2019.1.0a11 added optix AI denoising.
    2019.1.0a12 added multiple importance sampling for environment lighting.
    Do you still need more than 100k indirect samples when using version 2019.1.0a12 and enabling the new features?

    Keep in mind the GPU lightmapper is using a different sampling algorithm, but we are planning on unifying the two so they will have feature parity (e.g. environment MIS and denoising coming in 2019.x for GPU lightmapper @dadude123 @Lars-Steenhoff).
    At some point we will introduce adaptive sampling to make smooth output possible without crazy high ray counts.
     
    Lars-Steenhoff likes this.
  43. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Looks like lots of invalid texels because the rays are only hitting backfaces. Have a look at the texel validity view to confirm this. Try 2019.1 where double sided GI and cast/receive shadows support got added.
     
  44. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    I haven't extensibly played with the new features yet, so proper reply pending. But.

    I have some scenes where I stubbornly still have small meshes lighting the scene (and those are the ones where 100k is not enough), which I think will only get solved when this happens:
    Which is fine. I'm hoping that in the mean time the new denoise might be good enough.
     
  45. sabotage3d

    sabotage3d

    Joined:
    Nov 10, 2014
    Posts:
    5
    Thanks! I can confirm it works with 416.34 on RTX 2070. Is it worth using it production or to stick to something like Bakery?
     
    Lars-Steenhoff likes this.
  46. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,521
    Maybe you can do a quick comparison? I would be very interested in gpu lightmapper vs bakery
     
    Gametyme likes this.
  47. KEngelstoft

    KEngelstoft

    Unity Technologies

    Joined:
    Aug 13, 2013
    Posts:
    1,366
    Yes, to address that we need multiple importance sampling for emissive materials. It is on the roadmap but no eta for that yet. I hope the denoiser can help you get a clean output in the meantime.
     
    Lars-Steenhoff and AcidArrow like this.
  48. houghtob123

    houghtob123

    Joined:
    Aug 25, 2017
    Posts:
    5
    I have just tried the gpu lightmapper in 2019.1a11 and the result seems to be the same.

    This is what the texel validity looks like:

     
  49. mohsen_7x8

    mohsen_7x8

    Joined:
    Dec 8, 2018
    Posts:
    1
    Same exact crash happens on my MSI Armor RX 570 8GB card, with Unity's SampleScene in the High Definition Render Pipeline. It works with light probes off, but crashes immediately with light probes on. There is no crash report and the log contains nothing about the fact that there was a crash. Tested with Unity 2018.3b12.
     
  50. fguinier

    fguinier

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    146
    The best thing would actually be a repro: If you could open a bug with the driver / gfx card + scene that make it crash that would be awesome!