High RAM usage - tips please

We have workstations with 32GB RAM, but our farm has a mixture of machines, some with 16GB and some with 32GB.

Certain artists are sending scenes to render (using DR) and when I monitor the farm using I find that the CPU usage on the farm machines can be very sporadic, jumping between 0 and 15% activity. Simpler scenes (which need less RAM) seem to be far more efficient on the farm and use 100% CPU across the board. It’s the more complicated scenes with trees and grass and stuff like that where the problems arise. Is this because RAM use is going beyond the limit of the PCs trying to render them?

I keep trying to explain to my artists that they need to watch how much RAM their scenes are using when rendering, but its not clear to me where the problems lie. Live projects become complex very quickly, and troubleshooting projects ‘on-the-fly’ is hard work with demanding clients and looming deadlines.

We use quite a few trees in many of our scenes: some are the evermotion ones and more recently we have also been using Laubwerk trees. They are all very good, but have a lot of geometry and (probably) overly complex materials applied to them. My team are also using ForestPro to scatter areas of grass (despite me often warning against that because of render times etc). They probably aren’t overly concerned with the resolution of textures they are using in their materials either, so some could easily be 1000-4000 pixels I’d guess. The resolutions we are rendering are also job dependent, but they can be anything up to 8k with several render elements.

Can anyone give guidance as to what causes the main RAM use when rendering? Some people suggest making vray proxies out of the trees. Others say that ForestPro creates its own proxies that do the same thing. Some say that rendering to VRIMG file (particularly in high res renders) can help. Do different GI methods use more RAM with certain high poly complex scenes? Should we be telling grass/trees etc not to generate GI?

It would be great if there were some statistics somewhere that say something like:

“Right mate, you are using some really high poly trees here that are using 12GB just to start rendering. Why don’t you optimise them a bit?”
“Mmm…did you know that you are using some bitmaps that are 4k in size. Try reducing those to 1200 pixels and it’ll save a shed-load of RAM.”
“You are rendering an 8k image with 6 render elements. If you render to a VRIMG file instead, you will save 9GB RAM”
“Those trees should really be in a Forest Pro object and that will save 6GB RAM”
“Your method of calculating GI will use 13GB RAM. Consider using LC/BF instead”

In essence, is there a way to find out what bits of a scene are causing the biggest spikes in RAM usage so I can target my optimisation efforts appropriately?

Hi Tricky,

I can’t give you exact statistics, it probably will be impossible to provide something like that since every scene is so different in setup, different artists set things up differently all the time too.

What I can tell you is from experience, the DR machine should never exceed in ram usage that of the main server, typically for me all the dr nodes actually use less ram.

In case of RAM vs vrproxy, actually vr proxy is always going to be slower then regular geometry - first it has to be read from disk/network, while regular geo even heavy one will be already in ram when scene opens and render begins. The benefit of proxy is that - if you have a scene which requires 24 gb of ram and you only have 16, it will still render, swaping in and out of memory, vs regular mesh will just run out of ram and crash. This will take longer though.

If your network / server is not fast enough to keep up with the high bandwidth too, loading of proxies, scenes will take longer, and if they have to by dynamic (which proxies are anyway) then loading/unloading them will take even longer. What if your scene has 10-20 proxies each 100-200 mb, reading that data constantly from network between several artists will certainly cap it.

I can tell you though, that recently I’ve upgraded my farm, I had a mix of 16, 24, 32 and 48 gb of ram on my render nodes. I’ve upgraded all of them to 48 and though they are exactly same nodes (cpu xeon x5650) I’ve immediately saw a dramatic difference in performance: those which got more ram rendered faster, then before, and my render time became very uniform across entire farm.

Generally how windows / rendering will work is that if you have more ram, it will use it, if you don’t it will (page probably instead). My 16 gb render slaves still got the frames done but it took 40 min per frame vs the 48 gb which took just 10 min per frame.

32gb isnt enough for commercial arch vis stuff. the easiest and cheapest way around this is to buy more

+1 for buying more ram.
Quicker and easier than trying to reduce memory usage in scenes.
I had a project that choked 32gb machines and was about an hour a frame but once I switched to 64gb that went down to about 30mins a frame.

Not necessarily the easiest as some of our farm can’t have more than 16GB installed. I will need to go through and check mobo specs.

If I don’t use proxies, and the ram is exceeded, will a machine just not render at all? I thought it would render, but much more slowly as it would need to keep saving out to disk all the time to, in effect, increase the level of RAM the machine has. This would be a revelation to me and a hugely important one!

No it would not render. Lets say you try to load a model that has 100 million polys, during rendering it might require 256 gb of ram but if you only have 16, it will just crash. That’s how it typically goes. Now proxy will allow you to load some bits for the buckets that are currently used, then unload them, and load some more for next ones. Its much slower, but allows you to render larger data sets with less ram.

People think that having everything in proxy will automatically solve their problems, but it won’t while it will render images, it won’t exactly speed things up, or make things more efficient.

Yikes. I wasn’t aware of this. I always (seemingly wrongly!) thought that a machine would fill up its RAM and if it needed more, it would just ‘extend’ into (slow) hard disk space as it needed. I didn’t realise the render would just fail! It would mean the render would happen more slowly, but it would still complete.

Can this be confirmed at all? (not that I don’t believe you).

it shouldn’t crash until you run out of virtual memory too.

you should need less ram if you render BF/BF rather than lightcache. probably still be slower though.

I remember when i used to use vrayscatter/multiscatter. that it used way too much ram on big scenes with lightcache. not really an issue now that i use forest.

A scene I have rendering right now is using 28.5GB on the local machine. It has been sent to all our render famr machines (some of which have only 16GB). This particular scene is rendering at 100% CPU load on every machine, so this suggests the 3dsmax session does not necessarily crash as stated by Dmitry.

Logging into one of these machines with 16GB ram, the 3dsmax session is using 14.2GB RAM at 99-100% CPU load. Presumably that means the other 14GB or so is somewhere in ‘swap-disk-land’?

So, yet more confusion…where one person states that Max will crash if it needs more RAM than contained in the machine, my setup suggests otherwise (though this doesn’t explain the problems I often get - and how this thread began - where the farm just sits there between 0-10% cpu load on more complex machines).

as long as you don’t go over your maximum commit (ram+virtual memory) it shouldn’t crash. but it will be much slower going over ram.

don’t use windows auto size, it will crash before it resizes anything.

but making more use of proxies is going to be better than using virtual memory.

none of this will make your renders faster though.

I’ve found that other render machines seem to crash when RAM fills, and as others have said upgrading is the easy solution. 16GB seems to be a very low maximum, how old are those computers and how much are they contributing?

With more straightforward scenes, they contribute a lot. Problem is I don’t think some of them can have more than 16/32GB installed so would mean replacing mobo and reinstalling.

Some of my artists are using progressive rendering during scene setup and for general testing. Does having not enough RAM have a more significant effect in progressive rendering? I wonder if these are the situations where we are seeing 0-10% CPU usage?

that is correct actually.. as long as the pagefile is large enough it will swap to the hard drive. if the pagefile size is exceeded it will crash.

it doesn’t seem that long ago that we had to fit everything in less than 3gb…

I use to set my swap file 4 X the amount of ram I have in the machine

I don’t think it will make a difference. regardless of what image sampler you’re using, once you run out of memory the rendering will crawl to an end like that.

32gb is still sufficient for pretty much any arch.vis job. i do find myself wishing for more occasionally these days, but the ram slots of both my machines are full.

certainly the cheapest way around this is to actually optimise your scenes a little. takes some time, but is good practise generally, however much ram you have.

*reduce the resolution of unnecessarily large textures.. people tend to slap 8k textures in a scene when a 1k texture would be visually indistinguishable.

there are several applications, some free, that let you batch resize textures. you can also use tiled exr or tx mipmapped textures, but ive found this slows rendering unacceptably.

* use proxies.

*make sure you are instancing instead of copying. there is a script somewhere that will replace copies with instances, dont remember the name.

* optimise your geometry. people get lazy and just slap purchased models in their scenes without considering polycount. pro-optimiser does a good, low effort job at this.

it helps to have lower poly versions of trees for use in large forests etc.

* set your displacement and fur settings to a reasonable level for the scene. adjust the density/edge length until it starts to look crap, then turn it up until it looks good..

* lightcache can use a fair bit of ram.. not such a large proportion these days.. in the days of 2gb in a workstation it could be quite a large proportion of available ram.

* use vrimg to save out if the images are super high res. and disable the full res vfb.

* render via backburner as opposed to directly in max. that always used a couple of Gb less ram.

for years i have specialised in rendering massive masterplans etc. i did scenes of 10 sq km with golf courses full of trees and hundreds of buildings in 2gb ram.

my last major masterplan was a city with 80,000 trees and approx 2000 buildings, plus cars, planting etc. etc. i just squeezed it into 32 gb without having to down-res the tree models.. i could probably have cut ram usage in half if id bothered with that step.

a more correct statement would have been “32 gb isnt enough if you dont want to optimise”

- but then Bobby (glorybound) demosntrated recently, if you have moer ram you get more careless about being neat. a building with trees and planting eating 128gb..

- you need to tell your artists, if thy want to render at full speed their jobs must fit in 16gb. for most scenes this is quite doable with a few hours of tidying. for those that are not, suffer the slowdown on your 16gb machines.

this is slightly complicated by the fact that vray tends to use more ram if its available, so its harder to get a scene to fit in 16gb if you are on a 32 gb machine, than if you were working on a 16gb machine. my tips above, if followed should help.

What I often find in scenes that uses way more Memory than one would expect.
Trees. Some are simply completely over the Top. For example we recently got the Evermotion 163 Library. The largest Tree is 1,6GB without Maps. This is not even a large Tree. They have scanned trunks and tesselated leaves.Well it´s nice if you want a Macro from an ant climbing a Tree but it´s simply to much for an average archvis. But those trees can be optimized with ProOptimzer sometimes down to 10% vertex count without losing to much detail. Same goes for any other 3d Assets. Some have a Turbosmooth on rendertime applied and some have displacement applied through the material. Some have horrible materials in general that should be remade from scratch. (Without calling names, but expecially to the guys who think a physically SSS on a non volumetric leave object is a good idea)

Working clean and accurate. The most important point. I have people here who constantly exceed the memory of our renderfarm while others don´t. Below the line it´s pure laziness excussed with “I have a tight deadline”. This may sound harsh but that´s simply the experience I made. The cause of this is. Imported objects are not checked. Valid for all points I made above. Used textures expecially texure size is not checked. I recently see Refamo go completely red. when I checked the scene, wich was a pretty small one. Just a room, it turned out the guy was using some kind of floor tiling plugin that would generate 14k jpgs for each floor tile. Using master scenes. When we have larger projects we would usually make a masters scene that contains everything. Once you have a camera fixed to be worked on, refined and rendered you would delete absolutely everything you don´t see and make a seperate scene. Some people just don´t do it and wonder why they blow the farm. Make sure all 2D CAD data is deleted before starting to work on materials, lighting and previews. Sometimes they consume a lot of Memory and extra time when working on a scene. You can always merge them back from a previous scene in case they are needed. Modelling. I see a lot of people who build their models especially houses like Toy Blocks resulting in huge amounts of objects and polys. Sometimes thousends single non instanced objects for a simple house. Modelling facades with traditional poly modelling (build box, slice, inset, extrude, detach,snap clone instance,repeat as neccessary) will give you absolute clean and flexible models where a hole building sometime is just some hundred kb in size. 3dsmax is the absolute best software one can imagine to build facades and houses using box modelling. The people who think they are faster for example with Sketchup by building Toyblocks simply shall sit down and learn 3dsmax and what ply modelling really is. From my experience I can say that a standard archivz scene indoor, or outdoor in the size up to a commercial building including lots of assets, trees, grass, people should be easily renderable with 32gb of RAM if one is able to work clean. A good practice. Let people make realtime projects in the Unreal engine or Unity. There you have no other chance than working clean.

One could argument. It uses to much time to check all my models and maps and all this stuff, so I just buy more Memory and am working a lot faster. Well, you don´t. Working clean gives you a lot of speed advantages. Working in the viewport is faster. Sending the rendering to the farm is a lot faster. Sometimes there are days where you do lighting, shading, preview rendering the whole day. It makes a big difference if sending a scene to the farm takes 1 minute or just some seconds. Also once you optimized a model, or you have a rezised version of a large texture you can always reuse it in the future. So after all, the time you spend in advance will pay off in the end.

That beeing said, it doesn´t mean you don´t more Memory. More RAM of course is always better. Because sometimes you get horrible models from customers or you need to render 30k images. Sometimes the requirements just give you no other choice to make huge scenes.