Jump to content

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

 

 

Link to comment
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
Link to comment
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
Link to comment
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.

Link to comment
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
Link to comment
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...

Link to comment
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.

Link to comment
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! 

Link to comment
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.

Link to comment
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:

Link to comment
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!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...