Guideschevron_rightServers

Servers · 8 min read · Updated

How to Run an LLM on Multiple GPUs

To run one LLM across several GPUs, start vLLM with --tensor-parallel-size 2 (or however many cards you have), or run llama.cpp or Ollama, which spread a model over all visible cards on their own when it does not fit on one. On cards without NVLink, vLLM's documentation recommends --pipeline-parallel-size 2 instead. If the model fits on a single GPU, do not split it: run a second copy on the other card to serve more users.

Tensor Parallel vs Pipeline Parallel

Ways to use several GPUs for a language model
MethodHow it splitsBest forvLLMllama.cpp
Tensor parallelEvery layer is cut across all the cardsFast answers; cards linked by NVLink--tensor-parallel-size N--split-mode tensor (experimental)
Pipeline parallelEach card holds a run of layersCards linked only by PCIe; uneven counts--pipeline-parallel-size N--split-mode layer (default)
Separate copiesA full model on each cardMany users, when the model fits on one cardOne server per GPUOne server per GPU

Tensor parallelism makes the cards exchange data several times per layer, so a slow link holds it back; pipeline parallelism passes data only between stages. Sources: vLLM parallelism and scaling and llama.cpp multi-GPU guide.

Our Multi-GPU Servers

Multi-GPU servers and what they run
PlanGPUTotal GPU memorySystem memoryRunsPrice
AMD EPYC 7702 w/ 4x NVIDIA RTX 30904× NVIDIA RTX 3090 · 24 GB each96 GB128 GBAbout 120B at 4-bit; vLLM, llama.cpp or Ollama$929.00/mo
AMD EPYC 7443P w/ 4x NVIDIA V100 16GB4× NVIDIA V100 · 16 GB each64 GB128 GBAbout 70B at 4-bit; llama.cpp or Ollama$1,059.00/mo
AMD EPYC 7443P w/ 4x NVIDIA V100 32GB4× NVIDIA V100 · 32 GB each128 GB128 GBAbout 120B at 4-bit; llama.cpp or Ollama$1,059.00/mo
AMD EPYC 7443P w/ 4x NVIDIA V1004× NVIDIA V100—256 GBllama.cpp or Ollama$1,189.00/mo
Intel Dual Xeon Platinum 8260 w/ 8x NVIDIA V1008× NVIDIA V100 · 32 GB each256 GB1 TBAbout 120B at 4-bit; llama.cpp or Ollama$1,319.00/mo
AMD EPYC 9B14 w/ 2x NVIDIA RTX 50902× NVIDIA RTX 5090 · 32 GB each64 GB384 GBAbout 70B at 4-bit; vLLM, llama.cpp or Ollama$2,639.00/mo
AMD EPYC 9254 w/ 4x NVIDIA RTX 50904× NVIDIA RTX 5090 · 32 GB each128 GB384 GBAbout 120B at 4-bit; vLLM, llama.cpp or Ollama$3,819.00/mo

vLLM needs an NVIDIA GPU of compute capability 7.5 or higher, and the V100 is 7.0, so use llama.cpp or Ollama on V100s. What fits at each precision is in how much VRAM an LLM needs.

1. Check the Cards and How They Are Linked

nvidia-smi                 # every card should be listed, with free memory
nvidia-smi topo -m         # NV# between two cards means NVLink; anything else is PCIe

A card missing? Start with installing the NVIDIA drivers.

2. vLLM Across Several GPUs

openssl rand -hex 24 > ~/.llm-key

# tensor parallel on 2 GPUs
vllm serve Qwen/Qwen3.8-27B-FP8 --tensor-parallel-size 2 \
  --host 127.0.0.1 --api-key "$(cat ~/.llm-key)"

# pipeline parallel on 2 GPUs, for cards without NVLink
vllm serve Qwen/Qwen3.8-27B-FP8 --pipeline-parallel-size 2 \
  --host 127.0.0.1 --api-key "$(cat ~/.llm-key)"

The two multiply: --tensor-parallel-size 4 --pipeline-parallel-size 2 uses eight cards. Try both on your own cards and keep the faster one; vLLM's own Qwen3.8 recipe runs tensor parallel on two RTX 5090s. When vLLM starts, look for these lines:

  • GPU KV cache size: how many tokens of conversation fit at once.
  • Maximum concurrency: about how many full-length requests run together. Too low? Add GPUs or lower --max-model-len.

In Docker, pass --gpus all and --ipc=host; the cards share data through shared memory.

3. llama.cpp Across Several GPUs

llama serve --list-devices                      # names such as CUDA0, CUDA1

# layers spread over every card (the default)
llama serve -hf ggml-org/Qwen3.8-27B-GGUF:Q8_0 --host 127.0.0.1 --port 8080

# three quarters on the first card, one quarter on the second
llama serve -hf ggml-org/Qwen3.8-27B-GGUF:Q8_0 --tensor-split 3,1 \
  --host 127.0.0.1 --port 8080

# only one card
llama serve -hf ggml-org/Qwen3.8-27B-GGUF:Q8_0 --device CUDA1 \
  --host 127.0.0.1 --port 8080

--split-mode tensor can answer faster but is experimental, does not support every model, needs an unquantized cache (-ctk f16 -ctv f16) and turns off automatic fitting, so set -c yourself. --split-mode row is deprecated.

4. Ollama Across Several GPUs

Nothing to set: Ollama puts a model on one GPU if it fits there, and otherwise spreads it across all of them. To limit which cards it uses, run sudo systemctl edit ollama.service and add:

[Service]
Environment="CUDA_VISIBLE_DEVICES=0,1"

Then sudo systemctl daemon-reload && sudo systemctl restart ollama, and check with ollama ps and nvidia-smi (Ollama GPU docs).

5. One Copy per GPU for More Users

When the model fits on one card, a copy on each serves more people than one split copy. Give each its own card and port, and balance between them with Caddy or LiteLLM:

CUDA_VISIBLE_DEVICES=0 vllm serve openai/gpt-oss-20b --port 8001 \
  --host 127.0.0.1 --api-key "$(cat ~/.llm-key)" &
CUDA_VISIBLE_DEVICES=1 vllm serve openai/gpt-oss-20b --port 8002 \
  --host 127.0.0.1 --api-key "$(cat ~/.llm-key)" &
llm.example.com {
    reverse_proxy 127.0.0.1:8001 127.0.0.1:8002
}

Common Multi-GPU Errors

Multi-GPU errors and their fixes
MessageMeaningFix
Total number of attention heads must be divisible by tensor parallel size (vLLM)The model's heads do not split evenly over that many cardsUse 2, 4 or 8, or tensor parallel 1 with --pipeline-parallel-size
SPLIT_MODE_TENSOR requires flash_attn to be enabled (llama.cpp)Tensor mode needs flash attentionAdd -fa on, or remove -fa off
LLAMA_SPLIT_MODE_TENSOR not implemented for architecture (llama.cpp)That model type cannot use tensor modeUse --split-mode layer
NCCL is unavailable, multi GPU performance will be suboptimal (llama.cpp)llama.cpp was built without NCCLInstall NCCL and rebuild, or accept the slower speed
CUDA out of memory on one card onlyUneven split, or another program on that cardChange --tensor-split, or free the card

For memory errors in general, see fixing CUDA out of memory. Deciding between one large card and several smaller ones? See the best GPU for running LLMs.

NVIDIA, NVLink, GeForce and RTX are trademarks of their respective owners. Virteche is not affiliated with or endorsed by them. Details about their products come from their public documentation as of the date at the top of this guide.

Common Questions

  • Does VRAM add up across GPUs?

    For fitting a model, nearly: vLLM, llama.cpp and Ollama can all spread one model's weights across cards. Each card also needs its own working memory, so two 32 GB cards hold somewhat less than one 64 GB card would.

  • Do I need NVLink to use several GPUs for an LLM?

    No. Cards without NVLink exchange data over PCIe, which works but is slower. vLLM's documentation suggests pipeline parallelism rather than tensor parallelism on GPUs without NVLink, for higher throughput and less communication.

  • Are two GPUs twice as fast as one?

    Not for one conversation. Splitting a model adds communication between the cards. If the model fits on one GPU, vLLM's and Ollama's documentation both prefer one; use the second card for a second copy of the model to serve more users.

  • Can I mix different GPUs?

    llama.cpp splits layers in proportion to each card's memory, or in a ratio you set with --tensor-split. Splitting evenly across unequal cards, as tensor parallelism does, is limited by the smallest one.

Plans and prices

GPU Servers

GPU servers with one or several cards, full root access, billed monthly.

See all plans
  • Intel Core Ultra 9 285K w/ NVIDIA Tesla P4

    NVIDIA Tesla P4 · 8 GB GPU

    24 Cores · 192 GB RAM · 2x 3.84TB NVMe Gen4

    Los Angeles, CA (LA1) · 50 TB transfer · 25 Gbps

    $589.00/mo

  • NVIDIA DGX Spark

    NVIDIA DGX Spark · 128 GB GPU

    20 Cores · 128 GB RAM · 4TB NVMe Gen4

    Ogden, UT (UT1) · 50 TB transfer · 10 Gbps

    $609.00/mo

    Sold out
  • AMD EPYC 7443P w/ NVIDIA RTX 3090

    NVIDIA RTX 3090 · 24 GB GPU

    24 Cores · 256 GB RAM · 3.84TB NVMe

    Ogden, UT (UT1) · 100 TB transfer · 10 Gbps

    $659.00/mo

  • AMD Ryzen 9 9950X w/ NVIDIA RTX 3050

    NVIDIA RTX 3050 · 6 GB GPU

    16 Cores · 192 GB RAM · 2x 2 TB NVMe

    Ashburn, VA (ASH1) · Dallas, TX (TX3) · New York, NY (NY2) · Charlotte, NC (NC1) · Bend, OR (OR1) · Unmetered transfer · 1 Gbps

    $699.00/mo

Keep Reading

All guides