Vulkan is the easiest way to run local AI models on GPUs that are not Nvidia. With llama.cpp’s Vulkan backend you can use an AMD Radeon card, Intel Arc or integrated Intel and AMD graphics, and even some phones and Macs, without installing ROCm, oneAPI or CUDA.
This guide shows how to get llama.cpp running with Vulkan on Windows and Linux. You will see the quick install route, the prebuilt release downloads, building it yourself, offloading layers to the GPU, choosing between several GPUs, and how Vulkan compares with ROCm, SYCL and CUDA.
It follows the official llama.cpp README and build guide (docs/build.md) as of November 2026, including the new llama cli and llama serve commands.
- What: a cross-vendor GPU backend for llama.cpp. Works on AMD, Intel, Nvidia and more.
- Need: an up-to-date GPU driver with Vulkan support. Check with
vulkaninfo. - Easiest: download a Vulkan build from the llama.cpp releases page, or use the llama.app installer.
- Build it:
cmake -B build -DGGML_VULKAN=ONthencmake --build build --config Release. - Run on GPU: add
-ngl 99to offload all layers, and look forggml_vulkan: Using ...in the log. - Several GPUs:
--list-devices, then pick with--device.
Why Use Vulkan?
Vulkan is a graphics and compute API that almost every modern GPU driver supports. llama.cpp’s Vulkan backend uses it to run model layers on the GPU.
- One backend for many GPUs: AMD Radeon (including older cards ROCm does not support), Intel Arc and Iris Xe, AMD and Intel integrated graphics, Nvidia, and Qualcomm Adreno on some devices.
- No heavy toolkits: you need the normal graphics driver. Building also needs the Vulkan SDK, but running a prebuilt binary does not.
- Works on Windows and Linux, and on macOS through translation layers (MoltenVK or KosmicKrisp).
- Integrated graphics: laptops without a dedicated GPU can still speed up prompt processing, since iGPUs share system RAM.
Apps built on llama.cpp, such as LM Studio, Jan and KoboldCpp, also offer Vulkan runtimes. If you only want a chat app, our KoboldCpp guide shows a simpler route.
Check Your GPU Supports Vulkan
- Update your GPU driver: AMD Adrenalin, Intel Arc/Iris graphics driver or Nvidia Game Ready/Studio driver on Windows; Mesa (RADV for AMD, ANV for Intel) on Linux.
- Install the
vulkaninfotool: it comes with the Vulkan SDK, or on Debian/Ubuntu withsudo apt install vulkan-tools. - Run
vulkaninfo --summary. You should see your GPU listed under “Devices” with no errors.
If vulkaninfo fails or lists only a software renderer (llvmpipe), fix the driver before going further.
Install a Ready-Made Build
The llama.cpp README now lists several quick install options:
- Installer script:
curl -LsSf https://llama.app/install.sh | shon Linux/macOS, orirm https://llama.app/install.ps1 | iexin PowerShell. See llama.app for options. - Prebuilt binaries: the releases page has builds for each backend. For Vulkan on Windows, download the x64 zip whose name includes
vulkan, extract it, and run the programs from that folder. - Docker: a Vulkan Dockerfile is included (see below).
Prebuilt files are the fastest way to test. Build from source only if you need the newest commit, custom options or a platform without a ready binary.
Build With Vulkan on Windows
The build guide gives three Windows routes. The Visual Studio one is the most common:
- Install Git, Visual Studio Community with the C++ workload, and CMake.
- Install the LunarG Vulkan SDK with default settings.
- Clone the repo:
git clone https://github.com/ggml-org/llama.cpp - Right-click the
llama.cppfolder, choose Open Git Bash Here, and runcmake -B build -DGGML_VULKAN=ON - Build:
cmake --build build --config Release - The programs land in
build/bin/Release/.
The other routes are w64devkit (copy glslc.exe, vulkan-1.lib and the headers from the SDK into w64devkit) and MSYS2, where you install the UCRT packages for gcc, cmake, vulkan-devel, shaderc and spirv-headers with pacman and then run the same two CMake commands.
Build With Vulkan on Linux
- Install build tools:
sudo apt install build-essential cmake git - Install Vulkan development packages. On Debian/Ubuntu:
sudo apt-get install libvulkan-dev glslc spirv-headers(Fedora/openSUSE usespirv-headers-devel). Alternatively use the LunarG SDK and runsource setup_env.shin every new terminal. - Confirm the GPU is visible:
vulkaninfo - Build:
cmake -B build -DGGML_VULKAN=1thencmake --build build --config Release -j - Binaries are in
build/bin/.
The docs point out that SPIRV-Headers are required and are not always installed by the Vulkan loader package alone. A missing spirv.hpp error means you need that package.
macOS
Apple Silicon is best served by llama.cpp’s Metal backend. If you want Vulkan anyway, install the LunarG SDK (tick KosmicKrisp if you want it), source its setup script, and build with -DGGML_VULKAN=1 -DGGML_METAL=OFF.
Run the Vulkan Build in Docker
The Docker route does not need the Vulkan SDK on your machine. From the llama.cpp folder:
docker build -t llama-cpp-vulkan --target light -f .devops/vulkan.Dockerfile .
docker run -it --rm -v "$(pwd):/app:Z" \
--device /dev/dri/renderD128:/dev/dri/renderD128 \
--device /dev/dri/card1:/dev/dri/card1 \
llama-cpp-vulkan -m "/app/models/YOUR_MODEL.gguf" -p "Hello" -n 400 -e -ngl 33
Your /dev/dri device names may differ; check with ls /dev/dri.
Run a Model on the GPU
The new unified command downloads a GGUF from Hugging Face and runs it:
llama cli -hf ggml-org/Qwen3.5-0.8B-GGUF -ngl 99
llama serve -hf ggml-org/Qwen3.5-0.8B-GGUF -ngl 99
With a source build, use the individual binaries:
./build/bin/llama-cli -m path/to/model.gguf -ngl 99 -c 16384
./build/bin/llama-server -m path/to/model.gguf -ngl 99 --port 8080
-ngl 99offloads all layers to the GPU. Lower it if the model does not fit in VRAM.-csets the context length; longer context uses more VRAM.- Check the start-up log for a line such as
ggml_vulkan: Using AMD Radeon RX 7800 XT | uma: 0 | fp16: 1 ....uma: 1means a shared-memory (integrated) GPU.
Pick a quant that fits your card; our GGUF quantization guide lists sizes for each VRAM tier. To serve models to other apps, see the llama-server guide.
Pick a GPU and Combine Backends
- List devices:
llama-cli --list-devicesshows every GPU llama.cpp can use and its name (for exampleVulkan0,Vulkan1). - Choose one:
--device Vulkan1uses only that GPU, which is useful on laptops with both integrated and dedicated graphics. - CPU only:
--device nonefully disables GPU use. Even with-ngl 0, the GPU may still speed up some parts. - Several backends: you can build with both CUDA and Vulkan (
-DGGML_CUDA=ON -DGGML_VULKAN=ON) and choose at run time with--device. - Portable builds:
GGML_BACKEND_DLbuilds backends as loadable libraries, so one binary can run on machines with different GPUs.
Vulkan vs ROCm vs SYCL vs CUDA
| Backend | GPUs | Setup effort | When to choose it |
|---|---|---|---|
| Vulkan | AMD, Intel, Nvidia, many iGPUs | Low: driver only to run | Default for AMD on Windows, Intel, older Radeons and iGPUs |
| HIP (ROCm) | Supported AMD Radeon and Instinct cards | Medium to high | Supported AMD cards on Linux when you want to compare speed |
| SYCL (oneAPI) | Intel GPUs | High | Intel Arc users chasing extra speed |
| CUDA | Nvidia | Medium | Nvidia cards: usually the fastest choice |
| Metal | Apple Silicon | None (built in) | Every Mac with an M-series chip |
Speed differences between Vulkan and ROCm or SYCL change from release to release and from card to card, so test both with llama-bench on your own hardware if you care about the last few percent. For Ollama on Radeon cards, see our Ollama AMD GPU guide.
Troubleshooting
| Problem | Fix |
|---|---|
No ggml_vulkan line in the log |
You are running a CPU-only build. Use a Vulkan release or rebuild with -DGGML_VULKAN=ON |
vulkaninfo shows only llvmpipe |
The real GPU driver is missing or broken; reinstall the vendor driver or Mesa |
| CMake cannot find Vulkan | Install the Vulkan SDK (Windows) or libvulkan-dev; on Linux with the SDK, run source setup_env.sh first |
Error about spirv.hpp |
Install spirv-headers (or spirv-headers-devel) |
glslc not found |
Install glslc/shaderc, or copy it from the SDK (w64devkit route) |
| Uses the integrated GPU instead of the dedicated one | Run --list-devices and pick the right one with --device |
| Out of memory when loading | Lower -ngl, reduce -c, or use a smaller quant |
| Docker container sees no GPU | Pass the correct /dev/dri devices and check permissions (render group) |
FAQ
Does llama.cpp Vulkan work with AMD GPUs on Windows?
Yes. It is the easiest way to use Radeon cards on Windows: install the latest Adrenalin driver and run a Vulkan build.
Is Vulkan slower than CUDA on Nvidia?
Usually somewhat slower, so Nvidia users should normally use the CUDA build. Vulkan is handy when CUDA is not an option.
Can I use Vulkan with Intel integrated graphics?
Yes. The build guide shows an Intel ADL GT2 iGPU being detected. Expect modest speed-ups, mostly in prompt processing.
Do I need the Vulkan SDK to run llama.cpp?
No. The SDK is only needed to build from source. Prebuilt Vulkan binaries need just a GPU driver with Vulkan support.
What does -ngl 99 mean?
It offloads up to 99 layers to the GPU, which in practice means the whole model for most sizes. Lower it to keep some layers in system RAM.
Can I use two different GPUs together?
llama.cpp can use multiple devices, and you can select them with --device. Mixing very different GPUs works but the slowest card limits speed.
What is the new “llama cli” command?
The current README shows a unified llama command with subcommands such as llama cli and llama serve, installed by the llama.app script. Source builds still produce llama-cli and llama-server.




