Back to Blogs
#gemma#intel#vulkan#llm

Gemma 4 E2B on an Intel Iris Xe Laptop: Vulkan, SYCL, OpenVINO or the CPU?

llama.cpp has three ways onto an Intel integrated GPU: Vulkan, SYCL and OpenVINO. On a Core i5-1335U laptop with 8 GiB of RAM, Vulkan and OpenVINO read prompts at about 360 tokens a second and generate at about 20.7, SYCL trails both. Serve on Vulkan: across three 13th-generation laptops the GPU reads prompts 3.66x to 5.22x faster than the CPU and generates at 0.77x to 1.18x the CPU's speed.

Updated 15 min read
Cover for Gemma 4 E2B on an Intel Iris Xe Laptop: Vulkan, SYCL, OpenVINO or the CPU?

An Intel laptop with no graphics card still has a GPU: the Iris Xe inside the processor. llama.cpp can reach it three ways, through Vulkan on the Mesa driver the desktop already uses, through Intel's oneAPI SYCL compiler, and through Intel's OpenVINO runtime. This article runs Gemma 4 E2B through all three, and through the CPU cores, on the same laptop, the same model file and the same llama.cpp commit.

Serve on Vulkan. Across three 13th-generation Intel laptops the Iris Xe GPU reads prompts 3.66x to 5.22x faster than the CPU cores, and generates at 0.77x to 1.18x their speed, depending on the laptop and its power profile. Vulkan needs only the Mesa driver the desktop already uses, and it leaves the CPU free. OpenVINO ties Vulkan at a large memory cost, and SYCL is slower.

This article provides a step by step deployment guide for Gemma 4 E2B on the integrated GPU of an Intel Core i5-1335U laptop with llama.cpp, with each of its three Intel GPU backends built and measured beside a CPU-only build, then the Vulkan and CPU builds under each power profile on that laptop, a Core i7-1360P laptop and a Core i5-1340P laptop. Each backend is its own rig, a Makefile and a tpu.env, so serving is one command.

https://github.com/xbill9/gemma4-dev/tree/main/local-llamacpp-i51335u-2b-q4_0


The Findings

Serve on Vulkan. On the three 13th-generation laptops, at the balanced and performance power profiles, the GPU reads a prompt 3.66x to 5.22x faster than the CPU, and generates at 0.77x to 1.18x the CPU's speed. The GPU leads on reading everywhere; generation is close to a tie.

Generation follows the clock the GPU holds. The i7-1360P's Iris Xe holds 1,500 MHz and generates at 25.30 tokens a second at balanced, 1.183x its CPU and 1.225x the i5-1335U's GPU at 1,250 MHz, a clock ratio of 1.200 on memory at the same 5,200 MT/s. The i5-1340P's Iris Xe is rated to 1,450 MHz but averaged 1,048 MHz at performance and generates at 16.37, level with its CPU (1.019x).

The power profile sets the CPU's speed. On the i5-1335U the GPU generates at about 20.9 tokens a second under both balanced and performance. The CPU drops from 26.90 to 21.43, so it leads at performance (the GPU at 0.774x) and is level at balanced (0.974x).

Vulkan and OpenVINO are level. llama-bench pp512 359.78 and tg128 20.65 tokens a second for Vulkan, 366.52 and 20.78 for OpenVINO, on the i5-1335U. Through llama-server OpenVINO is 1.04x Vulkan on two prompts.

SYCL is the slowest GPU path. 216.67 and 14.91 tokens a second: 0.602x Vulkan on prompts and 0.722x on generation.

The Iris Xe GPU sets the pace of generation. Each generated token reads the model's weights once, so tokens a second times the 1.283 GB of weights the Radeon rig holds on its GPU gives a read rate (arithmetic, same file and commit): 26.5 GB/s for Iris Xe through Vulkan, 33.3 GB/s for the CPU cores from the same LPDDR5-5200, and 41.5 GB/s for the Radeon iGPU from slower LPDDR4-4266. The Iris Xe held its top clock, 1,250 MHz, for 35 of the 40 seconds sampled while generating.

OpenVINO needs three memory settings to load on 8 GiB. At its defaults the kernel's out-of-memory killer ends it during loading. With them, it peaks at 3.37 GiB with 248 MiB of the laptop's memory left.

Flash attention off is faster on Iris Xe. 1.385x on prompts and 1.156x on generation with Vulkan, 1.115x and 1.106x with SYCL.

The speculative drafter does not pay on Iris Xe. 0.973x and 0.767x on the GPU, 1.096x and 0.805x on the CPU.

What to do with it.

  • 🟢 Serve on Vulkan with flash attention off: prompts 3.66x to 5.22x the CPU, generation within 0.77x to 1.18x, the CPU left free.
  • 🟢 Long prompts, short replies: Vulkan by a wide margin, a 2,000-token prompt read in about 5.6 seconds against 20.3 on the CPU.
  • ⚠️ Chat only, at performance, on a GPU that holds 1,250 MHz or less: the CPU build generates up to 1.291x faster. cat /sys/firmware/acpi/platform_profile shows the profile.
  • ⚠️ OpenVINO matches Vulkan but takes three switches and most of the memory to do it.
  • ❌ SYCL is behind Vulkan on every test here.

What Was Measured

One laptop, one model file, one llama.cpp commit, four builds. For each build, llama-bench with a 512-token prompt and 128 generated tokens, three repetitions, with flash attention on and off where the backend allows both. Then each build serving two greedy 256-token prompts through llama-server with the prompt cache off. Then the 2-token drafter on Vulkan and on the CPU. Then the Vulkan and CPU builds again on a second laptop with the 12th-generation Core i5-1235U. Then, on 2026-12-03, the Vulkan and CPU builds on the i5-1335U under the balanced and performance power profiles, on a Lenovo Yoga 9 14IRP8 with a Core i7-1360P under low-power, balanced and performance, and on a Samsung Galaxy Book3 360 with a Core i5-1340P under those three and quiet.

Only speed was measured. Answer quality (GSM8K, BFCL) was not run on any of these builds.


At This Point You Should Have…

  • A laptop with an Intel Iris Xe integrated GPU and the Mesa ANV Vulkan driver, here a Lenovo Yoga 7 14IRL8 with a Core i5-1335U
  • cmake, ninja-build, glslc, libvulkan-dev and spirv-headers from apt
  • For SYCL: Intel's compute runtime (intel-opencl-icd libze-intel-gpu1 libze1) and oneAPI's intel-oneapi-compiler-dpcpp-cpp, intel-oneapi-mkl-devel and intel-oneapi-dnnl-devel
  • For OpenVINO: the OpenVINO 2026.4.1 runtime archive in /opt/intel/openvino, plus ocl-icd-opencl-dev opencl-headers opencl-clhpp-headers
  • Your user in the render group
  • A clone of gemma4-dev

Step 1 — The Machine

The i5-1335U has 2 performance cores and 8 efficiency cores, 12 threads, and an Iris Xe GPU that runs at up to 1,250 MHz. GPU and CPU share 8 GiB of LPDDR5-5200, of which the kernel sees 5.5 GiB:

$ vulkaninfo --summary
    deviceName         = Intel(R) Iris(R) Xe Graphics (RPL-U)
    driverInfo         = Mesa 26.2.8-1

$ free -h
               total        used        free      shared  buff/cache   available
Mem:           5.5Gi       1.3Gi       1.6Gi       103Mi       3.0Gi       4.2Gi
Enter fullscreen mode Exit fullscreen mode

The CPU governor is the default powersave for every number in this article.


Step 2 — Four Builds of One Commit

All four builds come from one llama.cpp checkout at 7182ef71e, one build directory each. Each rig's make build adds only its own:

Rig Build directory Backend
local-llamacpp-i51335u-2b-q4_0 build-vulkan Vulkan, Mesa ANV
local-llamacpp-i51335u-2b-q4_0 build-cpu none, CPU only
local-llamacppsycl-i51335u-2b-q4_0 build-sycl SYCL, oneAPI 2026.2.1, Level Zero
local-llamacppopenvino-i51335u-2b-q4_0 build-openvino OpenVINO 2026.4.1, OpenCL

The SYCL build compiles with Intel's icx and icpx, which need a lot of memory per job: keep BUILD_JOBS at 3 or 4 on 8 GiB. Every SYCL and OpenVINO recipe sources Intel's environment script first.

All four serve the same file: the exact Q4_0 GGUF of Gemma 4 E2B, where every weight matrix is Q4_0, checked against its SHA-256 by make verify.


Step 3 — Vulkan

Vulkan needs nothing beyond Mesa. llama.cpp finds the GPU and puts every layer on it:

ggml_vulkan: 0 = Intel(R) Iris(R) Xe Graphics (RPL-U) (Intel open-source Mesa driver) | uma: 1 | fp16: 1 | bf16: 0 | fp4: 0 | warp size: 32 | shared memory: 49152 | int dot: 1 | matrix cores: none
| model                          |       size |     params | backend    | ngl | threads |  fa |            test |                  t/s |
| gemma4 E2B Q4_0                |   2.43 GiB |     4.63 B | Vulkan     |  99 |       4 |   0 |           pp512 |        359.78 ± 1.58 |
| gemma4 E2B Q4_0                |   2.43 GiB |     4.63 B | Vulkan     |  99 |       4 |   0 |           tg128 |         20.65 ± 0.02 |
| gemma4 E2B Q4_0                |   2.43 GiB |     4.63 B | Vulkan     |  99 |       4 |   1 |           pp512 |        259.70 ± 0.42 |
| gemma4 E2B Q4_0                |   2.43 GiB |     4.63 B | Vulkan     |  99 |       4 |   1 |           tg128 |         17.87 ± 0.01 |
Enter fullscreen mode Exit fullscreen mode

Flash attention off is 1.385x faster on prompts and 1.156x on generation, so the rig serves with FLASH_ATTENTION=0. The GPU held its 1,250 MHz maximum for 35 of the 40 seconds sampled during the generation test.


Step 4 — SYCL

SYCL is Intel's own compute path for llama.cpp, built with oneAPI and run through Level Zero. It sees the GPU as one device:

SYCL0: Intel(R) Iris(R) Xe Graphics (4867 MiB, 2921 MiB free)

| gemma4 E2B Q4_0                |   2.43 GiB |     4.63 B | SYCL       |  99 |       4 |   0 |           pp512 |        216.67 ± 0.57 |
| gemma4 E2B Q4_0                |   2.43 GiB |     4.63 B | SYCL       |  99 |       4 |   0 |           tg128 |         14.91 ± 0.04 |
| gemma4 E2B Q4_0                |   2.43 GiB |     4.63 B | SYCL       |  99 |       4 |   1 |           pp512 |        194.24 ± 0.63 |
| gemma4 E2B Q4_0                |   2.43 GiB |     4.63 B | SYCL       |  99 |       4 |   1 |           tg128 |         13.48 ± 0.04 |
Enter fullscreen mode Exit fullscreen mode

At its faster setting, flash attention off, SYCL reads prompts at 0.602x Vulkan and generates at 0.722x.


Step 5 — OpenVINO, and Fitting It in 8 GiB

OpenVINO's backend turns llama.cpp's compute graphs into OpenVINO graphs and compiles them for the GPU. It picks the CPU unless told otherwise:

Available devices:
  OPENVINO0: GGML_OPENVINO_DEVICE=CPU (selected) - 13th Gen Intel(R) Core(TM) i5-1335U (5657 MiB, 5657 MiB free)
  OPENVINO1: GGML_OPENVINO_DEVICE=GPU - Intel(R) Iris(R) Xe Graphics (iGPU) (4867 MiB, 4251 MiB free)
Enter fullscreen mode Exit fullscreen mode

With GGML_OPENVINO_DEVICE=GPU and nothing else, the kernel's out-of-memory killer ends llama-bench while it loads, at 4.40 GiB of resident memory. The rig's tpu.env sets three more switches:

GGML_OPENVINO_DEVICE=GPU
GGML_OPENVINO_MEMORY_OPTIMIZE=1
GGML_OPENVINO_RELEASE_WEIGHTS=0
GGML_OPENVINO_SPILL_DIR=/home/xbill/ov-spill
Enter fullscreen mode Exit fullscreen mode

MEMORY_OPTIMIZE requantizes the weights as a stream and keeps a weight buffer in the spill directory on disk. On its own it also frees the host copy of the weights after the first graph is compiled, and the generation graph that comes next then fails:

ggml-openvino: cannot compile a new graph after releasing host weights
llama_bench: error: failed to run gen warmup
Enter fullscreen mode Exit fullscreen mode

RELEASE_WEIGHTS=0 keeps the host copy. With all four set the run completes, and llama.cpp's own OpenVINO guide says llama-bench on this backend needs -fa 1:

| gemma4 E2B Q4_0                |   2.43 GiB |     4.63 B | OPENVINO   |  99 |       4 |   1 |           pp512 |       366.52 ± 40.35 |
| gemma4 E2B Q4_0                |   2.43 GiB |     4.63 B | OPENVINO   |  99 |       4 |   1 |           tg128 |         20.78 ± 0.71 |
Enter fullscreen mode Exit fullscreen mode

That is 1.019x Vulkan on prompts and 1.006x on generation, level, with a prompt figure that varies by ±40 across three repetitions. The run peaked at 3.37 GiB resident with 248 MiB of the laptop's memory available. Close the browser before starting it.


Step 6 — The CPU

The CPU-only build has no GPU code at all, so its numbers include no GPU work:

| gemma4 E2B Q4_0                |   2.43 GiB |     4.63 B | CPU        |       4 |   1 |           pp512 |         76.81 ± 0.08 |
| gemma4 E2B Q4_0                |   2.43 GiB |     4.63 B | CPU        |       4 |   1 |           tg128 |         22.12 ± 0.12 |
| gemma4 E2B Q4_0                |   2.43 GiB |     4.63 B | CPU        |       6 |   1 |           pp512 |         77.87 ± 0.42 |
| gemma4 E2B Q4_0                |   2.43 GiB |     4.63 B | CPU        |       6 |   1 |           tg128 |         24.59 ± 2.92 |
| gemma4 E2B Q4_0                |   2.43 GiB |     4.63 B | CPU        |      12 |   1 |           pp512 |         98.34 ± 0.42 |
| gemma4 E2B Q4_0                |   2.43 GiB |     4.63 B | CPU        |      12 |   1 |           tg128 |         25.98 ± 0.12 |
Enter fullscreen mode Exit fullscreen mode

All 12 threads are fastest on both tests. At 25.98 tokens a second the CPU generates 1.258x Vulkan, and at 98.34 it reads prompts at about a quarter of Vulkan's speed. make serve-cpu serves this build. These runs were at the performance power profile; Step 10 shows what balanced does to them.


Step 7 — Through llama-server

Each build served the same two prompts, a Python function and a short story, greedy, 256 tokens, prompt cache off, -c 8192. The Vulkan server's own timing lines:

eval time =   13481.28 ms /   256 tokens (   52.87 ms per token,    18.92 tokens per second)
eval time =   13472.84 ms /   256 tokens (   52.83 ms per token,    18.93 tokens per second)
Enter fullscreen mode Exit fullscreen mode
Build Code, tokens / s Story, tokens / s Server memory
🥇 CPU, 12 threads 26.47 25.57 —
🥈 OpenVINO 19.69 19.60 764 MiB
🥉 Vulkan 18.92 18.93 194 MiB
SYCL 14.91 14.83 972 MiB

OpenVINO runs 1.041x and 1.035x Vulkan, SYCL 0.788x and 0.783x. The CPU server is 1.399x and 1.351x Vulkan; its row comes from a separate server run on the same prompts and settings. Server memory is the process's own resident set; Vulkan's weights sit in GPU memory, which that figure does not count. make serve answers its health check 8 seconds after start on SYCL and 22 on OpenVINO.

All three GPU builds write coherent replies to both prompts. Their greedy text differs slightly between backends.


Step 8 — The Drafter

The exact Q4_0 drafter guesses 2 tokens ahead and llama-server keeps the ones the full model agrees with. On this laptop it does not pay:

spec=False 18.69 tok/s 256 tok None None          # iGPU, code prompt
spec=False 18.47 tok/s 256 tok None None          # iGPU, story prompt
spec=True 18.18 tok/s 256 tok 217 146             # iGPU + drafter, code
spec=True 14.17 tok/s 256 tok 281 114             # iGPU + drafter, story
cpu spec=False 26.47 tok/s None None              # CPU -t 12, code
cpu spec=False 25.57 tok/s None None              # CPU -t 12, story
cpu spec=True 29.0 tok/s 209 150                  # CPU + drafter, code
cpu spec=True 20.58 tok/s 292 109                 # CPU + drafter, story
Enter fullscreen mode Exit fullscreen mode

0.973x and 0.767x on Vulkan, 1.096x and 0.805x on the CPU. Every rig serves without it.


Step 9 — A 12th-Generation Laptop

The Vulkan and CPU builds ran again on a Samsung Galaxy Book2 360 with a Core i5-1235U, the 12th-generation part, with 8 GiB of slower LPDDR4X-4267 (its power profile was not recorded):

| gemma4 E2B Q4_0                |   2.43 GiB |     4.63 B | Vulkan     |  99 |       4 |   0 |           pp512 |        358.28 ± 0.64 |
| gemma4 E2B Q4_0                |   2.43 GiB |     4.63 B | Vulkan     |  99 |       4 |   0 |           tg128 |         18.60 ± 0.02 |
| gemma4 E2B Q4_0                |   2.43 GiB |     4.63 B | CPU        |      12 |   1 |           pp512 |         68.50 ± 1.81 |
| gemma4 E2B Q4_0                |   2.43 GiB |     4.63 B | CPU        |      12 |   1 |           tg128 |         22.08 ± 3.35 |
Enter fullscreen mode Exit fullscreen mode

The same pattern holds. The GPU reads prompts 5.230x the CPU, and the CPU generates 1.187x the GPU, with a wide spread between repetitions (± 3.35). Against the 13th-generation laptop the GPU reads at 0.996x and generates at 0.901x.


Step 10 — Three Laptops, Each Power Profile

Linux laptops expose a platform profile, low-power, balanced or performance, that sets how much power the processor may draw. The i5-1335U was set to performance when checked, and the main runs repeat there: the CPU at 12 threads at 0.971x and the GPU at 1.009x. The same llama-bench cells on three laptops under each profile, tokens a second, generation with flash attention off on the GPU and the best CPU thread count:

Laptop Profile GPU clock GPU generate CPU generate GPU prompt / CPU prompt
i7-1360P, LPDDR5-5200 performance 1,500 MHz 26.18 26.49 3.741x
i7-1360P balanced 1,500 MHz 25.30 21.39 5.217x
i5-1335U, LPDDR5-5200 performance 1,250 MHz 20.83 26.90 3.898x
i5-1335U balanced 1,250 MHz 20.88 21.43 4.751x
i5-1340P, LPDDR4X-4267 performance 1,048 MHz average 16.37 16.07 4.623x
i5-1340P balanced 912 MHz average 16.66 16.03 4.550x

The two clocks of 1,500 and 1,250 MHz are each GPU's top clock, held for most of the run. The i5-1340P's GPU is rated to 1,450 MHz and reached 1,400 or more in at most 2 sampled seconds under any profile. The GPU's speed follows the clock it holds and barely moves between balanced and performance; the CPU's speed follows the profile, 0.797x at balanced against performance on the i5-1335U. At low-power both P-series laptops slow further (i7-1360P GPU 20.15 and CPU 22.38; i5-1340P GPU 11.27 and CPU 9.15). All three ran on mains power; Chrome was open on the i5-1340P.


Compare and Contrast

The four ways to serve on the i5-1335U at the performance profile, llama-bench at each one's faster flash-attention setting:

Build Generate, tokens / s Prompt, tokens / s Setup
🥇 CPU, 12 threads 25.98 98.34 apt
🥈 OpenVINO 20.78 366.52 archive + 3 memory switches
🥉 Vulkan 20.65 359.78 apt
SYCL 14.91 216.67 oneAPI repository
  • CPU. 🟢 Fastest generation on this laptop at performance. ⚠️ Level with the GPU at balanced. ❌ A 2,000-token prompt waits about 20.3 seconds.
  • Vulkan. 🟢 Fast prompts, Mesa only, 194 MiB of process memory, CPU left free. ⚠️ Generates at 0.795x the CPU here at performance, level at balanced, ahead on the i7-1360P.
  • OpenVINO. 🟢 Level with Vulkan. ❌ Needs three switches to load, 3.37 GiB at peak and a disk spill directory.
  • SYCL. ⚠️ Reads prompts 2.203x the CPU. ❌ Behind Vulkan on every test.

An AMD laptop of the same class, the Ryzen 5 7530U with its Radeon integrated GPU, generates at 32.37 tokens a second through Vulkan on the same commit and file: 1.568x the Iris Xe, and ahead of its own CPU cores.


So, Which One?

Serve on Vulkan with flash attention off. It reads prompts 3.66x to 5.22x faster than the CPU on all three laptops, generates within 0.77x to 1.18x of the CPU, needs nothing past Mesa, and leaves the cores to the desktop.

The one case for the CPU build is chat with short prompts on a laptop at performance whose GPU holds 1,250 MHz or less, where the CPU generates up to 1.291x faster. Check the profile with cat /sys/firmware/acpi/platform_profile and measure; the same 13th-generation Iris Xe generated at 16.37 to 26.18 tokens a second across these laptops.

OpenVINO gives the same speed as Vulkan and costs most of the laptop's memory to load. SYCL gives less.


Summary

The goal of this article was to find the fastest way to serve Gemma 4 E2B on an Intel laptop with only an integrated GPU. The key to the solution was building one llama.cpp commit four ways, with Vulkan, SYCL, OpenVINO and no GPU at all, measuring each on the same file, and repeating Vulkan and the CPU on three laptops under each power profile. The results were:

  • 🟢 Vulkan reads prompts 3.66x to 5.22x the CPU on three 13th-generation laptops.
  • 🟢 Vulkan generates at 0.77x to 1.18x the CPU, following the clock the GPU holds: 25.30 tokens a second at 1,500 MHz, 20.88 at 1,250, 16.37 at about 1,050.
  • ⚠️ On the i5-1335U at performance the CPU generates fastest, 25.98 tokens a second, 1.250x OpenVINO, the fastest GPU path.
  • 🟢 Vulkan and OpenVINO read prompts at 359.78 and 366.52 tokens a second on the i5-1335U.
  • ⚠️ OpenVINO loads on 8 GiB only with MEMORY_OPTIMIZE=1, RELEASE_WEIGHTS=0 and a spill directory, peaking at 3.37 GiB.
  • ❌ SYCL runs at 0.602x Vulkan on prompts and 0.722x on generation.
  • ❌ The 2-token drafter slows generation on the GPU, 0.973x and 0.767x.

Scope: one Lenovo Yoga 7 14IRL8 with a Core i5-1335U (Iris Xe, Mesa 26.2.8 ANV, Intel compute runtime 26.27.39122, oneAPI 2026.2.1, OpenVINO 2026.4.1) and one Samsung Galaxy Book2 360 with a Core i5-1235U, Debian sid, kernel 7.4.0-rc5, llama.cpp 7182ef71e, xbill9/gemma-4-E2B-it-qat-q4_0-exact-gguf, CPU governor powersave, ACPI platform profile performance for the main runs, all on 2026-12-02; the profile runs on the i5-1335U and on one Lenovo Yoga 9 14IRP8 with a Core i7-1360P (Iris Xe to 1,500 MHz, LPDDR5 at 5,200 MT/s) and one Samsung Galaxy Book3 360 with a Core i5-1340P (Iris Xe rated to 1,450 MHz, LPDDR4X at 4,267 MT/s, kernel 7.4.0-rc4), Vulkan and CPU builds only, on 2026-12-03. The i5-1235U's profile was not recorded. llama-bench runs are three repetitions each; server runs are two prompts, one pass each, one request at a time, thinking off. The CPU server row comes from a separate run from the GPU rows. The prompt waits are arithmetic from the llama-bench prompt speed. Answer quality, long contexts, several requests at once, sustained heat and SYCL's and OpenVINO's tuning switches were not measured.

The strategy for serving Gemma 4 E2B on an Intel integrated laptop GPU was validated with an incremental step by step approach.


References

Hope you enjoyed it!