localllm

Why is llama.cpp slow on my AMD or Intel GPU on Windows?

Usually Resizable BAR. Without it, llama.cpp's Vulkan backend can put buffers in a small host-visible heap, and decode gets up to 1.7x slower. Here is what to check and the fix.

The cause

With Resizable BAR off, the GPU exposes only a 256 MB window of its memory to the CPU. llama.cpp's Vulkan backend puts some buffers in that host-visible heap, which on these systems is backed by system RAM. Every token then crosses the PCIe bus, and decode drops by up to 1.7x (llama.cpp#27097).

Fix 1: turn on Resizable BAR

In your BIOS/UEFI, enable Above 4G Decoding and Resizable BAR (AMD calls it Smart Access Memory). This fixes the cause for every app.

Fix 2: the environment variable

If you can't change the BIOS, set this before starting llama-server:

set GGML_VK_DISABLE_HOST_VISIBLE_VIDMEM=1

But measure it: on an RX 9070 XT with Resizable BAR off it made Qwen3.8-27B 1.64x faster, and gemma-4-26B-A4B 7-9% slower. llama.cpp treats any value, even 0, as on, so unset it to turn it off.

What localllm does

It sets the variable only for models where it measured faster, and localllm tune measures it on your PC and keeps it only if it is at least 1.1x faster. If you set the variable yourself, localllm leaves it alone.

Other things that make it slow

  • The model doesn't fit. On Windows the driver quietly moves part of it into shared system memory and decode gets several times slower. localllm warns when this happens.
  • The first run of a new build. The driver compiles shaders once, about 15 seconds.
  • An integrated GPU picked instead of the card. localllm skips iGPUs; with llama.cpp alone, pass -dev Vulkan0.

Check your own PC

install and run
$ pip install make-localllm-easier
$ localllm