# How do I build a multi-GPU rig?

> Size the power supply and the circuit first, then lanes, spacing and cooling. Mixed cards work for layer split but slow everything to the weakest card.

Plan the power first. Several graphics cards in one tower can draw more than a wall socket safely supplies. Then plan the lanes, the spacing and the airflow, in that order.

A second card gives you more VRAM. It does not make a model that already fits much faster for one user. Build a rig when the model you want does not fit on one card. [How do several GPUs in one box work together?](https://localagi.co/multi-gpu) covers how runtimes split a model across cards.

## Power supply and circuits

Add up the board power of every card, then add the rest of the system. Then add headroom, because GPUs spike above their rating for milliseconds at a time.

| Card | Board power |
| --- | --- |
| RTX 3090 | 350 W |
| RTX 4090 | 450 W |
| RTX 5090 | 575 W |

```text
PSU size = (sum of GPU board power + CPU power + about 100 W for the rest) × 1.25

Two RTX 3090s and a 150 W CPU:
(350 + 350 + 150 + 100) × 1.25 = about 1,190 W  → buy a 1,200 W or larger PSU
```

**Rule of thumb.** 
Size the power supply at about one and a quarter times the total board power. Then check that the wall circuit can carry it.

The circuit is the hard limit.

A standard North American 15 A circuit at 120 V carries 1,800 W, and continuous loads should stay under 80 % of that, about 1,440 W. A European 16 A circuit at 230 V carries about 3,680 W. Anything else on the same circuit, such as a monitor or a heater, comes out of the same budget.

Power-limit the cards. Inference is limited by memory bandwidth more than clocks, so a card capped well below its rating loses little speed and runs much cooler.

```bash
sudo nvidia-smi -pl 280
```

This caps every NVIDIA card at 280 W until the next reboot. Add `-i 0` to pick one card. Run your own prompts before and after to see what it costs you.

**The catch.** 
Use one cable per power connector, never a split daisy-chain. High-power cards pull a lot of current through each plug. Seat every connector fully, especially the 16-pin connectors on recent cards.

## PCIe lanes, risers and spacing

A consumer desktop CPU has about 20 to 24 lanes for slots and storage. That is enough for one card at x16 or two at x8. Workstation and server platforms such as Threadripper and EPYC have 64 to 128 lanes, enough for four or more cards at full width.

For inference, lane count matters less than you might expect. When the model is split by layers, only small activations cross between cards, and x4 is usually enough. Lanes matter more for tensor parallelism, which exchanges data between cards on every layer, and for loading the model at startup.

**Layer split.** 
Each card holds a block of layers, with little traffic between cards. Works over x4 lanes and mixed cards. Speed for one user is about that of a single card.

**Tensor parallel.** 
Each layer is split across all cards, with heavy traffic between them. Wants x8 or x16 and matched cards. Faster for one user and for serving many.

Most consumer cards are three slots or thicker, and boards rarely space slots for two of them. Risers solve this by moving the card away from the board, into an open frame or a second mounting bracket.

Buy shielded risers rated for your PCIe generation. A cheap riser causes crashes that look like driver bugs.

If cards are unstable on a riser, set the slot to a lower PCIe generation in the BIOS. You lose little for inference.

## Cooling and noise

Two open-air cards stacked next to each other blow hot air into each other. The top card runs hot and throttles. Leave at least one empty slot between them, or use risers to separate them.

Blower-style cards push air out the back of the case and stack better, at the cost of noise. Open frames cool best and look like a mining rig, because that is what they are.

Either way, this machine is loud under load. Put it in another room if you can, and reach it over the network as [How do I share one model with my household or office?](https://localagi.co/sharing-a-model) describes.

Power limits help here too. A card capped at about three quarters of its rating runs much cooler and quieter with a small loss of speed.

## Mixed cards

Mixed cards work for layer split. [llama.cpp](https://localagi.co/llama-cpp) and the apps built on it can spread a model over cards of different sizes and generations. You set how much goes on each.

```bash
llama-server -m model.gguf -ngl 99 --tensor-split 24,12
```

This puts about two thirds of the layers on the first card and one third on the second, in proportion to a 24 GB and a 12 GB card. To hide a card from the runtime, set `CUDA_VISIBLE_DEVICES` to the card numbers you want.

The catch is speed. Each token passes through every card in turn, so the slow card's share of layers costs more time than the fast card's.

Keep the fastest card for the largest share. Tensor parallel engines such as [vLLM](https://localagi.co/vllm-and-sglang) expect matched cards, and two identical cards is the simple path.

Mixing vendors in one process is possible with some backends and fiddly with all of them. We would not plan a build around it.

## Go deeper

### Why one big card can beat two small ones

Two 24 GB cards hold 48 GB. One 48 GB or 96 GB card holds it with no split, no extra power connectors and one slot. The single card costs more, but the build is simpler and uses less power. [Which NVIDIA card should I get?](https://localagi.co/nvidia-gpus) covers the pro cards.

### NVLink

The RTX 3090 was the last consumer card with an NVLink connector. A bridge speeds up traffic between a pair of 3090s for tensor parallel work.

For layer split it makes little difference. Later consumer cards talk over PCIe only. [Which cable do I need between machines?](https://localagi.co/interconnects) covers the options between machines.

### Checking every card is used

Run `nvidia-smi` while the model is writing. Every card should show memory in use and some utilisation. If one sits idle, the runtime did not see it. [Why is my GPU not being used?](https://localagi.co/gpu-not-used) covers the fixes.

### When to stop adding cards

Past four cards on a consumer platform, lanes, power and cooling all get hard at once. At that point a workstation board, a server chassis or a second machine is easier. [When should I not cluster?](https://localagi.co/when-not-to-cluster) and [What are the ways to split work across machines?](https://localagi.co/three-ways-to-cluster) cover the alternatives.
