New Tool Radar

Local AI

How to Split a Model Across Two GPUs in llama-server

Use llama-server --main-gpu and --tensor-split to run a large model on two GPUs.

Schematic illustration with three step boxes: Check both GPUs; Set the split; Verify the load.

A model that does not fit on one GPU can still run if its layers are split across two cards. llama-server takes –tensor-split to set the share each GPU carries and –main-gpu to pick which card holds the main part. This guide sets the split and checks that both GPUs carry their share.

Before you start

  • llama.cpp installed, with llama-server on your PATH.
  • Two NVIDIA GPUs visible to the system, and a GGUF model too large for one card, for example a 32B Q4_K_M file.
  • A terminal and the nvidia-smi command to check both cards.

Check both GPUs are visible

List the GPUs and their memory:

nvidia-smi

Note the index of each card and how much free memory each has. Both cards need free memory for their share of the model.

Start the server with a split

Split the model evenly across the two cards:

llama-server -m qwen3-32b-q4_k_m.gguf --main-gpu 0 --tensor-split 1,1 --port 8080

The two numbers in –tensor-split are the relative shares for GPU 0 and GPU 1. Use 2,1 if the first card has twice the memory of the second.

Verify both cards are working

While the server answers a prompt, run nvidia-smi in another terminal. Both cards should show memory used and GPU activity. If only one card is busy, the split did not take effect; check the flag spelling and the server log.

Worked example

Worked example: with a 32B Q4_K_M model and two 16 GB cards, use –tensor-split 1,1. Each card should show about half the model in memory, and a prompt such as “Summarise this paragraph in one sentence.” should answer at a speed between one card alone and two cards fully used.

Expected result

UNTESTED in this guide: no server was run while writing it. The expected result is that llama-server starts, both GPUs show memory used, and the model answers prompts.

Limitations

Splitting adds communication between the cards, so two cards are not twice as fast as one. If the model fits on one card with room to spare, run it there instead.

Sources

See all