Ollama FAQ
This section condenses troubleshooting knowledge into a handy reference manual: starting with log localization, triaging by symptom, covering six major categories of problems: insufficient VRAM, download failures, port conflicts, GPU anomalies, overload, and upgrade compatibility.
Universal first step: check the logs first
Ollama's error messages are often brief; the real cause is almost always written in the logs.
| Environment | View command / location |
|---|---|
| macOS | cat ~/.ollama/logs/server.log |
| Linux(systemd) | journalctl -u ollama --no-pager --follow --pager-end |
| Windows | %LOCALAPPDATA%\Ollama\server.log |
| Docker | docker logs |
| Manual serve | Logs printed directly to the current terminal |
When default logs lack detail, enable debug mode and restart the service to see key processes such as GPU discovery and VRAM estimation:
# Debug mode start
OLLAMA_DEBUG=1 ollama serve
When encountering an issue, triage using the navigation map below, then jump to the corresponding subsection:
Insufficient VRAM / memory (OOM)
This is the most common runtime problem, typically manifested as the process disappearing mid-generation, the system freezing, or memory allocation failures appearing in the logs.
| Symptom | Reason | Countermeasure |
|---|---|---|
| Process killed when loading a large model | Insufficient physical memory | Switch to a smaller-size tag; or use create to quantize and reduce size |
| Crash mid-generation | Context accumulation causes KV cache expansion | Lower num_ctx; enable Flash Attention and KV cache quantization |
| Collective failure with multiple requests | NUM_PARALLEL too large, VRAM multiplied | Set back to 1, then increase gradually while observing ollama ps |
| Model runs but is offloaded to CPU | VRAM slightly smaller than required | Clear background VRAM usage; drop one parameter size level |
Three essential diagnostic commands: ollama ps to see model occupancy and offload ratio, nvidia-smi (or rocm-smi) for real-time GPU VRAM, and free -h for system memory.
Model download failures and resume after interruption
Download problems almost always lie in the network path; the good news is that Ollama supports layer-based resume, so retrying costs very little.
| Symptom | Reason | Countermeasure |
|---|---|---|
| Repeated download interruptions | Network to source site unstable | Rerun the same command to resume; configure HTTPS_PROXY if necessary |
| Still fails after configuring the proxy | HTTP_PROXY was set by mistake | Keep only HTTPS_PROXY and remove HTTP_PROXY |
| Proxy certificate error | Self-signed certificate not trusted | Install the CA certificate as a system certificate |
| Warning of insufficient disk space | Insufficient capacity on the target partition | Free up space, or migrate the storage path using OLLAMA_MODELS |
Port conflicts and connection refused
The client reports "connection refused", essentially meaning no service is answering on port 11434.
| Symptom | Reason | Countermeasure |
|---|---|---|
| Local curl connection refused | Ollama service not started | On macOS / Windows, open the app; on Linux, run sudo systemctl start ollama |
| Logs report port already in use | 11434 taken by another program | Stop the occupying process, or start on a different port: OLLAMA_HOST=127.0.0.1:11435 |
| Remote machine cannot connect | Service listening only on the loopback address | On the server, set OLLAMA_HOST=0.0.0.0 and allow it through the firewall |
| Linux manual installation exits immediately after starting | /tmp mounted with noexec, inference library cannot load | Set OLLAMA_TMPDIR to point to an executable directory |
GPU not used / discovery failure
Symptoms are ollama ps showing 100% CPU, or GPU discovery failure appearing in the logs. NVIDIA and AMD have different troubleshooting paths.
NVIDIA-specific
First check the driver and passthrough environment, then handle according to log error codes:
| Check item | Method |
|---|---|
| Driver version | nvidia-smi outputs normally; upgrade to the latest driver |
| Container passthrough | If docker run --gpus all ubuntu nvidia-smi fails, it is a Container Toolkit issue |
| Driver module anomaly | sudo rmmod nvidia_uvm && sudo modprobe nvidia_uvm, then retry after reloading |
| Fails after sleep/wake | On Linux, reload the nvidia_uvm module after waking from sleep |
| Docker loses GPU after running for a while | Add native.cgroupdriver=cgroupfs to /etc/docker/daemon.json and restart Docker |
CUDA error codes in the logs are worth memorizing: 3 means not initialized, 46 means device unavailable, 100 means no device, 999 means unknown error; most point to driver or passthrough configuration.
AMD-specific
| Symptom | Reason | Countermeasure |
|---|---|---|
| Completely undetected on Linux | User not in the video / render group | Add the running user to the corresponding group and restart the service |
| Discovery timeout appearing in logs | ROCm driver too old (below v7) | Upgrade to ROCm v7 with amdgpu-install and reboot |
| Older cards not supported | Architecture not in the official support list | Try HSA_OVERRIDE_GFX_VERSION to specify a similar architecture |
| Some older cards on Windows have no ROCm | Driver stack limitation | Use the default Vulkan path; if issues occur, check GGML_VK_VISIBLE_DEVICES |
Systematic troubleshooting of 503 overload and slow responses
String the methods from previous chapters into a fixed process, locating the vast majority of performance problems within six steps:
Step 1: use ollama ps to confirm whether PROCESSOR is 100% GPU; if offloading occurs, return to VRAM optimization first.
Step 2: check the logs for records of queuing, unloading, or discovery failures.
Step 3: receiving 503 means the queue is full; check the concurrent request volume and OLLAMA_MAX_QUEUE, and assess whether to scale up.
Step 4: in multi-user sharing scenarios, verify the multiplicative relationship between OLLAMA_NUM_PARALLEL and VRAM.
Step 5: verify the keep_alive policy: frequent unloading and reloading causes first-token latency to spike.
Step 6: use the API's usage field to calculate token/s, and compare against historical baselines to quantify the effect of each adjustment.
Post-upgrade compatibility issues and rollback
When behavior is abnormal after an upgrade, three actions solve most cases:
# 1. Before manually upgrading Linux, clean up old libraries to avoid mixing new and old ones
sudo rm -rf /usr/lib/ollama
# 2. Fallback to specified version
curl -fsSL https://ollama.com/install.sh | OLLAMA_VERSION=0.5.7 sh
# 3. AMD GPU synchronized upgrade ROCm v7 driver after reboot
Garbled squares appearing in the Windows terminal are an old terminal font issue, unrelated to the model; just switch to Windows Terminal.