New Tool Radar

Local AI

How to Run an Ollama Model on the CPU Only

Force an Ollama model to run entirely on the CPU with PARAMETER num_gpu 0 in a Modelfile, and confirm it with the PROCESSOR column of ollama ps.

Schematic diagram with three steps: set num_gpu to zero in a Modelfile, run the model, and confirm ollama ps shows 100 percent CPU.

Sometimes the GPU is the problem: it is busy with another job, its driver is misbehaving, or you want a clean baseline for how fast the model runs on the CPU. Ollama decides layer by layer how much of a model goes to the GPU, and the num_gpu parameter is the knob that controls it. Setting it to 0 tells Ollama to send no layers to the GPU at all, so the whole model runs in system memory.

Related guide: How to Check Whether Ollama Is Using the GPU or CPU

Force CPU only with a Modelfile

Create a Modelfile that starts from the model you already have and sets num_gpu to 0:

FROM llama3.2
PARAMETER num_gpu 0

Then create a model from it and run it:

ollama create cpu-only-test -f Modelfile
ollama run cpu-only-test "Why is the sky blue?"

The PARAMETER num_gpu 0 line is the whole change: 0 means no GPU layers. A larger number caps the layers sent to the GPU instead. The same parameter can also be sent per API request in the options object, but the Modelfile version is the one that sticks for every run of that model.

Confirm where it is running

While the model is loaded, run ollama ps in another terminal. The Ollama FAQ says the PROCESSOR column shows where the model was loaded: 100% CPU means it was loaded entirely in system memory, 100% GPU means entirely on the GPU, and a split such as 48%/52% CPU/GPU means it was spread across both. For this guide you want to see 100% CPU. If you still see GPU use, the model you ran is not the one built from your Modelfile — check the name you passed to ollama create and to ollama run.

When to use it, and when not to

Situation CPU only helps What to do instead
GPU driver crashing or busy Yes — the model still runs Fix the driver, then remove the setting
Measuring CPU speed Yes — a clean baseline Compare against the normal GPU run
Everyday chatting No — much slower than the GPU Leave num_gpu unset so Ollama fills the GPU

Expected result. We checked the Ollama FAQ for the ollama ps PROCESSOR column meanings and the server configuration section, and the linked guides for PARAMETER num_gpu 0 meaning CPU only. We did not run this software ourselves for this guide, so no output here is a recorded result; steps marked UNTESTED were checked against the sources below, not run.

Limits

CPU-only inference is much slower than GPU inference for the same model, and a large model on a small machine may still run out of system memory. This setting does not change the model’s weights or its context window; it only changes where the layers run. We did not run Ollama, so no speed here is a measured result.

Sources

Checked 2026-11-28.

See all