How to Troubleshoot Slow Ollama Setups on Mac and Windows

How to Troubleshoot Slow Ollama Setups on Mac and Windows

Ollama has become one of the most popular platforms for running open-source large language models locally. Its simple CLI interface, unified REST API, and automatic hardware detection make model deployment accessible. However, performance issues can still occur on both macOS and Windows systems.

If your setup produces slow responses or high latency, this operating system troubleshooting guide will show you how to troubleshoot slow Ollama installations on Apple Silicon Macs and Windows machines.


Is Your Ollama Instance Running Slower Than Expected?

Ollama automates hardware detection and layer offloading behind the scenes. While this works well out-of-the-box, configuration errors, background process conflicts, or virtual memory swapping can cause noticeable performance degradation.

Common signs of performance degradation in Ollama include:
– Unusually Slow First Token: The model pauses for 15 to 45 seconds before printing the first word of a response.
– Low Generation Rates: Streaming output slows to 1–4 tokens per second on hardware capable of 30+ tok/s.
– System Resource Exhaustion: High CPU fan noise or frozen desktop environments during model execution.

Identifying operating system settings helps resolve these latency issues quickly.


How to Troubleshoot Slow Ollama Performance

Before applying OS-specific tweaks, perform initial diagnostic checks to verify whether Ollama detects your system graphics hardware correctly.

Checking the Ollama Logs

Ollama generates execution logs detailing hardware detection, CUDA/Metal library loading, and layer offloading decisions.

  • On macOS: Inspect logs by running the following command in Terminal:
    bash
    cat ~/.ollama/logs/server.log
  • On Windows: Open PowerShell and navigate to the application log directory:
    powershell
    Get-Content $env:LOCALAPPDATA\Ollama\app.log -Tail 100

Look for lines indicating hardware initialization. Statements like source=cpu.go or falling back to CPU confirm that GPU acceleration failed to initialize.

Verifying GPU Acceleration in Ollama

You can verify whether a model runs on the GPU using Ollama’s diagnostic API endpoint while a prompt processes:

curl http://localhost:11434/api/ps

Check the size_vram versus size output fields. If size_vram equals 0 or is significantly smaller than size, Ollama is running in partial or total CPU mode.

[IMAGE: Activity monitor showing steps to troubleshoot slow Ollama on Mac]


Fixing Local LLMs Running Slow on Mac (Apple Silicon)

Apple Silicon Macs (M1/M2/M3/M4) utilize Unified Memory Architecture (UMA), sharing high-speed memory between CPU and GPU cores via Apple’s Metal framework. However, memory allocation limits can cause a local LLM running slow Mac scenario.

Metal (MPS) Utilization Issues

If Ollama fails to engage Metal GPU acceleration on macOS:
1. Ensure Minimum System Requirements: Metal acceleration requires macOS 12 or newer.
2. Check App Permissions: Ensure terminal applications or GUI clients possess standard permissions without sandbox restrictions.
3. Reset Ollama Service: Restart the background menu bar app or execute killall ollama in terminal followed by ollama serve.

Unified Memory Limits

By default, macOS reserves a portion of Unified Memory for system display buffers and OS processes. Apple caps the maximum memory allocated to a single process (the iogpu.wired_limit_mb).

If you attempt to load a large model (e.g., a 32B model on a 36 GB Mac) that exceeds this default threshold, macOS falls back to system RAM paging, drastically reducing speed.

Fixing Memory Allocation Limits:
You can adjust system memory allocation thresholds using system administration flags in Terminal by setting the value to your desired limit in Megabytes:

# Increase default Metal allocation threshold on Apple Silicon (e.g., to ~27GB)
sudo sysctl iogpu.wired_limit_mb=27700

(Note: Requires administrative privileges. Resetting system settings or updating macOS may restore default limits.)


Fixing Local LLMs Running Slow on Windows

Windows environments present unique challenges due to graphics driver configurations, background security tools, and virtualized container environments like WSL2, often resulting in a local LLM running slow Windows issue.

[IMAGE: Task Manager revealing WSL2 resource usage to fix slow Ollama on Windows]

WSL2 vs Native Windows Setup

Running Ollama inside Windows Subsystem for Linux (WSL2) versus native Windows handles GPU pass-through differently:

  • Native Windows Executable: Runs as a native background service with direct CUDA access. This is generally the most reliable setup for standard consumer desktop GPUs.
  • WSL2 Environment: Requires installed NVIDIA CUDA drivers on the Windows host side plus proper WSL2 GPU pass-through configurations (/dev/dxg).

If running inside WSL2, verify CUDA pass-through by executing nvidia-smi inside your WSL2 prompt. If nvidia-smi reports errors or fails to display your GPU, update host display drivers to the latest CUDA-ready release.

Windows Defender and Antivirus Interference

Real-time antivirus scanning tools (such as Windows Defender) can interfere with local model loading times by scanning model parameter files during execution.

Exclusion Tweaks:
1. Open Windows Security > Virus & threat protection.
2. Select Manage settings under Virus & threat protection settings.
3. Scroll to Exclusions and add the Ollama storage folder (C:\Users\<Your-Username>\.ollama\models).

This prevents continuous disk I/O scans when opening large model files.


OS-Specific Optimization Summary

OS Environment Common Root Cause Primary Fix
macOS (Apple Silicon) Unified memory process allocation cap Adjust wired_limit_mb or lower model context size
Windows Native Antivirus scanning large model files Exclude ~/.ollama/models folder in Windows Defender
Windows (WSL2) Missing CUDA pass-through drivers Install latest host NVIDIA drivers; verify /dev/dxg

If OS-specific adjustments do not restore full performance, review our general steps to diagnose general local LLM issues, resolve hardware-level resolve CPU fallback issues, or learn advanced methods to increase local LLM throughput.


Frequently Asked Questions (FAQ)

How do I force Ollama to use my GPU on Windows?

Ensure the latest NVIDIA/AMD display drivers are installed. If using an NVIDIA card, set the environment variable CUDA_VISIBLE_DEVICES=0 in System Environment Variables to force selection of your dedicated graphics card.

Why is Ollama slow on Mac Intel processors?

Intel-based Macs lack Apple Silicon Unified Memory and unified Metal MPS acceleration pipelines for LLM operations. Intel Macs must run models across CPU cores or limited AMD GPUs, resulting in lower generation speeds.

Where does Ollama store downloaded model files?

  • On macOS: ~/.ollama/models
  • On Windows: C:\Users\<Username>\.ollama\models
  • On Linux: /usr/share/ollama/.ollama/models

Leave a Comment