Huge RAM usage during kernel compilation

Use this forum for general user support and related questions.
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
marcatore
Donor
Donor
Posts: 463
Joined: Wed Jan 10, 2018 8:04 am

Huge RAM usage during kernel compilation

Post by marcatore »

Is it normal that during the kernel compilation the RAM usage doubles?

I have a scene that needs 4Gb (at least this is what task manager says) but during the kernel compilation RAM goes to 8GB.

Anyone else?
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Huge RAM usage during kernel compilation

Post by Dade »

marcatore wrote: Tue Aug 06, 2019 2:41 pm Is it normal that during the kernel compilation the RAM usage doubles?

I have a scene that needs 4Gb (at least this is what task manager says) but during the kernel compilation RAM goes to 8GB.

Anyone else?
NVIDIA GPU ? Some OpenCL compiler is both slow and memory angry, however, if it is the compiler, the amount of memory used will not be scene related but code related. So a scene using the same amount of features will still use 4GB even if it is 40GB large (instead of 4GB) or even 4Kb large.

It is a kind of fixed cost related to the features. It should also be not CUDA PTX related so it should happen only the first time, than the code is cached (OpenCL C is compiled to CUDA PTX, aka "assembler", as far as I know).
Support LuxCoreRender project with salts and bounties
marcatore
Donor
Donor
Posts: 463
Joined: Wed Jan 10, 2018 8:04 am

Re: Huge RAM usage during kernel compilation

Post by marcatore »

NVIDIA here.
Update on RAM usage.
I've killed blender. Closed any other programs.
16Gb of total ram.
Started again blender and the scene.
Press render.
Just before kernel compilation I was less than 5Gb. Kernel compilation started and fastly grow up to 15Gb (ram usage of blender process).
And it's super slow.

I can't understand when you talk about the caching of the kernel compilation.
It seems that it never cache anything cause it redo everytime... full compilation is needed just for one additional feature? Is it not possible to have a kernel compilation for just new features?
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Huge RAM usage during kernel compilation

Post by Dade »

marcatore wrote: Tue Aug 06, 2019 2:57 pm I can't understand when you talk about the caching of the kernel compilation.
Just try to run the same rendering 2 times, the second should be very fast.

marcatore wrote: Tue Aug 06, 2019 2:57 pm It seems that it never cache anything cause it redo everytime... full compilation is needed just for one additional feature? Is it not possible to have a kernel compilation for just new features?
I have tried but the driver is so smart to recompile everything anyway :roll:

In general, it is the problem described here: viewtopic.php?f=5&t=1080#p12555
OpenCL should now support all recursive materials/textures without the need to recompile the kernel (i.e. material/texture interpreter);
P.S. AMD compiler doesn't suffer of this problem.
Support LuxCoreRender project with salts and bounties
marcatore
Donor
Donor
Posts: 463
Joined: Wed Jan 10, 2018 8:04 am

Re: Huge RAM usage during kernel compilation

Post by marcatore »

Understood. Now I'm stuck cause it seems that it doesn't finish the kernel compilation.

I can't understand what's going on.

Could be a material that make things bad?
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Huge RAM usage during kernel compilation

Post by Dade »

marcatore wrote: Tue Aug 06, 2019 3:04 pm Could be a material that make things bad?
Recursive materials or textures are usually main source of problems (a material referencing another material like mix, coating, etc, or a texture referencing another texture like add, mix, etc.).
Support LuxCoreRender project with salts and bounties
marcatore
Donor
Donor
Posts: 463
Joined: Wed Jan 10, 2018 8:04 am

Re: Huge RAM usage during kernel compilation

Post by marcatore »

I have a material with 30 textures mixed by the objectID.

I'll check to disable it... it's the most complex I have in terms of nodes
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: Huge RAM usage during kernel compilation

Post by lacilaci »

Do you by any chance try to do a border rendering? There seems to be an issue with that.. Or some of the caches (caustic cache?) These are 2 instances where I get some memory leak/blender crash...
marcatore
Donor
Donor
Posts: 463
Joined: Wed Jan 10, 2018 8:04 am

Re: Huge RAM usage during kernel compilation

Post by marcatore »

Found it... it was that material.
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: Huge RAM usage during kernel compilation

Post by lacilaci »

marcatore wrote: Tue Aug 06, 2019 4:01 pm Found it... it was that material.
What material, might be good to know what material causes such memory issuses.
Post Reply