Short answer: Ollama automatically splits a model across every GPU it can see, the moment that model doesn’t fit on one card, no manual configuration required. If it does fit on a single GPU, Ollama keeps it there for the best performance rather than spreading it unnecessarily. Multi-GPU only becomes something you actively manage when you want to limit which cards get used, force a spread for headroom, or plan hardware for a specific model. This guide covers the real environment variables, what NVLink actually matters for, and hardware combos for recent big local models.
Quick Navigation:
How Ollama Handles Multi-GPU Automatically
Ollama’s own documentation is explicit about the default behavior: “If the model will entirely fit on any single GPU, Ollama will load the model on that GPU. This typically provides the best performance as it reduces the amount of data transferring across the PCI bus during inference. If the model does not fit entirely on one GPU, then it will be spread across all the available GPUs.”
That’s a meaningfully different model from training. Our multi-GPU training setup docs cover DataParallel and DistributedDataParallel, both of which need explicit code changes and, ideally, identical GPUs. Ollama’s inference splitting is automatic and works with whatever’s installed, because it’s solving a different problem: fitting one model’s layers into available memory, not synchronizing gradients across replicas.
What Actually Happens
Environment Variables That Control It
You don’t need any of these to get basic multi-GPU splitting working, but they matter once you’re running more than one model, sharing the box with a display GPU, or deliberately forcing a spread.
| Variable | What It Does |
|---|---|
| CUDA_VISIBLE_DEVICES | Limit Ollama to a subset of NVIDIA GPUs by comma-separated index (e.g. reserve GPU 0 for a display) |
| ROCR_VISIBLE_DEVICES / HIP_VISIBLE_DEVICES | Same idea, for AMD GPUs |
| GGML_VK_VISIBLE_DEVICES | Same idea, for the Vulkan backend |
| OLLAMA_SCHED_SPREAD | Forces a model across all GPUs even if it would fit on one, useful to keep VRAM headroom free on any single card |
| OLLAMA_NUM_PARALLEL | Max parallel requests per model (default 1). Raising it multiplies context memory use, worth knowing before you add more GPUs expecting more concurrent capacity |
| OLLAMA_MAX_LOADED_MODELS | Maximum models loaded per GPU at once, relevant if you’re running several smaller models across a multi-GPU box rather than one large model |
Key insight: most multi-GPU Ollama setups need zero configuration. These variables exist for the edge cases: reserving a card for something else, deliberately spreading a model that would otherwise fit on one GPU, or running several models across several cards at once.
Do You Need NVLink?
No, and this is worth stating plainly because it’s the most common assumption carried over from training setups. Our multi-GPU training guide recommends NVLink where available because training synchronizes gradients across every GPU on every step, and that constant cross-GPU traffic benefits enormously from NVLink’s 10x-plus bandwidth over PCIe.
Inference through Ollama doesn’t work that way. A prompt’s forward pass moves through the model’s layers sequentially: the first group of layers runs on GPU 0, hands its output to GPU 1 for the next group, and so on. That’s a fraction of the data volume and frequency of gradient synchronization. Standard PCIe x8 or x16 is enough; a Gen 4 x8 link and a Gen 3 x16 link both land around 16 GB/s, and either is adequate here.
Can You Mix Different GPUs?
Yes, with a caveat. Ollama’s splitting is based on each GPU’s available memory, not a fixed even divide, so a 24GB card and a 12GB card both get used, just unevenly. That’s a real practical advantage over training, where mismatched GPUs bottleneck the whole job to the slowest card.
The caveat: total usable VRAM is what matters for fitting a model, but the slower or older card in the pair still becomes a throughput bottleneck for whichever layers land on it. Mixing a 4090 with an older 1080 Ti works for loading a bigger model than either card could hold alone, but expect the 1080 Ti’s layers to set the pace for token generation.
Real Hardware Combos for Big Local Models
These are the memory floors from our own hardware guides, mapped to realistic multi-GPU combos.
| Model | Smallest Usable Quant | Multi-GPU Combo |
|---|---|---|
| Qwen3.8-27B (8-bit, near-lossless) | ~30 GB | 2x 16GB GPUs, or one 32GB card alone |
| DeepSeek V4 Flash (1-bit) | ~82.5 GB | 4x 24GB GPUs, or 2x 48GB cards |
| GLM-5.2 (2-bit) | 223 GB+ | 4x 80GB datacenter GPUs |
Full quantization tables and single-GPU options for each model: Qwen3.8-27B, DeepSeek V4 Flash, GLM-5.2.
Pro tip: before buying a second or third GPU, check whether the model you actually want fits on one card at a lower quant first. Qwen3.8-27B fits a single 24GB GPU at 4-bit. Multi-GPU is for the models that genuinely need it, not a default upgrade path.
Common Pitfalls
GPU not detected
Check nvidia-smi -L lists every card, and that CUDA_VISIBLE_DEVICES isn’t accidentally set from a previous session, limiting Ollama to fewer GPUs than you have installed.
Uneven VRAM usage looks wrong but isn’t
With mismatched GPUs, memory allocation across cards won’t be 50/50. That’s expected: Ollama fits layers to available memory per GPU, not to an even split.
Model spreads when you didn’t want it to
If a model that should fit on one GPU is spreading across several, check whether OLLAMA_SCHED_SPREAD got set globally by a previous config and is forcing the spread unnecessarily.
FAQ
Does Ollama automatically use multiple GPUs?
Yes. Ollama’s own documentation states that if a model fits entirely on one GPU, it loads there for best performance. If it doesn’t fit on any single GPU, Ollama automatically spreads it across all available GPUs. There’s no manual tensor-split flag to configure for basic use.
Do I need NVLink for multi-GPU Ollama?
No. That’s a training requirement, not an inference one. Ollama (via its llama.cpp backend) splits a model’s layers sequentially across GPUs; each token’s forward pass moves through one GPU’s layers, then the next, over standard PCIe. NVLink matters for training, where gradients sync constantly across every GPU. It doesn’t meaningfully speed up Ollama inference.
Can I mix different GPU models or VRAM sizes with Ollama?
Yes, and this is a real advantage over training setups, which need identical GPUs to avoid being bottlenecked by the slowest card. Ollama’s automatic splitting allocates layers based on each GPU’s available memory, so a 24GB card paired with a 12GB card still works, just with an uneven split rather than a clean 50/50.
How do I limit Ollama to specific GPUs?
Set CUDA_VISIBLE_DEVICES to a comma-separated list of GPU indices for NVIDIA cards (ROCR_VISIBLE_DEVICES for AMD, GGML_VK_VISIBLE_DEVICES for Vulkan). This is useful if you have a GPU you want reserved for a display or another workload.
How much combined VRAM do I need to run a 300B-class model like GLM-5.2 or DeepSeek V4 Flash?
It depends on the quantization level. DeepSeek V4 Flash’s smallest usable quant needs about 82.5GB combined, achievable with 4x 24GB GPUs or 2x 48GB cards. GLM-5.2 needs 223GB+ even at its smallest quant, realistically 4x 80GB datacenter GPUs or a very large system RAM offload setup. See our hardware guides for each model’s full quantization table.
Related Reading
DeepSeek V4 Flash Hardware Guide
A model that needs multi-GPU even at 1-bit
GLM-5.2 Hardware Guide
The 744B model that needs 4x 80GB GPUs
Qwen3.8-27B Hardware Guide
Check if a single GPU is enough before going multi
RAM for Local LLMs
The CPU-offload alternative to buying more GPUs
Best Motherboard for an AI Workstation
The PCIe lanes that make 4 full-bandwidth GPU slots possible
Planning a Multi-GPU Build?
Need a workstation that can physically fit and power multiple GPUs? Check our Tailored Builds page.
