New Tool Radar

Local Model Setup

How to Split a llama.cpp Model Across Two GPUs

Split a model across two GPUs with --split-mode and --tensor-split so a model too big for one card still runs.

Schematic diagram with four steps: confirm both GPUs are visible, set the split mode and tensor fractions, load the model across both cards, then measure tokens per second.

One GPU’s memory is a hard ceiling: a model bigger than it cannot load. llama.cpp can split a model across several GPUs, and the split mode decides how — by layers, by rows, or by tensors — with a tensor-split list saying how much of the model each GPU takes.

Set the split mode and the per-GPU fractions

Start the server with --split-mode layer (the default: layers and KV split across GPUs, pipelined), --split-mode row (weights split by rows, parallelized), or --split-mode tensor (weights and KV split across GPUs, parallelized, experimental). Add --tensor-split 3,1 to give the first GPU three parts and the second one part, and --main-gpu 0 to pick which GPU holds the intermediate results. Set -ngl all so every layer offloads to the GPUs.

llama-server -m model.gguf -c 4096 -ngl all \
  --split-mode layer --tensor-split 3,1 --main-gpu 0

The split only helps if the GPUs can talk fast enough: a slow link between them eats the gain, and the tensor mode is experimental. Start with the layer split — it is the default for a reason — and measure tokens per second before trying the row or tensor modes.

Try it: four checks

Check What you should see If you do not see it
Two GPUs seen The server lists both devices Check the drivers and –list-devices
Model loads The split model loads across both GPUs Check the memory on each card
Split mode set The chosen –split-mode is in the command Layer is the default
Speed sane Tokens per second beat a single GPU Measure before switching modes

Expected result. We checked the llama.cpp server README, which defines –split-mode (none, layer, row, tensor), –tensor-split fractions, –main-gpu and -ngl. We did not run a multi-GPU server on this machine.

Limits

This guide covers the split flags only. The link speed between GPUs and the experimental tensor mode can change the result. We did not test any split ourselves.

Sources

See all