It's normal that the openCL Kernel has to be rebuilt every time I press F12 without modifying the scene at all?

Use this forum for general user support and related questions.
Post Reply
juangea
Donor
Posts: 83
Joined: Thu Jan 02, 2020 6:23 pm

It's normal that the openCL Kernel has to be rebuilt every time I press F12 without modifying the scene at all?

Post by juangea » Thu Jan 02, 2020 9:37 pm

Hi there.

kind of new to Lux, but loving it a lot so far, specially the feeling the renders have.

but I hve a question, the OpenCL kernel compilation seems to take 11 minutes, if it happens once in a while it's not a big problem, but I'm trying with a production scene and when I press F12 the kernel builds, I leave to to fenish, and then it renders near to nothing because my render time limit was 8 minutes, then I press F12 again, and it starts to build the kernel again, is this normal? Is there a way to avoid it?

Thanks!

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

Re: It's normal that the openCL Kernel has to be rebuilt every time I press F12 without modifying the scene at all?

Post by Dade » Thu Jan 02, 2020 11:27 pm

juangea wrote:
Thu Jan 02, 2020 9:37 pm
but I hve a question, the OpenCL kernel compilation seems to take 11 minutes, if it happens once in a while it's not a big problem, but I'm trying with a production scene and when I press F12 the kernel builds, I leave to to fenish, and then it renders near to nothing because my render time limit was 8 minutes, then I press F12 again, and it starts to build the kernel again, is this normal? Is there a way to avoid it?
No, it is not normal, it may happen because the halt time interrupt the compilation. Try to do a render without an halt time, than the kernel cache should kick in the second time you do another render of the same scene.

Also 11 mins is a very long time, even for NVIDIA (slow) OpenCL compiler, if you can post a test scene, I can check if there is something wrong.
Support LuxCoreRender project with salts and bounties

juangea
Donor
Posts: 83
Joined: Thu Jan 02, 2020 6:23 pm

Re: It's normal that the openCL Kernel has to be rebuilt every time I press F12 without modifying the scene at all?

Post by juangea » Fri Jan 03, 2020 10:10 am

Ok, awesome to know it’s not normal, I’ll try to reproduce and see the problem :)

Once the kernel is built, is it used forever until a different requirements are met? I mean, as long as I render the same scene, even if I close and open it again, will it use that compiled kernel?
Or is it something that needs to be compiled each time we open Blender?
(I’m thinking in animation render times in the renderfarm) :)

Thanks!

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

Re: It's normal that the openCL Kernel has to be rebuilt every time I press F12 without modifying the scene at all?

Post by Dade » Fri Jan 03, 2020 10:55 am

juangea wrote:
Fri Jan 03, 2020 10:10 am
Once the kernel is built, is it used forever until a different requirements are met? I mean, as long as I render the same scene, even if I close and open it again, will it use that compiled kernel?
Yes, there is a persistent kernel cache on file system so the compilation is done only the first time. However there are currently many scene edit operations that can trigger the need of a new kernel: for instance, every time you use a new recursive material/texture (i.e. a material/texture referencing other materials/textures). This is required because GPUs don't support recursion and the kernel code is dynamically generated.

There is currently an on going effort to reduce/remove the need to re-compile kernels: viewtopic.php?f=5&t=1487
Support LuxCoreRender project with salts and bounties

juangea
Donor
Posts: 83
Joined: Thu Jan 02, 2020 6:23 pm

Re: It's normal that the openCL Kernel has to be rebuilt every time I press F12 without modifying the scene at all?

Post by juangea » Fri Jan 03, 2020 12:37 pm

Yes, I understand that, and that does not worries me, :)

It's more the animation rendering thing what worries me, because compiling the kernel once ever shot, for example, each computer would have to compile the kernel for a 200 frames shot, but just the first time they load the scene, and if the following shot of 150 frames is the sme scene but with a different camera I imagine that they could be able to use the same kernel, or at least recompile it once in all the 150 frames.

Thats something acceptable, not a big deal :)

Thanks!

Post Reply