OpenCL Kernel Compilation

Discussion related to the LuxCore functionality, implementations and API.
Post Reply
User avatar
Continuum
Posts: 17
Joined: Mon Dec 02, 2019 11:16 pm
Location: Zambia
Contact:

OpenCL Kernel Compilation

Post by Continuum » Tue Aug 18, 2020 9:43 am

I was curious if it was possible to compile the kernels before rendering in the API (v2.4), or is a there a way to know when the kernels are compiling so I can display the appropriate message? I noticed the blender addon is able to do something like this.

User avatar
Dade
Developer
Posts: 4697
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: OpenCL Kernel Compilation

Post by Dade » Tue Aug 18, 2020 10:58 am

Continuum wrote:
Tue Aug 18, 2020 9:43 am
I was curious if it was possible to compile the kernels before rendering in the API (v2.4)
Not really with OpenCL. It would be using SPIR-V but, as far as I know, it is not supported by NVIDIA (70%+ of GPUs sold).

It is possible with CUDA but requires some work.
Continuum wrote:
Tue Aug 18, 2020 9:43 am
or is a there a way to know when the kernels are compiling so I can display the appropriate message? I noticed the blender addon is able to do something like this.
You can use this LuxCore API method to know if a (long) kernel compilation time is going to be required for the rendering: https://github.com/LuxCoreRender/LuxCor ... re.h#L1233
Support LuxCoreRender project with salts and bounties

User avatar
B.Y.O.B.
Developer
Posts: 3771
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: OpenCL Kernel Compilation

Post by B.Y.O.B. » Tue Aug 18, 2020 11:08 am

In the BlendLuxCore addon I do it here for the viewport: https://github.com/LuxCoreRender/BlendL ... rt.py#L109

User avatar
Continuum
Posts: 17
Joined: Mon Dec 02, 2019 11:16 pm
Location: Zambia
Contact:

Re: OpenCL Kernel Compilation

Post by Continuum » Tue Aug 18, 2020 5:25 pm

Okay thank you very much for the quick response, this should do the trick, will play around with this. For now just focusing on OpenCL, will focus on CUDA later.

Post Reply