GPU rendering doesn't use the whole VRAM

I also just reported this to blender
https://developer.blender.org/T98867
to try to get more clarity on the issue

It don’t think it’s a bug, a general rule is you need 3x ram for the vram you have. When you’re rendering, open your resource manager and see how high the ram goes. Even though your vram will be far below the 24gb of a 3090, your actual ram use likely spikes well above 32gb when the renders setting up.

I had the same issues as you with both Cycles & Octane. Running 2x3090’s with nvlink on 64gb ram and somehow would constantly out of error at around 21gb vram when I expected to have 48gb. After a bit of Googling, I used resource manager to monitor my ram usage and sure enough it would spike over 64gb during render setup before crashing.

1 Like

I would love to get your input into my question in the above post Hikmet. GPU rendering doesn't use the whole VRAM - #23

I think my assumptions are correct, but that is only if I follow the rule that we base the system RAM needed calculation off of our VRAM limit, and not how much VRAM we have total regardless of memory pooling.

I’m building a new PC and came across this thread during my research. I have a few other multi GPU setups I’d like to confirm with the group here.

So far we’ve confirmed:

  • Single 3090 (24GB VRAM) = requires at least 48GB system RAM
  • Two 3090’s NVLink’ed = requires at least 96GB system RAM (because when memory pooled, 224 = 48GB VRAM. Since we need twice our VRAM count, 248 = 96GB system RAM)

What about these scenarios?

  • Three 4090’s (24GB VRAM each)
    • I think this would still require at least 48GB system RAM, because there is no NVLink memory pooling here.
    • This should mean, if we have a multi GPU setup, the rule of thumb is we need twice the VRAM of our largest GPU’s VRAM count.
    • So it is not twice the sum of your total VRAM spread across all GPU’s (24GB +24GB + 24GB), but just twice the capacity of the largest one you have (2*48GB)
  • Four 3090’s, with two pairs of NVLink
    • In this one, the GPU 1 and GPU 2 are NVLink’ed together. GPU 3 and GPU 4 are also NVLink’ed together
    • Two 3090’s can NVLink to memory pool a combined total of 48GB VRAM. In this scenario we have two pairs of NVLink. So if we were to add up our total VRAM count, that would be 24 + 24 + 24 + 24 = 96GB VRAM. But that doesn’t mean we need 2*96 = 192GB system RAM in order to run this.
    • In this scenario, we would still need only at least 96GB system RAM, because 48GB VRAM is out upper limit per pair, and 2*48GB VRAM = 96GB system RAM.

What I’m trying to confirm is, I think whenever your GPU’s are not linked together via NVLink, then an exact copy of the same data is sent to both GPU’s VRAM. Therefore technically in memory there’s no need to store two copies of the exact same data. So a basic principle would be:

  • If I have three 4090’s, I still only need 48GB system RAM
  • If I have 2 pairs of NVLink’ed 3090’s (for a total of 4 GPU’s), I would still only need 96GB VRAM.

Does this seem right?

You are wrong.

SLI or NvLink is another issue. 2x3090 is not equal 2xVRAM or 2xProcessingPower.

Could you read my second post below? It got caught in the spam filter.

My understanding is, when two 3090’s are NVLink’ed they can memory pool the VRAM to 48GB.
This would mean, and it has been confirmed by Domiek, that we need at least 2*48 = 96GB system RAM to fully utilize it.

Anyways, my main questions are for how much RAM is needed for the following scenarios outlined in my followup post:

  • Three 4090’s
  • Four 3090’s, with 2 pairs of NVLink

No.

1x 24GB card needs at least 36 or 48 GB RAM.
2x 24GB card needs at least 36 or 48 GB RAM.
3x 24GB card needs at least 36 or 48 GB RAM.
etc, etc…

GPU count is not important.

Great, I think we are in agreement, because that is what I said earlier.

I’m still unsure about my second question though. If I have two pairs of NVLink like this, how much RAM do I need?

3090 -----<|                 |
           | NVLINK bridge 1 |
3090 -----<|                 |



3090 -----<|                 |
           | NVLINK bridge 2 |
3090 -----<|                 |

It is a programming issue. If you want less fill and empty operation, you can collect all datas and after that send to VRAM.

For this reason, you can fill one VRAM (or linked VRAM), after that you can fill another VRAM (or linked VRAM). You can want fill simultaneous, but your databus most probably won’t be enough for this.

If we assuimg your databus is enough and you can fill simulteneous, then your requirement is at least:

(24 + 24) * 1.5 = 72 GB RAM.

Thank you so much, I understand now!

For my new PC, I am using four 4090’s. Each 4090 has 24GB VRAM. Based on our conversation, I think it should be ok to start out with 64GB system RAM?

My suggestion is use one GPU per a frame for render. So, with 4x GPU, you can render 4 frames at same time. I don’t know Cycles can do it, but you can get best performance with this.

In this way, you can work with 36 or 48 GB RAM.

And I don’t know Cycles how use system RAM. For this reason I can not give any accurate information. This informations are theoretical. A programmer can use system RAM and VRAM in endless ways.