Page 1 of 1

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

Posted: Thu Jan 02, 2020 9:37 pm
by juangea
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!

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

Posted: Thu Jan 02, 2020 11:27 pm
by Dade
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.

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

Posted: Fri Jan 03, 2020 10:10 am
by juangea
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!

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

Posted: Fri Jan 03, 2020 10:55 am
by Dade
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

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

Posted: Fri Jan 03, 2020 12:37 pm
by juangea
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!