Saturday, 14 November 2009

Autodesk: Increasing the paging file to override Memory issues

Often when rendering complex scenes with Max and mental ray, one’s computer may run out of memory.

This is mainly due to the fact that Max cannot free up enough memory necessary to process the full render.

There is a quick fix for this however, it is strongly recommended to ultimately add more memory to the computer(i.e.4GB/8GB+) whilst running 64bit applications for Max and windows.


Also, check my New Book: 3D Photorealistic Rendering: Interiors & Exteriors with V-Ray and 3ds Max


The following “trick” may or may not work for 32bit applications however, it definitely works for the 64bit.

1-On start up windows, choose the control panel option.

2-In control panel, choose system.

3-In the system settings, go to advanced system settings.

4-The system properties dialog should open.

5-In the performance group, click on the settings button. The performance options dialog should open.

6-Click on the advanced tab; under the virtual memory group click on the change button. The virtual memory dialog should appear.

7-Uncheck the automatically manage paging file size for all drives function, to enable the paging file for each drive settings.
Choose your C drive as your volume label of choice, and check the custom size function. The initial size (mb) function should be equal to 1.5 times of your total memory (RAM) value (i.e. in my case I have 8GB, therefore 12GB).

The maximum size (mb) should be equal to at least 3 times of your total memory size(i.e. 24GB).
It is worth mentioning that some users that have huge amounts of free hard disk space(i.e. 200GB C drive space) tend to set their maximum size(mb) value to about 60GB or more.

Moreover, prior to setting the maximum size, ensure that you have at least 3 times freer disk space than the maximum size value.

Next, click the set button to set your parameters, followed by ok. The system properties warning should pop up, click ok to close it.









8-Back on performance options, click ok, followed by clicking "apply" to close it.

9-The windows restart warning dialog should pop up, choose the appropriate option.
The changes will only take effect once the computer is restarted. Also, it is recommended to empty one’s page file from time to time.








It is worth mentioning that, the above procedure will not speed up your renderings however, it will ensure that you never run out of memory when it is needed.
To speed up renders one has to ultimately add extra processors (i.e. 2.80 GHZ or higher) and more memory with 64bit applications (i.e. 4GB/8GB+).


Finally, in very extreme and difficult cases of memory loss, one can additionally enable the "use fast rasterizer (rapid motion blur) function, from the "rendering algorithms" parameters.
This rendering method will bypass most mental ray memory issues.

Note: Although very powerful, this rendering algorithm disables some of render elements. To override this, simply render the file output to an EXR file extension type, provided one has the material IDs/Object IDs,etc, originally enabled in 3Ds Max.

If facing difficulties extracting these EXR passes in Photoshop,After Effects,etc;simply switch your 3Ds Max back to standard mental ray rendering algorithm when computing your AO pass, and enable your rendered elements again; with cached FG at a very low res to render the final output in higher res.

For more information about tackling memory issues,please check my other posts in this blog:


mental ray_the usual suspects:Displacement and proxy errors




Decoding mental ray BSP tree


I hope you have found this post interesting.

Ta

Jamie



My 3D Portfolio:


New Book: 3D Photorealistic Rendering: Interiors & Exteriors with V-Ray and 3ds Max



More tips and Tricks:

Post-production techniques

Tips & tricks for architectural Visualisation: Part 1

Essential tips & tricks for VRay & mental ray

Photorealistic Rendering

Creating Customised IES lights

Realistic materials

Creating a velvet/suede material 

FoxRenderfarm

www.arroway-textures.com 

Renderpeople

Gobotree

10 comments:

  1. Call me crazy but who is running out of memory on 64-bit machines. I get this problem all the time on 32-bit but you must have a pretty complex scene to run out in 64-bit...

    ReplyDelete
  2. Hi Gordon,

    Thanks for your feedback here!!

    I for one, just finished a project where I had to incorporate over 2 million people in an animation.
    Furthermore, when working on landscapes with thousands of different trees and shrubs for an animation, the above technique may help if one has less than 8GB of Ram.
    Finally, highly reflective scenes and vast cityscapes often require an extraordinary amount of Ram to compute.

    Regards
    Jamie

    ReplyDelete
  3. Hi Jamie,

    I our experience, it's even faster to set the lower and higher value to both the same maximum value, so that the operating system doesn't need to go higher in a progressive way. (We have been doing this since 17th of july 2007 - my collegue who is installing new machines at the moment just told me. he got notes of all these findings)

    ReplyDelete
  4. Hi nisusCGA,

    Thanks for your input here!

    I must confess that I have never tried it before. Simply because your methodology would defeat its original purpose...in theory.
    However, I will definitely try it to see the results.
    Someone actually said something very interesting to me the other day:

    "The younger knows the rules, but the older should know the exceptions".

    Thanks again for your feedback here.

    Regards

    Jamie

    ReplyDelete
  5. This is a well known method and it is good that you breathe new life into it. In our systems depending on the budget we do a couple of things. The first is use a RAID0 or 5 of four HDD (<$400) for your media cache, paging / virtual memory; or, second, instead of using SSD and if you have an available PCI-e slot you can add a Fusion-IO storage device for about $900 and then make it your paging / virtual memory drive. It is slower than main memory but much faster than even RAID0 solid-state drives. It takes more money but it provides unbelievable more performance.

    ReplyDelete
  6. Hi John,

    Thanks for your feedback here!!

    Your tips are great; I shall have a go at them on my next project!
    I had also tried solid-state drives in the past, and wasn't able to pinpoint major improvements in the rendering performance; apart from the machines not crashing...which was great!

    Thanks again for your feedback here.

    Regards

    Jamie

    ReplyDelete
  7. I have rendered out animations that, depending on what was shown or hidden ranged from 8-14 million polys. Everything was reflective, many things refractive, and used GI. Oh and it was full 1080p frame sizes too. Even on a 64 bit machine with dual quad core CPUs and 8GB RAM, you still need a properly set page file. I used the exact ratio site here and have never had a problem.

    For the record, a guy at the company that built my machine, the3dshop, said he's seen problems with performance if you set your page file more than 3 times your RAM size. He didn't get into it much, but I've never known him to give me bad advice so I'm sticking with it.

    ReplyDelete
  8. Hi Doug,

    Thank you very much for your feedback here!!

    It is great to know that your methodology works well for you.
    I shall try all the above suggestions myself, in due course!

    However, setting up one's paging file to three times or more than the total Ram is something that is advocated extensively by Microsoft experts. In fact, one can confirm this theory from their official website.
    Perhaps the problems detected by your IT guy are attributed to other factors, as opposed to setting up the Maximum paging file to three times or higher than the total Ram?
    One of the numerous common mistakes is to try to set up the above recommended values without having enough free space to accommodate them! Or even setting up the paging file on the wrong drive; etc?

    By the way, as mentioned earlier in this post, by simply enabling the "use fast rasterizer (rapid motion blur) function, from the "rendering algorithms" parameters, most memory issues should be bypassed, 98% of the times.
    From my personal experience, the above mentioned methodology (i.e. use fast rasterizer (rapid motion blur) works for me, 99.9% of times.

    Thanks again for your feedback here Doug!

    Regards

    Jamie

    ReplyDelete
  9. wow.. this is really useful info.
    i am mental ray user also. and, i got information from Jeff Patton, he said, uncheck "Enable" scanline mode in Redering Alogarithms will helpful for a scene with lots of object and polys. and it's works.
    i tried in my last scene, a 3 level house with full 3d models, include all the trees and grass, and it's totally more than 9 million polys. the image is in here :
    http://teknikarsitek.deviantart.com/art/BSD-City-House-Indonesia-166070080?q=sort%3Atime+gallery%3Ateknikarsitek&qo=0
    so, i don't know what the relevan of "Enable scanline mode", but it's really usefull for complex poly scene. :)

    ReplyDelete
  10. Hi Artvisualizer

    Thank you very much for posting your feedback here!!

    I suspect I had also suggested this rendering algorithm to one of your colleagues in my earlier posts about the “...usual suspects...”.

    I am glad to hear that it also works for you.

    My good friend "Alf" who used to work for mental images as a director for product and integration, had been advocating the above mentioned methodologies (i.e. use fast rasterizer rapid motion blur function, BSP, etc), for at least five years now.
    Being so vital for production, I am still surprised that Max help files don’t have much information about them still.

    Finally, as mentioned earlier in a variety of my posts on this blog, my other articles and beta forums, it would be great if mental images/Autodesk could solve some of its mediocre glitches and push it as the main rendering algorithm!

    Regards

    Jamie

    ReplyDelete