Skip to content
,

Multi-GPU LLM Setup: How to Run Big Models on 2, 3 or 4 GPUs at Home

Two 24 GB GPUs can run a 70B model that no single consumer card can hold. A complete multi-GPU LLM setup guide: how splitting a model across GPUs works, tensor vs pipeline parallelism, configuring llama.cpp, Ollama and vLLM, PCIe lanes, NVLink, mixing different GPUs, power supplies, cooling and realistic performance expectations.

6 min read

Multi-GPU Local LLM Setup — multi-gpu llm setup

Short answer

A multi-GPU LLM setup lets you combine the VRAM of several graphics cards to run models too large for one GPU. Two 24 GB cards (for example 2 × RTX 3090) give 48 GB, enough for a 70B model at 4-bit. Tools split the model in two main ways: layer splitting (pipeline style), used by default in llama.cpp and Ollama, which is simple and works with mixed GPUs; and tensor parallelism, used by vLLM, which splits each layer across GPUs for higher speed but needs matched GPUs and benefits from fast interconnects. RTX 40 and 50 series cards have no NVLink, so GPUs communicate over PCIe. Plan for power (a 1,200–1,600 W PSU for two high-end cards), physical space and cooling.

Why use multiple GPUs?

  • More memory: the main reason. VRAM adds up across cards for holding model weights and KV cache.
  • More speed: with tensor parallelism, multiple GPUs can generate tokens faster than one.
  • More users: serve several people at once.

Multiple GPUs do not combine into one big GPU automatically; software must split the model.

How models are split across GPUs

MethodHow it worksSpeedRequirementsUsed by
Layer split (pipeline style)GPU 1 holds the first layers, GPU 2 the rest; data passes between them once per tokenRoughly the speed of one GPU (GPUs take turns)Works with mixed GPUs; low interconnect needsllama.cpp, Ollama, LM Studio, ExLlama
Tensor parallelismEvery layer is split across all GPUs, which work simultaneouslyFaster, scales with GPU countMatching GPUs, ideally 2/4/8; more interconnect trafficvLLM, SGLang, TensorRT-LLM
Row split (llama.cpp)Splits matrices by rows across GPUsSometimes faster on fast interconnectsSimilar GPUsllama.cpp --split-mode row
Expert offload (MoE)Some experts on CPU RAM, rest on GPUDepends on RAM bandwidthLots of system RAMllama.cpp tensor overrides

For background, see parallelism in distributed training and NVLink explained.

BuildTotal VRAMWhat it runs (4-bit)Notes
2 × RTX 309048 GB70B dense models; ~100B MoE with offloadBest value; used cards; NVLink bridge supported
2 × RTX 409048 GB70B denseFaster compute; no NVLink; large cards
2 × RTX 509064 GB70B with long context; larger MoE575 W each; serious PSU required
4 × RTX 309096 GB~120B-class MoE, 70B at higher precisionNeeds workstation/server platform and risers
RTX 5090 + RTX 309056 GB70B dense with layer splitMixed cards work in llama.cpp
2 × RTX PRO 6000 Blackwell192 GBVery large MoE modelsWorkstation budget

Use our VRAM calculator to check fit, and see best open source LLMs to run locally.

Setting up the software

Ollama

Ollama detects multiple GPUs automatically and spreads a model's layers across them when it does not fit on one. You can restrict which GPUs it uses with:

CUDA_VISIBLE_DEVICES=0,1 ollama serve

llama.cpp

# Split layers across two GPUs in a 1:1 ratio, all layers on GPU
./llama-server -m model-70b-Q4_K_M.gguf -ngl 99 --tensor-split 1,1

# Uneven cards (e.g. 32 GB + 24 GB): split proportionally
./llama-server -m model.gguf -ngl 99 --tensor-split 32,24

# Try row split on similar GPUs
./llama-server -m model.gguf -ngl 99 --split-mode row

Key flags: -ngl (layers on GPU), --tensor-split (proportion per GPU), --split-mode layer|row, --main-gpu.

vLLM (tensor parallelism)

vllm serve <model-name> --tensor-parallel-size 2

vLLM requires the model to fit across the GPUs with room for its KV cache and works best with identical GPUs. It shines when serving multiple users thanks to continuous batching. See LLM inference engines compared.

ExLlamaV2/V3 and others

ExLlama-based tools (such as TabbyAPI) support splitting across GPUs with fast quantized formats, and LM Studio offers GPU allocation settings in its interface.

Hardware considerations

PCIe lanes and slots

PlatformTypical configuration with 2 GPUsImpact
Mainstream desktop (consumer Intel/AMD)x8/x8 or x16/x4Fine for layer split inference
HEDT/workstation (Threadripper, Xeon W)x16/x16 or more GPUs at full widthBetter for tensor parallelism and training
ServersMany full-width slots4–8 GPUs

For layer-split inference, PCIe bandwidth matters little once the model is loaded, because only small activations pass between GPUs per token. Tensor parallelism and training are much more sensitive. A slot wired at x4 through the chipset still works for inference but loads models more slowly.

NVLink

  • RTX 3090 supports an NVLink bridge between two cards, which can help tensor parallel performance.
  • RTX 4090 and RTX 50 series have no NVLink; communication goes over PCIe.
  • Data center GPUs (H100, B200) use NVLink and NVSwitch for very fast multi-GPU communication.

Power

SetupRated GPU powerRecommended PSU
2 × RTX 3090700 W1,200 W+
2 × RTX 4090900 W1,500 W+
2 × RTX 50901,150 W1,600 W+ (or two PSUs)
4 × RTX 30901,400 W2,000 W+ or dual PSUs, power limits

Tip: power-limit each GPU (for example nvidia-smi -pl 280 on a 3090). Inference speed usually drops only slightly, while total power and heat fall substantially. Check your household circuit capacity too. See GPU power consumption for AI.

Physical space and cooling

  • Modern high-end GPUs are 3–4 slots thick. Check motherboard slot spacing and case size.
  • Blower-style or water-cooled cards are easier to stack.
  • PCIe riser cables and open-frame cases are popular for 3–4 GPU rigs.
  • Leave space between cards; the top card in a stack often runs hottest.

System RAM and CPU

Have at least as much system RAM as total VRAM (more for MoE expert offload), and a CPU with enough PCIe lanes for your GPU count. See how to build an AI workstation.

Mixing different GPUs

  • llama.cpp / Ollama: mixing works well (for example a 5090 with a 3090). Speed is limited by the slower card for its share of layers.
  • vLLM tensor parallelism: use identical GPUs.
  • Mixing generations: use a driver and CUDA version that supports all cards.
  • Mixing NVIDIA and AMD: possible with some backends (for example Vulkan in llama.cpp) but more complex.

Realistic performance expectations

ConfigurationSingle-user generation (70B, 4-bit, rough guide)
2 × RTX 3090, layer splitTypically around 15–20 tokens/s
2 × RTX 4090, layer splitSimilar or slightly faster (memory-bandwidth bound)
2 × RTX 3090/4090, tensor parallelCan be noticeably faster than layer split
Partial CPU offloadOften under 5 tokens/s

Single-user token generation is limited by memory bandwidth; tensor parallelism helps because both GPUs read their half of the weights at the same time. Actual numbers vary with software, quantization and context length.

Multi-GPU vs alternatives

OptionProsCons
Multi-GPU consumer rigFast, flexible, upgradeablePower, heat, noise, complexity
Single large-VRAM workstation GPU (e.g. 96 GB)Simple, one cardExpensive
Mac with large unified memoryQuiet, efficient, huge memorySlower prompt processing; no CUDA
Cloud GPUsNo upfront cost, scale up instantlyOngoing cost; see the GPU cloud price tracker

Also see rent vs buy a GPU and best GPU for local LLMs.

Troubleshooting

ProblemLikely fix
Only one GPU usedCheck nvidia-smi, CUDA_VISIBLE_DEVICES and tool GPU settings
Out of memory on one GPUAdjust --tensor-split; the first GPU often needs extra room for buffers
Slow generationEnsure all layers are on GPU (-ngl 99); try row split or tensor parallelism
System shuts down under loadPSU overload; apply power limits or upgrade PSU
GPUs overheatingImprove spacing and airflow; use power limits

Frequently asked questions

Does adding a second GPU double speed?

Not with layer splitting, which mainly adds memory. Tensor parallelism can increase speed, but rarely by a full 2×.

Can I use two different GPUs for an LLM?

Yes, with llama.cpp, Ollama or LM Studio. vLLM tensor parallelism works best with identical GPUs.

Do I need NVLink for multi-GPU inference?

No. Layer-split inference works well over PCIe. NVLink helps tensor parallelism and training.

Is 2 × RTX 3090 still worth it?

For running 70B-class models on a budget, two used RTX 3090s remain one of the best-value options thanks to 48 GB total VRAM and NVLink support.

Sources and further reading

Think you understand it now? Prove it.

Solve real Tensor Core math in the TensorCore.si Challenge and earn a certificate with your name.

Take the challenge

Leave a Reply

Your email address will not be published. Required fields are marked *