This article provides detailed information on how to handle projects with excessive memory (RAM) consumption which might increase render times or force the host application to crash/freeze.
Similar articles:
Overview
Warnings / Error messages due to insufficient memory
- Hanging or crashing
-
Building Embree Voxel Tree failed errors
Error : Building Embree Voxel Tree failed: [EmbreeTree<0,1,class VUtils::StaticTreeDelegateParam,struct VUtils::SimpleStaticTriangle,struct VUtils::SDTreeBunchDelegetorFace>::build] 1: Creating new scene failed
Error: Building Embree Voxel Tree failed: [EmbreeTree<0,1,class VUtils::StaticTreeDelegateParam,struct VUtils::SimpleStaticTriangle,struct VUtils::SDTreeBunchDelegetorFace>::copyGeometry] 4: Setting vertex buffer failed (number vertices 35721)
Error : Building Embree Voxel Tree failed: [EmbreeTree<0,1,class VUtils::StaticTreeDelegateParam,struct VUtils::SimpleStaticTriangle,struct VUtils::SDTreeBunchDelegetorFace>::build] 4: Committing scene failed
Diagnosing
Before starting to optimize, make sure the issue is indeed excessive RAM usage. You can quickly confirm that by starting a rendering and monitoring your memory usage in the Task Manager (Windows) or Activity Monitor (Mac). If the memory is soaring up to the limit during rendering, it's a clear sign that there isn't enough memory on the machine.
-
V-Ray Profiler
-
Stats tab in the VFB
What can I do to optimize RAM usage?
Use the Bucket image sampler
V-Ray is equipped with Bucket and Progressive Image Sampler modes. While Progressive mode has many advantages, it needs to load all assets into the memory. The Bucket mode on the other hand is much more memory efficient as it needs to load only the information required to render the current bucket.
How to:
- V-Ray for 3dsMax: Render Setup > V-Ray > Image Sampler (Antialiasing) > Type
- V-Ray for Maya: Render Settings > VRay > Image Sampler > Sampler type
- V-Ray for SketchUp / Rhino: V-Ray Asset Editor > Render > Progressive Slider off
- V-Ray for Revit: V-Ray > Settings > Renderer > Sampler
- V-Ray for Houdini: V-Ray > Render Settings > Renderer > Sampler > Image Sampler > Type
- V-Ray for Cinema4D: Render Settings > V-Ray > Image Sampler > Sampler type
- V-Ray for Blender: Render Settings > Sampler > Image Sampler > Sampler type
Note that the bucket size is also something to be considered. A very small size will cause less geometry to be loaded in the Memory. However, that will increase the Render Time due to filtering of the pixels on the Bucket's Edges. The default size is optimized for most scenes.
Switch to Brute Force GI
Although, Light Cache comes with powerful features such as Adaptive Lights, disabling it would help memory utilization.
-
Use V-Ray Proxy
V-Ray Proxy is a very powerful tool that is useful for optimizing projects with a lot of geometry. Proxies are constructed in a way that small parts of them can be loaded and unloaded from the memory on demand without the need to fill the memory with the whole geometry. Proxy geometry will also take less memory than the static original geometry.
Where to find the VRayProxy:
-
Optimize project geometry
-
Optimize dynamic geometry
Hair/Fur, Displacement and Subdivision objects tend to consume a lot of memory and should be optimized.
Learn how in our article about Optimizing V-Ray Displacement.
-
Remove unnecessary/out-of-camera view objects
It's not uncommon to have a project populated with lots of unneeded or out-of-view objects. Removing them may help reduce memory usage.
-
Optimize regular geometry
Often, objects with unnecessarily dense geometry (usually from external libraries) end up in the project. Reducing their polygon count will definitely reduce memory usage. Using Chaos Cosmos assets instead is a good already optimized alternative.
-
-
Reduce the number of Render Elements
Having many render elements and rendering huge resolutions will affect the memory utilization. Keep things tidy and ensure you have only the Render Elements that you really need.
-
Use Tiled textures
Using Tiled Textures (.tx or .exr) brings many advantages, the best of which is great memory saving. Their main characteristic is the fact that they contain smaller versions of the original image.
These images of various resolutions will be used depending on the geometry's proximity to the camera. Lower resolution for far away objects, and larger resolution for closer ones. They are also written and read in Buckets, which works well with the Bucker image sampler.
To convert textures to Tiled textures, use the img2tiledexr tool, included in the V-Ray installation.
Learn more in the documentation about the Image to Tiled Multiresolution EXR Converter.
In 3ds Max and Maya, tiled textures have separate options. Learn more:
In 3ds Max, the V-Ray Scene converter can automate the conversion of textures to tiled textures.
Learn more about the V-Ray Scene converter.
In 3ds Max, you can choose the mipmap resolutions for the tiled textures by using the Blur parameter in the Coordinates section of the VRayBitmap.
Preview of the blur parameter's location in 3ds Max Smaller values than 1 are not recommended, since they will force higher resolutions to be loaded and possibly, not perform any filtering.
-
(3ds Max) Disable memory frame buffer
Disabling the "Memory frame buffer" option will tell V-Ray to render directly to disk, which will in turn save memory.
Where to find the option in 3ds Max.
-
Export to .vrscene and render with V-Ray Standalone
Depending on scene complexity host application may occupy a few gigabytes of memory, which could be very valuable in case there isn't enough for rendering.
Exporting the scene to a .vrscene file and rendering it with V-Ray Standalone will minimize RAM consumption by excluding the Host Application's part.
Learn more in our article about Rendering extreme resolutions with V-Ray Standalone
-
Close other memory-intensive applications
It's not unusual to have multiple applications open when working on a project. Although it's very handy to have all the needed apps up and running, they will also reduce the amount of memory available for the rendering process.
-
Render in separate passes (foreground/background)
This technique is useful for complex projects where all other Memory Optimization techniques fail. Rendering in passes means splitting the scene into separate sub-projects. The most common approach is to render the Foreground and Background separately and then merge both render outputs in a compositing software.
-
Increase Virtual Memory (pagefile.sys) size
Increasing Virtual Memory may help to complete the rendering in case the required memory is just a little bit above the available one. Be prepared for longer Render Times when using this approach since the Virtual Memory is a lot slower than the RAM Memory. Кeep in mind that the page file size needs to be set to either automatic or at least twice the size of the available physical RAM.
-
Use Chaos Cloud
Chaos Cloud is a brilliant option to render projects that can't fit into a local machine's memory. It's a one-click solution that will help you render the scene without investing in additional hardware or losing time to optimize the scene.
Learn more about Submitting Render Jobs to Chaos Cloud in Host Applications.