Reduce the number of OpenCL kernel compilations

Discussion related to the Engine functionality, implementations and API.
acasta69
Developer
Posts: 257
Joined: Tue Jan 09, 2018 3:45 pm

Re: Reduce the number of OpenCL kernel compilations

Post by acasta69 » Sun Dec 29, 2019 2:35 pm

Just for my understanding, does this have any downside?
I mean, in the specified cases a kernel recompilation is not triggered any more, but does the initial compile time increase (say because a feature is now always included) or not?
Support LuxCoreRender project with salts and bounties

Windows 10 64 bits, i7-4770 3.4 GHz, RAM 16 GB, GTX 970 4GB v382.05

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

Re: Reduce the number of OpenCL kernel compilations

Post by Dade » Mon Dec 30, 2019 9:46 am

acasta69 wrote:
Sun Dec 29, 2019 2:35 pm
Just for my understanding, does this have any downside?
I mean, in the specified cases a kernel recompilation is not triggered any more, but does the initial compile time increase (say because a feature is now always included) or not?
Yes, removing conditional compilation leads to have to compile more code and to execute conditional evaluation at run-time instead of at compile time. It also leads to use more ram as conditional structure size is removed too (i.e. the space to store volume information is allocated even if the scene doesn't include volumes).

However it is a downside of a couple of % points because most of the stuff has not a linear cost: compile 11 lines of code instead of 10 doesn't cost a 10% more and GPUs are fast to evaluate constant conditions (there is no divergence).
Support LuxCoreRender project with salts and bounties

User avatar
FarbigeWelt
Donor
Posts: 920
Joined: Sun Jul 01, 2018 12:07 pm
Location: Switzerland
Contact:

What about (pre-)compiling in background when using BlendLuxCore?

Post by FarbigeWelt » Wed Jan 01, 2020 5:19 pm

@Dade, what do you think about (pre-)compiling in background when using BlendLuxCore :?:

Background:
Because most of the time when I am modeling objects or setting up the scene most CPU's cores are idle. (Pre-)Compiling of scene, objects and openCL kernel could principally be done on 25% of CPU's core. Time could be reduced this way attractively for rendering when switching view port render from CPU to GPU or starting final render on GPU.
Light and Word designing Creator - www.farbigewelt.ch - aka quantenkristall || #luxcorerender
160.8 | 42.8 (10.7) Gfp | Windows 10 Pro, intel i7 4770K@3.5, 32 GB
2 AMD Radeon RX 5700 XT, 8 GB || Gfp = SFFT Gflops

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

Re: What about (pre-)compiling in background when using BlendLuxCore?

Post by Dade » Wed Jan 01, 2020 7:04 pm

FarbigeWelt wrote:
Wed Jan 01, 2020 5:19 pm
@Dade, what do you think about (pre-)compiling in background when using BlendLuxCore :?:

Background:
Because most of the time when I am modeling objects or setting up the scene most CPU's cores are idle. (Pre-)Compiling of scene, objects and openCL kernel could principally be done on 25% of CPU's core. Time could be reduced this way attractively for rendering when switching view port render from CPU to GPU or starting final render on GPU.
We know exactly what type of kernel to compile only when the scene is exported from Blender so we would have to continuously export/compile the scene after every edit to try to "anticipate" the rendering.

The main problem is that, not only OpenCL compilers are slow, they are also single thread ... can you believe that ? The same companies selling CPUs with tons of cores are also giving their costumers single thread drivers :roll:
Support LuxCoreRender project with salts and bounties

User avatar
Sharlybg
Donor
Posts: 1859
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: Reduce the number of OpenCL kernel compilations

Post by Sharlybg » Wed Jan 01, 2020 8:42 pm

The main problem is that, not only OpenCL compilers are slow, they are also single thread ... can you believe that ? The same companies selling CPUs with tons of cores are also giving their costumers single thread drivers :roll:
how on earth this can be possible ? what a shame :|
Support LuxCoreRender project with salts and bounties

Portfolio : https://www.behance.net/DRAVIA

User avatar
lacilaci
Donor
Posts: 1856
Joined: Fri May 04, 2018 5:16 am

Re: What about (pre-)compiling in background when using BlendLuxCore?

Post by lacilaci » Thu Jan 02, 2020 5:38 am

Dade wrote:
Wed Jan 01, 2020 7:04 pm
FarbigeWelt wrote:
Wed Jan 01, 2020 5:19 pm
@Dade, what do you think about (pre-)compiling in background when using BlendLuxCore :?:

Background:
Because most of the time when I am modeling objects or setting up the scene most CPU's cores are idle. (Pre-)Compiling of scene, objects and openCL kernel could principally be done on 25% of CPU's core. Time could be reduced this way attractively for rendering when switching view port render from CPU to GPU or starting final render on GPU.
We know exactly what type of kernel to compile only when the scene is exported from Blender so we would have to continuously export/compile the scene after every edit to try to "anticipate" the rendering.

The main problem is that, not only OpenCL compilers are slow, they are also single thread ... can you believe that ? The same companies selling CPUs with tons of cores are also giving their costumers single thread drivers :roll:
Make cpu rendering so fast no one cares about opencl or gpu rendering, problem solved :lol: or.... optix :D

User avatar
Sharlybg
Donor
Posts: 1859
Joined: Mon Dec 04, 2017 10:11 pm
Location: Ivory Coast

Re: Reduce the number of OpenCL kernel compilations

Post by Sharlybg » Thu Jan 02, 2020 7:39 am

Make cpu rendering so fast no one cares about opencl or gpu rendering, problem solved :lol: or.... optix :D
There is a reason why theses great renderer are GPU only

Fstorm
Octane
Redshift

If we go optix so AMD user will be left on the Dust ?
Support LuxCoreRender project with salts and bounties

Portfolio : https://www.behance.net/DRAVIA

User avatar
lacilaci
Donor
Posts: 1856
Joined: Fri May 04, 2018 5:16 am

Re: Reduce the number of OpenCL kernel compilations

Post by lacilaci » Thu Jan 02, 2020 9:09 am

Sharlybg wrote:
Thu Jan 02, 2020 7:39 am
Make cpu rendering so fast no one cares about opencl or gpu rendering, problem solved :lol: or.... optix :D
There is a reason why theses great renderer are GPU only

Fstorm
Octane
Redshift

If we go optix so AMD user will be left on the Dust ?
there is a reason why fstorm, octane, redshift don't use opencl too :D
what is putting amd user to dust is opencl not optix.

User avatar
lacilaci
Donor
Posts: 1856
Joined: Fri May 04, 2018 5:16 am

Re: Reduce the number of OpenCL kernel compilations

Post by lacilaci » Thu Jan 02, 2020 9:24 am

By the way, will these improvements help with viewport rendering?
Right now adjusting anything about materials etc in blender is extremely slowly on opencl, using cpu the changes update quick but cpu is very noisy to see some subtle texture adjustments.

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

Re: What about (pre-)compiling in background when using BlendLuxCore?

Post by Dade » Thu Jan 02, 2020 11:22 am

lacilaci wrote:
Thu Jan 02, 2020 5:38 am
Make cpu rendering so fast no one cares about opencl or gpu rendering, problem solved :lol:
My RTX 2070 Super is "only" 2 times faster than my AMD 3900X. It is a huge difference compared my old PC where the GPU was several time faster than the CPU (AMD 290X Vs i7 3930K).

AMD/Intel need to put out a competitive GPU with NVIDIA: GPUs development is becoming more and more stagnant. It is the same situation of CPUs a couple of years ago.
lacilaci wrote:
Thu Jan 02, 2020 5:38 am
or.... optix :D
This thread is about CUDA support under disguise: being able to compile the GPU kernel only once is one of the requirement to be able to support CUDA. But it is a long way.
Support LuxCoreRender project with salts and bounties

Post Reply