How to Make Ollama Use Your GPU: Step-by-Step Guide
In this article
Ollama uses your GPU automatically when it detects a compatible one and the right drivers are installed. If it is running on CPU instead, the fix is almost always a driver, version, or environment-variable issue. This guide walks through checking what Ollama sees, installing the correct drivers, and forcing GPU use when automatic detection fails.
What You'll Need
- A computer with a supported GPU: NVIDIA (compute capability 5.0 or newer), AMD (ROCm-supported cards on Linux, or certain cards on Windows), or Apple Silicon (M-series) for Metal acceleration.
- Up-to-date GPU drivers from the manufacturer (NVIDIA, AMD, or Apple's built-in drivers).
- The latest Ollama installed from the official site (ollama.com).
- At least 8 GB of VRAM for small models (7B), 16 GB or more for larger ones. The model must fit in VRAM to run fully on GPU.
- A terminal or command prompt to run checks.
Step-by-Step
- Check whether Ollama already uses the GPU. Run
ollama psin a terminal. The output includes a PROCESSOR column. If it says 100% GPU, you are done. If it says 100% CPU or a split like 30/70 CPU/GPU, continue. - Confirm your GPU is detected by the system. On Windows, open Task Manager > Performance > GPU and check the card is listed. On Linux, run
lspci | grep -i vgaornvidia-smifor NVIDIA cards. On macOS, open System Information > Graphics/Displays. If the GPU is not listed, fix the driver or hardware connection first. - Update your GPU drivers. NVIDIA: download the latest Game Ready or Studio driver from nvidia.com. AMD: download the latest Adrenalin driver from amd.com. On macOS, update macOS itself since Apple Silicon GPU support is built in. Reboot after installing.
- Update Ollama. Download the newest installer from ollama.com and install it over the existing version. Older builds may lack support for newer GPUs or driver versions.
- Restart the Ollama service. On Windows, quit Ollama from the system tray and relaunch it. On macOS, quit the Ollama app and reopen it. On Linux, run
sudo systemctl restart ollamaif you installed it as a service. - Pull a model that fits your VRAM. A model larger than your VRAM will spill to CPU. For 8 GB VRAM, try a 7B model quantized to 4 bits (about 4–5 GB). For 16 GB, a 13B model. Run
ollama pull llama3(or another model) and thenollama run llama3. - Check GPU usage again. With the model loaded, run
ollama psin another terminal. The PROCESSOR column should now show GPU. You can also watchnvidia-smi(NVIDIA) or Task Manager (Windows) to see VRAM being used. - Force GPU use if detection still fails. Ollama reads environment variables. Set
OLLAMA_GPU_LAYERSto a number (e.g., 99) to force offloading layers to GPU. On Windows, set it via System Properties > Environment Variables, then restart Ollama. On Linux/macOS, export it before starting the service:export OLLAMA_GPU_LAYERS=99. Note that labels and variable names can differ slightly by version, so check the official Ollama docs for your build. - For NVIDIA on Linux, verify the container toolkit if using Docker. If you run Ollama in Docker, install the NVIDIA Container Toolkit and pass
--gpus allto thedocker runcommand. Without it, the container sees no GPU. - For AMD on Linux, confirm ROCm support. Check that your card is on AMD's official ROCm support list. Install ROCm drivers per AMD's instructions, then restart Ollama. On Windows, AMD support is limited to certain cards and may require a specific Ollama build; check the official docs.
Common Mistakes
- Assuming any GPU works. Very old cards, some integrated GPUs, and unsupported AMD models will fall back to CPU. Check the official support lists before troubleshooting further.
- Running a model too large for VRAM. A 70B model on an 8 GB card will mostly run on CPU no matter what you set. Use a smaller model or a more quantized version.
- Forgetting to restart Ollama after changing environment variables. The service reads them only at startup.
- Using an outdated Ollama build. New GPU architectures often need a newer release.
- Ignoring driver updates. Ollama relies on the installed CUDA/ROCm/Metal stack; old drivers can silently disable GPU offload.
Tips
- Use
ollama psas your quick health check after every model load. - Keep one model loaded at a time; multiple models compete for VRAM.
- On laptops, plug in the power adapter. Some systems throttle or disable the discrete GPU on battery.
- If you have both integrated and discrete GPUs, set the discrete GPU as preferred in your OS graphics settings.
- Quantized models (Q4) use far less VRAM with modest quality loss, making GPU offload possible on smaller cards.
Troubleshooting
If ollama ps still shows CPU after the steps above, work through these checks in order:
- Restart the computer, then relaunch Ollama and reload the model.
- Run
nvidia-smi(NVIDIA) to confirm the driver sees the GPU and reports free VRAM. If it errors, reinstall the driver. - Check the Ollama server logs. On Linux,
journalctl -u ollama; on macOS, the app's log window; on Windows, the tray icon's logs. Look for lines mentioning CUDA, ROCm, or Metal and any errors. - Try a smaller model to rule out VRAM exhaustion.
- Set
OLLAMA_GPU_LAYERSexplicitly and restart the service. - Reinstall Ollama from the official installer as a last resort. This removes the app but not your downloaded models.
Frequently Asked Questions
Does Ollama use the GPU by default?
Yes. On supported hardware with current drivers, Ollama automatically offloads as many layers as fit in VRAM. No configuration is needed in most cases.
How do I know if Ollama is using my GPU?
Run ollama ps while a model is loaded. The PROCESSOR column shows GPU, CPU, or a split percentage.
Can Ollama use two GPUs at once?
Ollama can spread a model across multiple GPUs when they are detected and have enough combined VRAM. Behavior varies by platform and build, so check the official docs for your setup.
Why is my GPU not detected on Windows?
Usually an outdated driver, an unsupported card, or Ollama running as a background service that started before the driver loaded. Update the driver, restart the PC, and relaunch Ollama.
Does Ollama work with AMD GPUs?
Yes, but support is narrower. On Linux, ROCm-supported cards work. On Windows, only certain AMD cards are supported. Check AMD's ROCm list and Ollama's official documentation.
Will using the GPU make models faster?
Yes, usually far faster than CPU, especially for larger models. The gain depends on the GPU, VRAM size, and whether the whole model fits in VRAM.