Does Ollama Use GPU? Yes, Here's How It Works
In this article
Yes, Ollama uses the GPU by default when a compatible graphics card is available, automatically offloading model layers to it for much faster inference. On machines without a supported GPU, or when the GPU lacks enough memory, Ollama falls back to CPU-only execution, which works but is significantly slower. The rest of this article explains which GPUs are supported, how the offloading works, how to check what Ollama is actually using, and how to troubleshoot common problems.
What Ollama Is and Why GPU Support Matters
Ollama is a free, open-source tool for running large language models (LLMs) locally on your own computer. You download it, pull a model such as Llama, Mistral, Gemma, or Phi, and chat with it through a terminal or the built-in API. Unlike cloud chatbots, everything runs on your hardware, so privacy is a major draw.
LLMs are compute-heavy. A model with billions of parameters performs enormous numbers of matrix multiplications for every token it generates. CPUs can do this, but they process a few cores at a time, while a GPU has thousands of small cores designed for parallel math. The practical result: a model that feels snappy on a mid-range GPU can feel painfully slow on a CPU. GPU support is therefore not a nice-to-have for Ollama users; it is the difference between a usable assistant and a waiting game.
Ollama handles GPU acceleration automatically. You do not need to pass special flags or edit configuration files in most cases. When you run a model, Ollama inspects your hardware, decides how many layers it can fit into GPU memory, and runs the rest on the CPU if necessary. This partial offloading is why even a modest GPU can improve performance without fitting the entire model.
Which GPUs Ollama Supports
Ollama's GPU support depends on the platform and the acceleration library it ships with. The main categories are:
- NVIDIA GPUs — supported on Windows and Linux through CUDA. This is the most common and best-tested path. Compute capability 5.0 or higher is generally required, which covers most GTX 10-series and newer cards.
- AMD GPUs — supported on Linux through ROCm for a list of compatible cards, and on Windows through ROCm or Vulkan depending on the build. Support is narrower than NVIDIA's and varies by model.
- Apple Silicon — Macs with M-series chips use Metal and unified memory, so the GPU and CPU share the same RAM. Ollama uses the GPU by default on these machines.
- Intel GPUs — some Intel Arc and integrated GPUs are supported through oneAPI or Vulkan on certain builds, but this is the least mature path.
If your GPU is not on a supported list, Ollama will still run, but on the CPU. That is not a failure; it is the designed fallback. Note that driver and runtime versions matter. An outdated NVIDIA driver or a missing ROCm installation can silently push Ollama back to CPU mode.
How Ollama Decides What Runs on the GPU
When you start a model, Ollama reads the model's metadata, including its size and quantization, and compares it with available VRAM. It then chooses a number of layers to offload. The goal is to fill GPU memory without overflowing it, because an overflow causes errors or forces everything back to the CPU.
This is why the same model can behave differently on two machines. A 7B model quantized to 4 bits might need roughly 4–5 GB of VRAM to run fully on the GPU. An 8 GB card can hold it comfortably. A 13B model at the same quantization might need 8–9 GB, so an 8 GB card will offload only part of it and leave the rest on the CPU. Larger models and higher-precision quantizations need more memory still.
Unified-memory systems such as Apple Silicon change the math. Because the GPU can address system RAM, the limit becomes total memory rather than dedicated VRAM, though performance still depends on memory bandwidth. On a Mac with 16 GB or more, Ollama can often run mid-sized models entirely on the GPU.
How to Check Whether Ollama Is Using Your GPU
You do not have to guess. Ollama prints hardware information when it loads a model. The reliable ways to check are:
- Run a model from the terminal with
ollama run <model>. Watch the startup output for lines mentioning GPU layers or the compute device. - Use
ollama pswhile a model is loaded. The output includes a processor column that indicates whether the model is running on GPU or CPU. - Check the server log. On desktop, Ollama writes logs you can inspect; look for messages about detected GPUs and offloaded layers.
- Use your GPU vendor's monitoring tool — NVIDIA's system monitor or AMD's equivalent — and watch VRAM usage while generating text. A jump in VRAM confirms GPU use.
If the output says CPU only, the next section covers the usual causes. Menu labels and log wording can differ slightly between versions and operating systems, so treat exact strings as a guide rather than a guarantee.
Common Problems and Fixes
Most GPU issues with Ollama fall into a few categories. Work through them in order, simplest first:
- Outdated GPU driver. Update to the latest driver from NVIDIA, AMD, or Intel. This is the single most common cause of CPU fallback.
- Missing runtime. On Linux with AMD, ROCm must be installed and your user must have permission to access the GPU device. On Windows, ensure the correct Ollama build for your GPU vendor is installed.
- Not enough VRAM. If the model is too large, Ollama offloads fewer layers. Try a smaller model or a more aggressive quantization. Closing other GPU-heavy apps such as games or browsers can free memory.
- Laptop dual-GPU setups. Some laptops route work through integrated graphics by default. Check your system's graphics settings and, where available, force Ollama to use the discrete GPU.
- Virtual machines and containers. GPU passthrough must be configured. Without it, the guest sees no GPU and Ollama runs on CPU.
After any change, restart Ollama and re-check with ollama ps. If the model still shows CPU, confirm the GPU is visible to the operating system at all before troubleshooting Ollama itself.
GPU vs CPU: What to Expect in Practice
The performance gap is large but not uniform. Token generation speed depends on memory bandwidth and compute, and prompt processing (reading your input) is especially compute-bound. On a supported GPU, a small model can generate text faster than you can read it. On a CPU, the same model may produce a few tokens per second, which feels sluggish for chat but is tolerable for batch jobs.
Partial offloading sits in between. If half the layers run on the GPU, you get a meaningful speedup over pure CPU, but not the full benefit. This is why matching model size to VRAM matters more than buying the fastest card: a mid-range GPU with enough memory for your chosen model often beats a high-end card that is constantly swapping layers.
A common misconception is that Ollama requires a data-center GPU. It does not. Consumer cards and Apple Silicon Macs are the primary targets, and the tool is designed to degrade gracefully rather than refuse to run.
Frequently Asked Questions
Does Ollama use the GPU automatically?
Yes. If a supported GPU is detected and has enough memory, Ollama offloads layers to it without extra configuration. If not, it falls back to the CPU.
Can I force Ollama to use only the CPU?
Yes. Ollama supports an environment variable that limits GPU usage, which is useful for testing or for reserving the GPU for other work. The exact variable name is documented in Ollama's official documentation and can change between versions, so check there before relying on it.
Why is Ollama using my CPU when I have a GPU?
The usual causes are an outdated driver, an unsupported GPU model, insufficient VRAM for the selected model, or a missing runtime such as ROCm on Linux. Check the startup logs and ollama ps to confirm, then update drivers first.
Does Ollama work on Macs with Apple Silicon?
Yes. On M-series Macs, Ollama uses the GPU through Metal and can address unified memory, so mid-sized models often run entirely on the GPU.
How much VRAM do I need?
It depends on the model size and quantization. As a rough guide, a 7B model at 4-bit quantization needs around 4–5 GB, while larger models scale up. If VRAM is short, Ollama offloads fewer layers and performance drops.
Does a better GPU always mean faster responses?
Not always. Memory capacity and bandwidth matter as much as raw compute, because the goal is to fit the model in VRAM. A card with more memory can outperform a faster card that cannot hold the model.