Cycles VRAM Usage Reference List

MOD: Perhaps this thread should be somewhere else. If so, please move it :slight_smile:

As a user of Cycles with the GPU, you always have to compromise between eye candy and VRAM usage. Even though I have tried, it is really hard for someone in a normal desktop environment and a simple program like GPU-Z to try to understand what it is that actually uses up the VRAM. And since I am no programmer, I was hoping someone with the understanding of Cycles or path tracers in general could at give us a basic understanding for how much space things actually take up :slight_smile: And, if possible, we could create a list of what each feature consume so it will be easier to plan your scenes in the future; to already know, depending on you amount of VRAM, how many polygons you can have, or how many textures of a certain resolution.

Polygons - Does every single polygon take the same amount of space? If I have 100 000 polygons, will that take up the same amount of VRAM regardless of structure and placement?

Hair - Is hair just normal polygons to the GPU? Could you could take the amount of polygons per strand, multiply it by the complete number of strands to get the number of polygons, and the the space required? Does children affect this in any way or are they saved in the same way?

Textures - How much does each pixel take up? What is the difference between using a 1024x1024 texture and one with 2048x2048? Do the number of textures affect or is it the total resolution that matters?

Settings - Are there any render settings that in some way makes the calculations extra hard or big, and therefor uses up more VRAM? The tile sizes, no caustics and all of those.

The Scene - Perhaps even certain light configurations or shaders could affect this?

Placement - Will everything in your scene get passed on to the GPU (regardless of if it is placed 1000 BU behind the camera) or is there some kind of first elimination? Would you save space by removing anything that you know will not affect the light of the final image?

Ray Visibilty - If you remove certin types of ray visibilty for objects, will that make a difference or is everything just loaded to the GPU as normal as long it is used in any way in the scene?

Rendered resolution - How does the output image affect it? If I go from 540p to 1080p, what difference will that make? (Would this perhap take the same amount of space as using a texture with the same resolution in you scene?)

If it is impossible to give general answers to this, I completely understand :slight_smile: But I really hope it is possible! Prioritizing your scenes would be so much simpler, with much less guessing and having to do over if you just knew your “budget” and what you can get for it beforehand.

Thanks in advance!

is there no mode in blender to get that info, like a debug mode? anyone knows?

CUDA-GDB provides an additional command (info cuda state) which displays
information such as the current hardware being used and memory that has been
allocated via cudaMalloc().

will investigate, kinda feels like before testing you need more precise debug info about vram usage etc.

Indeed this would be VERY helpful !

Kind regards

I have never heard of one, but it would be great if it was! Or if you could gain the same knowledge (but even more exakt) from just knowing the code of Cycles.

At least I think that if you are supposed to do serious work, this is almost essential. I don’t know how strict it is in the movie industry, but when it comes to games everybody knows their polygon budget, maximum resolution on textures, etc so everyone on the team makes eveything on the same level, maximizng look vs. cost. You don’t want one part to look great and another to look bad :slight_smile: Same level of detail everywhere is key.

Okay, I have started my investigation!

After my first tests involving the number of vertices, the answer seems much simpler than I thought.
(NOTE: This is done in a desktop environment which means I can’t see changes smaller than 1MB. No other windows or anything was moved during this, giving me the same “base usage” for all test)

First of all, the placement or structure doesn’t seem to matter. If it is in the scene, it will be passed on to the GPU. The only way to stop an object from doing so is to have it on a disabled layer or disable it for rendering in the outliner.

The relationship between vertices and memory is completely linear. By comparing the increase of memory with different amount of vertices, I reached the conlucion that every vertex takes up approximately 130B.

This means that if you have a head room of 1GB (1GB more than what takes for the actual scene start, which takes up a lot of memory, even if it is empty) you can simply take 1 000 000 000 /130 to find out how many vertices fits. The answer is approxiamtely 7,7 million vertices.

I will continue my not so exact, but in my opinion good enough, researches tomorrow :slight_smile:

I’ve been asking Brecht about the memoryusage of Texturefiles.
From what I understand about it, Textures with Byte precision (PNG for example) use less memory than Textures with float precision (EXR, TIFF, HDR), see here:

But I’ve no idea which other Imageformats are in Byte precision and which are in float precision.

Kind regards