r/ollama • • 1d ago

Multiple gpu setup?

I have an rtx3060 and a rx580 right now (obviously not ideal to combine), but I want to use them for the vram headroom. Both are acknowledged in kernel (linux) and reachable through geekbench, but the rtx 3060 is the primary (as intended).

I want tk know how to go about using them in unison. I recently tested qwen3-coder:30b, and 18gb model which should ideally fit on the 12gb+8gb overall vram of the 2 gpus. However, my btop did not indicate any actuation or usage from the rx580 when running a prompt, as well as no vram utilization compared to the 11gb (pretty sure its rounded down) from the 3060

2 Upvotes

10 comments sorted by

2

u/bvswcaveman 1d ago

The Nvidia and AMD split likely won’t work together. You can try “OLLAMA_SCHED_SPREAD=1” but I wouldn’t hold out hope

1

u/Ornery-Building259 1d ago

So do you think 2 nvidia cards would work, say an rtx 1080 with the 3060? Specifically cases when they are from different generations

1

u/mgithens1 17h ago

Went down this rabbit hold 6 months back... the issue will be the bandwidth between the cards is so slow that performance will suck. Like 5-10 tokens/second suck.

You need room for model AND context. So you can't fit an 18gb model in 20gb of vram. You would need to fit more like 14gb models and let the context take up the rest. You also have to leave room for your OS's GUI... Windows will eat over 1gb.

Look into MoE and ditch the second card. It sounds counter intuitive when you start, but on my 5060ti, I get over 50tokens/second. The idea is you fit all the context into VRAM, and then as many "layers" as you can ... then the rest of the layers go into RAM. Qwen3.6 (4 dropped today, but it might not be ideal... need to test!!) or Gemma4 both offer MoE models.

1

u/Ornery-Building259 17h ago

Do you think the issue would persist of tokenization constriction if the cards are identical. Like a 12gb rtx 3060 and a 8gb one?

1

u/mgithens1 16h ago

You will never overcome the bandwidth limit. A modern card has VRAM speeds in the 500GB to 1TB/second.

Your mobo is going to be less than 100GB/second. Every token on a dense model has to use every node... so the issue compounds. Mixing two 5090s would still suck on your motherboard... it is 100% a PCIe bandwidth limitation.

1

u/bvswcaveman 1d ago

That might be more likely to work. I haven’t tried mixing my 3070 though in with my 1080ti system.

Btw, you’d be pushing it with a 20gb model regardless. You want 3-8gb for kv cache, context and a bit of headroom

2

u/AdSome6934 1d ago

Mixing backends is the real blocker, but even if you get it working the split won't do what you want. The rx580's 8G has to hold whole layers, and a 30B model at 18G means the 3060 side is already tight. The slower card also sets the pace for every token, so you'd get 12G of usable speed dragged down by the 580.

Better to treat them as two separate workers. Run the 30B on the 3060 alone at a quant that fits, and keep the 580 for something small and parallel like embeddings or a 3B. Route by task size instead of splitting one model. On my own pile of mismatched cards that beats one model spread thin every time.

1

u/MindPsychological140 1d ago

ollama uses cuda for the nvidia card and the rx580 needs a different backend so they cant share one model. llama.cpp with the vulkan build can use both cards together i think. rx580 is slow tho so maybe small gain

1

u/Future_AGI 22h ago

what does ollama ps show with the model loaded? If the PROCESSOR column shows a CPU/GPU split, part of the model already sits in system RAM, and that sets your speed more than the second card does.