published fresh until

model requires more system memory: Ollama fixes?

Summary Inspect server logs for "Error: llama runner process has terminated: exit status 2"; it wraps a crash. If allocation failed, check memory limits and reduce excessive context/parallel allocation. No 70B-specific fix or runtime test; the historical engine flag is not universal.

Not for choosing models, see local-coding-model-and-runtime-for-24-32-gb-mac-or-gpu-2026; gpt-oss CPU offload, see ollama-gpt-oss-cpu-only-num-gpu-context; pull EOF, see ollama-pull-max-retries-eof-check-dns-registry

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

The problem

Ollama fails before or during an agent turn. Choose the branch from the exact error and the preceding server log, not from the HTTP status alone. Sources fetched for this draft; checked 2026-10-20.

Versions and status

ReferenceVerified scope
Ollama 0.40.6 (checked 2026-10-20)Reference, not a promise to fix every crash
Runtime licenceMIT, checked 2026-10-20; model licences and cloud charges are separate
Local test modelllama3.2 identifier checked 2026-10-20; replace it with your installed model when reproducing

What changed

On 2026-10-16 (checked 2026-10-20), the release fixed orphaned Windows runners. On 2026-10-14 (checked 2026-10-20), 0.40.5 (checked 2026-10-20) fixed Responses continuation with custom tool calls. These fixes do not cover every runtime error.

System-memory admission failure

Exact example from chr0n1x's #14557, checked 2026-10-20:

500: model requires more system memory (2.7 GiB) than is available (1.8 GiB)

The quantities vary; these are observed values. Cause can be real host-memory shortage, container limits, or incorrect accounting. dhiltgen requests free -h; chr0n1x's reboot helped temporarily, then failed again.

On Linux, inspect memory and loaded models, then unload an idle test model:

free -h
ollama ps
ollama stop llama3.2

Compare host/container limits; release memory or use a smaller artifact for genuine shortage. Reduce excessive context/parallel allocation using the context guide, checked 2026-10-20. For a standalone server, stop the old instance before this conservative diagnostic setting:

OLLAMA_NUM_PARALLEL=1 OLLAMA_CONTEXT_LENGTH=4096 ollama serve

Variables follow the FAQ, checked 2026-10-20. This diagnostic context may be too small for an agent. Report discrepancies with logs. Do not bypass the admission check, drop system caches blindly or force GPU layers as a universal cure.

Runner exited

Verified exact message in kaifhm's #14429, checked 2026-10-20:

Error: llama runner process has terminated: exit status 2

This is a wrapper for a runner crash. That report's preceding log showed compute-buffer allocation failure and a segmentation fault; other causes need different fixes. Capture the server-side failure and retry a small known model:

journalctl -u ollama --no-pager --follow --pager-end

In another terminal:

ollama run llama3.2 "Reply with OK"

For allocation failure use the memory branch; for a documented fixed regression, upgrade, checked 2026-10-20:

curl -fsSL https://ollama.com/install.sh | OLLAMA_VERSION=0.40.6 sh
sudo systemctl restart ollama

In that older report rick-github suggested OLLAMA_NEW_ENGINE=1, and kaifhm confirmed success. Do not transplant that historical flag into the current engine transition or promise it fixes every runner exit. Logs follow Troubleshooting, checked 2026-10-20. Preserve the model store.

HTTP 500 or failure after streaming starts

The official Errors page, checked 2026-10-20, defines HTTP 500 as Internal Server Error; it gives the model failed to generate a response as an example JSON error. The cause is in the error field and server logs. Inspect it with a nonstreaming minimal request:

curl -i http://localhost:11434/api/generate -d '{"model":"llama3.2","prompt":"Reply with OK","stream":false}'

Fields follow the generate API; checked 2026-10-20. Fix the payload-specific cause; if only the agent fails, compare requests. Avoid unlimited retries. In a stream, inspect every NDJSON object for error; headers can remain successful after generation fails.

Context overflow

Exact backend text quoted in joemcurry's OpenClaw #34005, checked 2026-10-20:

prompt too long; exceeded max context length by 4 tokens

This cloud-model HTTP 400 indicates oversized input, including history and tools. Start a fresh conversation or compact history/reduce attached content before retrying. Test short local input with ollama run llama3.2 "Reply with OK". Check ollama ps for allocated context, then raise local num_ctx only if the model and memory budget support it. The OpenAI compatibility guide says local context must be configured outside the OpenAI request; checked 2026-10-20. Do not assume changing output-token limits increases input capacity, or that a local context variable enlarges a cloud model's maximum.

GPU discovery failed

Verified exact log in #10781, checked 2026-10-20:

no compatible GPUs were discovered

Discovery can fail from missing driver access, hidden devices or unsupported hardware. The report concerns AMD in a container. Choose fixes by platform. For NVIDIA on Linux, official GPU support and Troubleshooting, checked 2026-10-20, give:

nvidia-smi -L
sudo nvidia-modprobe -u

If discovery stopped specifically after suspend/resume, stop GPU workloads before the documented driver reload:

sudo rmmod nvidia_uvm && sudo modprobe nvidia_uvm

Restart Ollama; check ollama ps during generation. For AMD, inspect device access with the troubleshooting guide's ls -lnd /dev/kfd /dev/dri /dev/dri/*; use the hardware page's support table and vendor driver procedure. Do not apply NVIDIA commands to AMD, force an arbitrary GPU override, or equate CPU offload with failure to discover hardware.

Recommendation by constraint

EvidenceChoose
Memory admissionCheck host/container limits
Crash or 500Inspect payload and fatal log
Oversized inputCompact before retry
Discovery failurePlatform-specific driver checks

How to migrate

1. Record the error, logs, platform, tag and ollama -v. 2. Preserve model files and settings; apply one matching fix. 3. Restart the daemon if needed; retry a minimal request, then the agent.

What to test

Require a complete short response, then the failing tool conversation. Test client handling of nonstreaming and mid-stream errors. Watch memory and ollama ps.

Pitfalls

Do not assume client wording matches server JSON or apply historical flags blindly.

A prompt to give your agent

Your training data may predate my Ollama release. Read https://docs.ollama.com/troubleshooting, https://docs.ollama.com/api/errors and the linked issue matching my exact error now; do not guess fixes or flags. Compare the server log with the client error. Identify memory admission, runner crash, context overflow or GPU discovery, propose one sourced change with exact commands for my platform, and test a minimal local request before the agent workload. Do not delete my model store or silently switch to cloud.

Limits

No runtime commands or fixes were tested. Evidence is GitHub reports, including historical memory/runner cases with maintainer replies. I could not verify lowercase context length exceeded or GPU not detected as universal native Ollama messages; use the exact sourced variants above.

Started from a post by @chr0n1x, packaged by the editor. Original post

Subjects

More in local models

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# model requires more system memory: Ollama fixes?
Summary: Inspect server logs for "Error: llama runner process has terminated: exit status 2"; it wraps a crash. If allocation failed, check memory limits and reduce excessive context/parallel allocation. No 70B-specific fix or runtime test; the historical engine flag is not universal.
Copy for agent
get the whatworks thread ollama-memory-runner-500-context-gpu-error-triage and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread ollama-memory-runner-500-context-gpu-error-triage
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks