Gemma 4 E2B on a laptop's integrated Radeon GPU with llama.cpp Vulkan
- Hardware
- Lenovo Yoga 6 13ABR8 with a Ryzen 5 7530U
Integrated Radeon GPU with a 2 GiB carve-out of 8 GiB RAM - Models & engines
- llama.cpp 7182ef71e built with Vulkan, plus a CPU-only build for comparison
Model: exact Q4_0 GGUF of Gemma 4 E2B, plus an exact Q4_0 drafter - Key gotcha
- Never start the server with --no-mmap, or the per-layer table has to fit in the 2 GiB carve-out
What they built
xbill wanted to get the most out of hardware he already owned: a Lenovo Yoga 6 with a Ryzen 5 7530U, no graphics card, and an integrated Vega-generation Radeon with a 2 GiB slice of the laptop's 8 GiB of RAM and no official ROCm support.
He built llama.cpp with the Vulkan backend, which only needs the Mesa driver the desktop already uses, and served an exact Q4_0 Gemma 4 E2B GGUF from llama-server. He then added a small drafter model, ran all of GSM8K and BFCL simple with and without it, and compared Vulkan against a ROCm build forced onto the chip with an override.
The whole rig is a Makefile and an env file, so serving is one command.
Setup
- Lenovo Yoga 6 13ABR8 with a Ryzen 5 7530U
- Integrated Radeon GPU with a 2 GiB carve-out of 8 GiB RAM
- llama.cpp 7182ef71e built with Vulkan, plus a CPU-only build for comparison
- Model: exact Q4_0 GGUF of Gemma 4 E2B, plus an exact Q4_0 drafter
How it works
- make serve runs llama-server with -ngl 99, an 8,192-token context, f16 K/V cache and flash attention
- The 1.321 GB per-layer embedding table stays in the memory-mapped file in system RAM, so only 1.20 GiB has to live on the GPU
- The drafter is added with -md <drafter> --spec-type draft-mtp -ngld all --spec-draft-n-max 2
- ROCm only ran with HSA_OVERRIDE_GFX_VERSION=9.0.0 on a gfx900 build
Results & numbers
- 32.37 tokens/s decode and 348 tokens/s prompt processing on the iGPU, against 25.68 and 112.89 on the CPU
- About 41 tokens/s with the 2-token drafter; code prompts reached 1.89x
- GSM8K 0.9014 without the drafter and 0.9030 with it; BFCL simple 0.9225 both ways
- A full GSM8K pass took 3.55 hours with the drafter and 5.28 without
- ROCm decoded at 0.976x Vulkan and read prompts at 0.589x
Gotchas
- Never start the server with --no-mmap, or the per-layer table has to fit in the 2 GiB carve-out
- Three drafted tokens fall back to 1.145x because the third is accepted too rarely
- A bare -j build starts every compile at once, and 5,776 MiB of RAM does not hold that
- ROCm needs an override AMD does not list, and Vulkan is the better backend on this chip
“The GPU in an ordinary laptop can run a current language model.”— xbill
Do it yourself
- Install glslc, libvulkan-dev, spirv-headers and cmake
- Build llama.cpp with the Vulkan backend
- Download the exact Q4_0 Gemma 4 E2B GGUF and check its SHA-256
- Serve with -ngl 99 and the memory map left on
- Add the Q4_0 drafter with --spec-draft-n-max 2 and compare tokens/s
llama-server -m gemma-4-E2B-it-q4_0-exact.gguf -ngl 99 \
-md <drafter> --spec-type draft-mtp -ngld all --spec-draft-n-max 2Similar setups
Letting a coding agent tune llama.cpp on an 8 GB AMD GPU: 3x faster prompt reading for OpenCode
Cliff K had his coding agent benchmark llama.cpp backends and flags for a Qwen3.6 35B MoE on a Radeon RX 6600 XT, at the context depths OpenCode really uses, and turned the process into an open-source skill.
A private OpenAI-compatible LLM API on an AMD GPU with llama.cpp
A Vietnamese developer's notes on building llama.cpp for AMD cards, choosing between Vulkan and ROCm, and running llama-server as a locked-down systemd service that existing OpenAI SDK code can call.
llama.cpp 1.0 on a handheld PC's integrated GPU: 2x faster long prompts with flash attention
Before-and-after llama.cpp 1.0 tests on an MSI Claw's Intel Arc 140V found long prompts read about twice as fast only with flash attention on, and the new MoE cache lost to full GPU offload.
Serving a local model on Kubernetes on your own laptop with kind and Ollama
Alex Jones wrote a tested guide to running Ollama in a kind cluster on CPU, Intel Arc, NVIDIA and AMD, then using the served model with k8sgpt to explain cluster failures without any data leaving the machine.