r/invokeai • u/Misophoniq • Jun 03 '26
Exactly WHAT is GPU memory important/needed for?
TLDR version; just skip to the very last line. 😉
Please forgive my noobism, but I only started to play with local generative AI a little over two weeks ago. I have a pretty outdated gaming PC that came with an AMD GPU, that I quickly swapped out for two old Nvidia Quadro RTX 4000 GPUs when I discovered how poorly AMD is supported by most programs and even the AMD dedicated program "Amuse" refused to function. I know these Nvidia GPUs are outdated too, but I am on a tight budget right now and these were reasonably priced and small form-factor (so I could fit 2 of them in my system).
Anyhow, after a bit of setup I managed to get Windows to use one GPU "for itself" and keep the other one reserved for Invoke. I made sure to only use models that were under 8 GB in size and had a lot of fun experimenting with most of them. Then I accidentally downloaded Qwen and only found out it was a whopping 58 GB when it finished downloading when I returned to my system.
Just for "fun", I wanted to see how fast my system would give up when I even TRIED to generate an image with this model, but to my big surprise it just kept going... well, by "just kept going" I mean it took a painfully slow 30 minutes to come up with a 640 x 640 image, but at least it DID!
So, did I completely misunderstand? Is GPU memory NOT needed to hold the model itself? Is it only for the resulting image? I noticed before that some models that give up on 1024 x 1024 images would still give me a 512 x 512 one. Is THAT what the memory is for, for the image itself?
I am pretty confused right now, but also a bit excited. To be totally honest, I am just fascinated by this whole generative AI stuff itself, I don't really mind the time it takes. Heck, one of the first images I made was even before I had the GPUs and it LITERALLY took 10 hours to complete! Started to generate it a 8 pm and it finished 6 am the next morning!
So, again, I know I am a total noob at this, but exactly WHAT is GPU memory important for?
3
u/jimmcfartypants Jun 03 '26
Iirc it will use gpu memory (very fast) then offload to system memory (much slower) and eventually system swap (horrendously slow) before it gives up.
So your 30min qwen image would be significantly faster to render with more vram is the main take away, but you must have significant ram for the rest of the model to load into which may be why it didnt shit the bed and say OOM
3
u/mwonch Jun 03 '26
Since you are new to this, please allow me to make a suggestion. Try Zimage_Turbo. It's less memory intensive and generates good quality. Default setting are 9 Steps, 1 CFG. Those work just fine. Very fast.
Invoke also allows you to adjust the files for Low VRAM. I have only an 8GB GPU, so I did this. I have zero issues.
Additionally, the size of a model really has nothing to do with how your system uses it. It's the TYPE of model that matters more. QWEN is different from SDXL or Zimage, for example. Room on your hard drive is more of a concern with large models. I suggest using an external hard drive to hold the models. Otherwise, you may have to delete some to make room for others. If you don't need or want those anymore, no issues. If you do still use them, it's painful.
Once you get into this more, you may find you use more than one model for the same project. Generate with one, edit with another. The editing models are HUGE...and GPU intensive. But, if you can use them you may need more room on the drive. Different models do different things. I will assume, probably correctly, that most people are like me: we have many models of different types. For me, I find the ones that do my bidding and only delete them when a better version is found.
2
u/Masha-AI Jul 01 '26
You didn’t totally misunderstand :) GPU memory is mainly for holding the active model parts, text encoder/VAE, and the temporary tensors created during generation. If it doesn’t fit, Invoke can offload parts to system RAM/CPU, which is why Qwen still worked but took 30 minutes. Higher resolution needs more VRAM because the intermediate image data gets much larger. btw if you mind, check plz my InvokeAI tutorials on yt channel Masha-AI-Lab <3 I think i will have to make a lesson abt text encoder/VAE, VRAM/RAM, CPU/GPU for image generation :)
2
u/Upstairs-Extension-9 Jun 03 '26
It should not take 30 minutes on a RTX 4000 it sounds like your CPU is doing the inference work. It should take a couple seconds for 1024x1024 on SDXL, something in your settings is not working properly. Update your drivers and make sure Invoke is using your GPU.
2
u/ziege159 Jun 03 '26
as a noob i also want to know what you asked too, hope someone can explain the technically details in simple terms that 5yo can understand.
And from my own experience, a model size and gpu dedicated memory affect the generation speed a lot, for example i'm using 6700xt with 12GB vram, gen a 832x1216 image at 30 steps txt2img then 15 steps hires-fix then 2 detailers with 15 steps each, total 75 steps will cost me about 92 seconds, Vram consumption is 10/12GB fullload, nothing offload to ram. But if i pump up the resolution to like 1664x2432 (2x) with the same workflow, Vram consumption will be 14GB which is over the 12GB vram of my 6700xt then offload will happen, it will take 24.5 minutes to complete the prompt, 16 times slower. Theoretically 1664x2432 is 4 times larger than 832x1216 so the time should only be 4 times slower but in fact it's 16 times slower because the process doesn't fix my Vram capacity anymore so speed drop off a cliff. That is why you need to know how to pick a correct model to run on your hardware, using too big model will run extremely slow if it doesn't straight up give you an Out_Of_Memory error
2
u/No-While1332 Jun 10 '26 edited Jun 10 '26
AMD Adrenalin Edition 26.6.1 (Including ROCm 7.2.1 and PyTourch) and TensorStack Amuse v3.5.1 make the generation of AI graphics easy.
It supports SD, SDXL, QWEN, Z-Image, Z-Image Turbo, FLUX-1, FLUX-2 and a list of other. I think you gave up too soon!
BTW- Amuse will advance to v4 in about a month. Stay tuned!
It also supports CUDE 12.8 & CUDA 13.0