llama.cpp Not Using GPU: Build Flags and Offload Settings

GPU offload settings in a local AI model runner

If llama.cpp is not using GPU, the most common cause is that the program you launched was built without a working GPU backend. A compatible graphics card alone is not enough: the backend must be enabled, its runtime and drivers must work, and the model must have layers assigned to it.

Why this happens

llama.cpp can run on the CPU even when a GPU is installed. GPU use depends on the build, the backend selected, and the offload setting in the application or command you use.

  • The executable may be a CPU-only build or may not include the backend for your GPU, such as CUDA, Metal, or Vulkan.
  • GPU drivers or runtime libraries may be missing, mismatched, or unavailable to the process.
  • GPU offload may be disabled or set too low, leaving model layers on the CPU.

Use this quick check to narrow down the cause:

CauseSymptomQuick test
CPU-only buildNo GPU backend appears at startupCheck the build information or startup log for the backend
Offload disabledGPU is detected, but memory use stays flatIncrease the GPU layer setting and reload the model
Driver or runtime issueBackend fails to initializeCheck whether the GPU vendor’s system utility can see the card
Wrong app runtimeOne app uses GPU and another does notCheck the runtime and model settings in the app that fails

1. Confirm which program is running the model

Ollama, LM Studio, ComfyUI extensions, and a separately installed llama.cpp build may use different runtimes and settings. In the failing app, check its model details, runtime or backend selection, and startup log. Confirm the app is actually using llama.cpp if you are following llama.cpp command-line instructions; a setting in one runner does not configure another.

2. Check whether the GPU backend is available

With a llama.cpp command-line build, run llama-cli --list-devices if your build supports it. The output should list the usable GPU device; if it lists only CPU or reports no devices, check the build and driver before changing offload settings. In LM Studio, check the model load configuration or runtime logs for a selected GPU backend. In Ollama, inspect the server log while loading a model for GPU detection and allocation messages.

3. Install or select a build with the right backend

Use a build that supports your hardware: CUDA for supported NVIDIA setups, Metal on supported Apple systems, or Vulkan where supported by your GPU and build. If compiling llama.cpp, enable the corresponding CMake option, such as -DGGML_CUDA=ON for CUDA, then build and run the executable from that build. Backend options can change, so check the current llama.cpp build instructions for your platform. A successful device listing or backend initialization in the log confirms the build is usable.

4. Update and verify the graphics driver

Install the current driver from your GPU vendor, then restart the application or service. On Windows, open Device Manager, expand Display adapters, and confirm the intended GPU appears without a warning icon. For NVIDIA, nvidia-smi can confirm that the driver sees the GPU and show processes using it; it does not prove that a particular model runner has enabled offload. Recheck the app log for backend initialization after the restart.

5. Increase the number of layers offloaded

In llama.cpp, set -ngl to a positive number of layers, or use --n-gpu-layers if that is the option shown by your build. For example, try llama-cli -m model.gguf -ngl 20, adjusting the value to suit the model and available VRAM. In LM Studio, open the model’s load settings and raise the GPU offload setting; in other apps, check the model’s menu for an equivalent option. A successful fix shows GPU memory use rising and the runner reporting offloaded layers. If loading fails, lower the value.

6. Leave room for the model and context

GPU memory must hold the offloaded model data and may also be used by the context cache and other applications. Close GPU-heavy programs, reduce the offload amount, or reduce the context length in the model’s settings, then load again. The confirmation is that the model loads without an out-of-memory message and the runner reports some layers on the GPU. The best setting varies by model, quantization, context length, and available VRAM.

7. Check the process and device actually in use

While generating a response, open Task Manager in Windows and check the GPU graphs, choosing a compute graph if available; on Linux, use the relevant vendor monitoring utility. Verify the process belongs to the app serving the model, not just the launcher. Some workloads show limited utilization between tokens, so pair the graph with the runner’s log or reported offload count. If the log reports GPU layers but utilization is low, the GPU may be working while CPU-side work or memory transfer limits throughput.

FAQ

Why does llama.cpp show my GPU but still use the CPU?

Device detection only confirms the backend can see a GPU. Set a positive GPU layer count and check the load log for layers actually offloaded. Some work, including parts of prompt processing or sampling, can still use the CPU.

How do I make llama.cpp use GPU on Windows?

Use a build with a backend supported by your GPU and install the matching driver. Then select the GPU in your runner and enable layer offload; confirm the log reports GPU layers after loading.

Why is Ollama or LM Studio not using my GPU?

These apps manage their own runtimes and settings, so a separate llama.cpp build may not affect them. Check the app’s model load settings and logs, verify driver detection, and ensure the model fits within available GPU memory.

To fix llama cpp not using gpu, verify the backend, driver, and offload count in the same application that loads the model. If it still runs on the CPU, save that app’s startup log, device listing, model format, and GPU memory details, then use them to identify a backend or compatibility issue.

Photo: Jacek Halicki / CC BY-SA 4.0 (Wikimedia Commons)

Leave a Comment

Gemini API Quota Exceeded in Apps Script: Backoff Plan

Gemini API Quota Exceeded in Apps Script: Backoff Plan

Fix gemini app script quota exceeded errors in Apps Script with practical checks for API limits, retries, batching, and the right Gemini project.

ChatGPT Export Missing Messages: What Actually Exports

ChatGPT Export Missing Messages: What Actually Exports

ChatGPT export conversation missing? Learn what the archive includes, why messages may be absent, and how to check account, chat history, and export settings.

Copilot Cant Build Your Pivot Table: Do This Instead

Copilot Cant Build Your Pivot Table: Do This Instead

Copilot Excel pivot table help: fix source data, check Copilot access, and build a reliable PivotTable manually when AI can’t create it.

Teams Transcript Not Showing: Policy, Licence and Fix

Teams Transcript Not Showing: Policy, Licence and Fix

Fix teams transcript not showing issues by checking meeting policy, organizer controls, licensing, transcript access, and where Teams stores completed transcripts.

Whisper SRT Timing Drifts: Fix Subtitle Sync by Hand

Whisper SRT Timing Drifts: Fix Subtitle Sync by Hand

Fix whisper srt timing off by checking audio alignment, transcript edits, export settings, and manual SRT timestamps so subtitles stay in sync.

ChatGPT Mangles PDF Tables: 6 Prompts That Fix It

ChatGPT Mangles PDF Tables: 6 Prompts That Fix It

Fix chatgpt pdf table extraction wrong results with six practical prompts, source checks, and export steps for cleaner tables in ChatGPT and other AI assistants.

ChatGPT Canvas Not Saving: Version and Cache Fixes

ChatGPT Canvas Not Saving: Version and Cache Fixes

Fix chatgpt canvas not saving by checking save status, connection, browser cache, extensions, and workspace access, then recover or copy your latest edits safely.

Gemini Deep Research Not Available: Region and Plan Checks

Gemini Deep Research Not Available: Region and Plan Checks

Fix gemini deep research not available by checking your account type, plan, region, age eligibility, administrator controls, and temporary usage limits.

Gemini in Google Sheets Not Showing: Workspace Settings

Gemini in Google Sheets Not Showing: Workspace Settings

Fix gemini in google sheets not showing by checking Workspace eligibility, admin controls, smart features, file format, account selection, and browser issues.

NotebookLM Source Limit: How to Feed 300+ Documents

NotebookLM Source Limit: How to Feed 300+ Documents

Hit the notebooklm source limit? Learn how to combine files, split notebooks by project, and check current limits so you can use 300+ work documents effectively.