Jump to content
kfu

How to optimize memory usage with mantra

Recommended Posts

I had a scene with 5507 packed fragments(shouldn't be considered as heavy scene,right?), when I render it out using mantra, it took me 92GBs memory. When I include some other geo inside the scene, it won't even render out

Render settings are default 3x3 with all limit set to 0.

Geo material are pre-defined custom shader packed inside. So I need to turn on save all material when rendering, don't know if this eats up a lot memory?

Btw, is there any difference to load the packed fragments as packed disk primitives? From my test the ram usage is the same.

Can anyone help me with the issue, I can send u the file if necessary. Much appreciated!

Capture.JPG.dc7d59d6a2c0a275aff470250e8e672d.JPG

 

 

Share this post


Link to post
Share on other sites

it's hard to advice anything without inspecting the hip file, but scene like what i see definitely shouldn't be overly heavy for even a mid-range pc.

some basic debug tips:

- do you experience lower memory footprint with other renderers?

- i assume your sim is cached to disk and you only render that 

- is your 5500 pieces made of instaces or is it each unique packed geo?

- if theyre unique, packed prims don't really offer any benefits.

- if you unpack the geometry before rendering, is it eating the same amount of memory? 

- you can read a lot of info from console verbose if you enable it on Mantra node (like how much memory different things cost)

- is memory consumption lower if you render without textures/shaders?

- have you tried to load the cache into a fresh scene and render from there with default mantra settings?

- unlikely, but don't you have some crazypants large scene bounding box? (i.e. any stray geo floating very far from where you want it to be)

hope that helps. cheers. D.

  • Like 1

Share this post


Link to post
Share on other sites
23 hours ago, kfu said:

I had a scene with 5507 packed fragments(shouldn't be considered as heavy scene,right?)

all depends on the complexity of the geo

packed fragments are just referencing different parts of underlying geo, which can be even more complex than what you see, this happens especially when using deforming RBD for example

also packed fragments are rarely instanced, chances are that unless you deliberately instanced some of them they are all pointing to uniwue part of the geo

also using displacement or anything else that dices the geo may bump your memory usage

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, davpe said:

it's hard to advice anything without inspecting the hip file, but scene like what i see definitely shouldn't be overly heavy for even a mid-range pc.

some basic debug tips:

- do you experience lower memory footprint with other renderers?

- i assume your sim is cached to disk and you only render that 

- is your 5500 pieces made of instaces or is it each unique packed geo?

- if theyre unique, packed prims don't really offer any benefits.

- if you unpack the geometry before rendering, is it eating the same amount of memory? 

- you can read a lot of info from console verbose if you enable it on Mantra node (like how much memory different things cost)

- is memory consumption lower if you render without textures/shaders?

- have you tried to load the cache into a fresh scene and render from there with default mantra settings?

- unlikely, but don't you have some crazypants large scene bounding box? (i.e. any stray geo floating very far from where you want it to be)

hope that helps. cheers. D.

 thanks for all the tips, haven't tried any other render yet, from what I understand maybe because of the last one you mentioned(crazypants large scene bounding box), do you mind take a look of my file, might need to cache some geo on your side.

Share this post


Link to post
Share on other sites
33 minutes ago, anim said:

all depends on the complexity of the geo

packed fragments are just referencing different parts of underlying geo, which can be even more complex than what you see, this happens especially when using deforming RBD for example

also packed fragments are rarely instanced, chances are that unless you deliberately instanced some of them they are all pointing to uniwue part of the geo

also using displacement or anything else that dices the geo may bump your memory usage

didn't use any displacement, might need double check with the packing, dose packed fragments offer more benefits when shattering one geometry compare to packed geo 

Edited by kfu

Share this post


Link to post
Share on other sites
1 hour ago, kfu said:

 thanks for all the tips, haven't tried any other render yet, from what I understand maybe because of the last one you mentioned(crazypants large scene bounding box), do you mind take a look of my file, might need to cache some geo on your side.

i don't see the file attached...

Share this post


Link to post
Share on other sites
2 minutes ago, davpe said:

i don't see the file attached...

hey, I send you a message with file attached, hopefully you got it

Share this post


Link to post
Share on other sites
13 minutes ago, kfu said:

hey, I send you a message with file attached, hopefully you got it

ok i opened the file, and after trying to cache the stuff out for like 20 mins, i gave up with a conclusion that everything in you scene is unjustifiably heavy. technically its ok but just impossibly slow to work with. for that kind of shot shot with orbiting debris you can safely go with 10x lighter geometry and use displacement at render time. also, use instances for this, there's no need to have 5500 unique rocks. scene like this can run almost realtime in opengl if you spend some time on optimizing stuff. that would be my first advice. then try to get your finished sim into a fresh scene and try to render with default settings of everything and see how it goes. also check the polycount before rendering and do all the other things I suggested before :)

cheers, D.

Share this post


Link to post
Share on other sites
49 minutes ago, davpe said:

ok i opened the file, and after trying to cache the stuff out for like 20 mins, i gave up with a conclusion that everything in you scene is unjustifiably heavy. technically its ok but just impossibly slow to work with. for that kind of shot shot with orbiting debris you can safely go with 10x lighter geometry and use displacement at render time. also, use instances for this, there's no need to have 5500 unique rocks. scene like this can run almost realtime in opengl if you spend some time on optimizing stuff. that would be my first advice. then try to get your finished sim into a fresh scene and try to render with default settings of everything and see how it goes. also check the polycount before rendering and do all the other things I suggested before :)

cheers, D.

XD yeah, kind heavy to work with, the debris will assemble into one rock, so they are all shattered geometry from the big rock. I had other orbiting geos that was instanced. I think maybe I subdivided too much for the inside faces.  Thanks for the help! 

Share this post


Link to post
Share on other sites

just pick 20 pieces you like and instance them if you don't need to literally see how the original shape breaks. that'll be the biggest performance boost, even if you use your current geo. 

Share this post


Link to post
Share on other sites
58 minutes ago, davpe said:

just pick 20 pieces you like and instance them if you don't need to literally see how the original shape breaks. that'll be the biggest performance boost, even if you use your current geo. 

yeah, I will also do a subdivided fit based on size to reduce the inside face poly counts, that would help too.

Share this post


Link to post
Share on other sites

hey, just a quick update that I made the memory usage down to 30GB and now renders fine, pretty quick too for the main pass. 

rbd_Render.gif

Share this post


Link to post
Share on other sites

Looks nice! I see the fields... did not expect anybody uses fields these days :)

Share this post


Link to post
Share on other sites
6 minutes ago, kiryha said:

Looks nice! I see the fields... did not expect anybody uses fields these days :)

lol, yeah, pop axis force. Why not? Are people tend to more technical or using filed means you are not trying hard enough?:lol:

Share this post


Link to post
Share on other sites

By the "fields" I meant the half-frame for TV broadcasting
I recall I struggle to get fields out of Maya render when I was working on TV in the past millennium. I did not know they are still alive. :)

Edited by kiryha

Share this post


Link to post
Share on other sites
34 minutes ago, kiryha said:

By the "fields" I meant the half-frame for TV broadcasting
I recall I struggle to get fields out of Maya render when I was working on TV in the past millennium. I did not know they are still alive. :)

I guess that was from the 'progressive' settings when I render the gif out from ae media encoder. Never heard of this term before, nice to know!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×