5
$\begingroup$

I have a scene, about 20 mio faces, 1000 objects, 90% are instances. All modifiers are applied to the objects, in fact, not a single modifier is on any object.

Using the cycles preview, the scene takes about 1GB of my 4GB VRAM. Blender says 2,5GB Mem in the title bar. The scene renders in seconds in the preview.

When I render using F12, Blender uses almost all of my 8GB physical RAM (value of Windows Proccess Explorer), saying in it's title it uses 5.5GB of RAM. I increased my virtual memory to 24GB on an SSD, making 32GB in total.
Blender uses all of that, taking forever to synchronize objects and build BVH. I let it run, it continued, but very slow. At the end I get the CUDA out of memory message.

Conclusion:

  • 4GB VRAM
  • 8GB Physical RAM
  • 24GB Virtual RAM
  • In preview rendering the scene uses 1GB VRAM and 2.5GB RAM.
  • In final rendering 4GB VRAM and 32GB RAM ain't enough to render it

Any idea what I can do?

EDIT: I simplified the scene and made a screenshot.

Green marker: GPU Memory

Red: RAM, Taskmanager (top), Blender (bottom) Cycles memory

Still the scene doesn't render, memory rises in task manager up to 7.7GB, then starts to fill up the 24GB of virtual memory.

Nobody seems to know, how to solve the problem. Maybe someone can answer the question, why this is happening. Why takes it 2 seconds for the cycles preview render to load my scene, build BVH and render it without any trouble, peaking at 1GB VRAM, while F12 eats up all RAM, fails to render and claims I'm out of VRAM? It should be other way round, that the F12 render uses less VRAM, from my experience.

Also the question, why Blender displaying RAM usage completely wrong, remains. I've read an article of Blender Developer Sergey, he's talking about memory fragmentation, but I doubt that would cause more than double of RAM usage. Sure, I don't know.

EDIT2:

I scratched together my last bucks and bought 16GB RAM. Didn't help. Syncronizing and building the scene used again all 16GB of memory and then continued with the virtual memory.

All I can say is, this is definitly a bug. I cannot think of any logical reason, why a scene that uses 1GB VRAM in Cycles preview would use 10x as much in final rendering, given the facts that:

  • There is no modifier on any object
  • Textures are small, 90% of objects are instances
  • Nothing is created at rendertime, there is no particle system

I have no clue where to look for, what could cause this, and apparently no one else has. So I will conclude this is a unknown bug. memory bug

A bit hard to see on the screenshot. Below you can see the GPU memory peak at 10GB. On the right you can see Blender claiming to use 2770MB of memory. Not on the image, in the taskmanager all 16GB of RAM where used.

$\endgroup$
3
  • $\begingroup$ Did you try to change BVH from dynamic to static? $\endgroup$
    – Bithur
    Mar 10, 2015 at 19:00
  • $\begingroup$ This question arises very often on this topic, the dynamic / static setting is only for the preview (in-viewport) rendering. F12 render always is static. $\endgroup$
    – bortran
    Mar 11, 2015 at 9:44
  • $\begingroup$ it might be render layers/passes, are you outputting an AO (ambient occlusion) pass? that gave me memory errors on a heavy scene (I think because ambient occlusion doesn't naturally occur in the style the pass wants, so it has to compute two virtual scenes) $\endgroup$
    – Tim Bahrij
    Nov 15, 2015 at 13:51

1 Answer 1

4
$\begingroup$

I know your question is ancient, but I've just hit the same problem, and yours was the closest matching thread to my circumstances - Cycles running out of VRAM on render when you have already checked Subsurf doesn't have higher Subdivisions on Render vs viewport.

My VRAM "leak" was off-camera objects. It appears viewport Cycles render only loads the objects currently on-screen into memory, while Render time everything not explicitly hidden in outliner in the Rendered layers enters VRAM.

Given you mentioned many objects, quickest fix is to use Camera Cull (think introduced Blender 2.76) ticking it under Scene> enable Simply > Tick Use Camera Cull. Then tick "Use Camera Cull" under all the possibly offscreen object's Object panel > Cycles Settings. Provided you're not too fussed about off-camera objects casting shadows/reflections from far off, simply tick the Use Camera Cull on one object, then select all other objects with the initial object as Active and use the "Copy Custom Properties" button (installed from external script by scorpion81: http://blenderartists.org/forum/showthread.php?316484-Addon-Copy-Custom-Properties), which will tick this on all objects instead of doing it one-by-one.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .