Ollama Not Using GPU? Fix It on Linux, Windows and WSL
TL;DR Run ollama ps while a model is loaded: the PROCESSOR column tells you the truth. 100% GPU means the GPU is fine and you can stop reading. A split like 40%/60% CPU/GPU means the model didn't fit in VRAM — use a smaller quant. 100% CPU means Ollama found no usable GPU: usually an outdated driver, a missing group membership (AMD on Linux), a pinned OLLAMA_LLM_LIBRARY , or a container started…
To determine if Ollama is utilizing your GPU on Linux, Windows, or WSL2, follow these steps:
1. Load a model in Ollama and check the output:
- In one terminal, run `ollama run llama3.2 hello`.
- In another terminal, execute `ollama ps`.
2. Look at the "PROCESSOR" column in the `ollama ps` output. There are three possible states:
- 100% GPU: The GPU is functioning correctly, and the model has successfully offloaded all layers.
- 48%/52% CPU/GPU: The GPU is partially utilized, but the model or context size exceeds the available VRAM. Consider reducing the context size or using a quantized model.
- 100% CPU: Inference is being processed by the CPU. The GPU either wasn't detected or was explicitly disabled.
3. To identify the actual GPU Ollama is utilizing, examine the server log:
- Run `journalctl -u ollama --no-pager | grep -i inference compute` on Linux.
- On Windows, check the Ollama supported-GPU list to ensure your GPU is recognized.
4. Common issues preventing GPU usage:
- Outdated or incompatible NVIDIA driver: Update the driver, reboot, and restart the Ollama service.
- Missing AMD group memberships (render and video) on Linux: Add the user to the appropriate groups and restart the Ollama service.
- Unsupported AMD GPU: Ensure your AMD GPU is supported or attempt to override the detection using `HSA_OVERRIDE_GFX_VERSION`.
- Pinned OLLAMA_LLM_LIBRARY: Remove the environment variable if it's causing issues with GPU detection.
5. After applying driver or group fixes, restart the Ollama service to ensure it re-detects the GPU.
6. If updating Ollama, the backend library may be pinned. Remove `OLLAMA_LLM_LIBRARY` if it's causing GPU usage issues.
7. Ollama can indeed work in WSL2, provided the correct NVIDIA driver is installed and accessible from WSL2.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.