This machine (Gigabyte GAMING A16, RTX 5060 Laptop GPU, CachyOS) is separate hardware from the CPU-only Local-AI-VM tracked in the Local-AI-VM benchmarks — don’t mix numbers between the two, though the model sweep below uses the same model set for comparison.

See Llama.cpp Installation on Gigabyte Gaming A16 for what each flag below means, and see the canonical glossary for pp512/tg128 and other general terms.


Full model sweep — full GPU offload (-ngl 999)

ModelParamspp512 (t/s)tg128 (t/s)Max safe -c
DeepSeek-R1-Distill-Qwen 1.5B1.5B8587.02175.962,097,152
Gemma 2 2B2B6024.78100.19262,144
Llama 3.2 3B3B4436.13164.79262,144
Qwen 2.5 3B3B4272.8393.301,048,576
Phi-3.5 Mini 3.8B3.8B3106.7176.32131,072
Llama 3.1 8B8B1878.7444.42262,144
Mistral 7B~7B1913.6848.97262,144

Max-safe--c figures here are VRAM-driven ceilings (8GB card), not directly comparable to the RAM/OOM ceilings on the CPU-only VM even for the same model name.

Open items:

  • Power profile in effect during this sweep wasn’t recorded — given the power-profile finding, confirm/record it and ideally re-run under the laptop’s chosen standard profile.
  • -fa/flash-attention state during this run wasn’t recorded.
  • Compare against the Local-AI-VM CPU baselines once profile/flash-attention state is confirmed, to quantify GPU speedup per model.

New context tier measurements

Rather than guess context sizes, the largest context that stays fully in VRAM was measured per preset. Each model has three context tiers: Small (1/3 of maximum), Medium (2/3 of maximum), and Max (full usable value). The Max tier keeps the KV cache in VRAM for optimal performance, while smaller tiers allow more headroom for a second model when using --models-max 2.

Maximum context in VRAM

ModelConfigured beforeMax context in VRAMTrials
Gemma 3 1B16,384262,14410
Qwen3.5-4B (and thinking)32,768 / 131,072180,22418
Qwen3.5-9B (and thinking)32,768 / 65,53674,75216
Qwen3.5-9B Uncensored (and thinking)32,768 / 65,53677,31216
Gemma 4 E4B65,536185,34418
Gemma 4 E4B Uncensored65,536185,85618

Context tiers

Each tier is rounded down: Small = 1/3, Medium = 2/3, Max = the full usable value.

ModelBinding limitSmallMediumMax
Gemma 3 1BTrained context (32K)10,92221,84532,768
Qwen3.5-4B (both modes)VRAM60,074120,149180,224
Qwen3.5-9B (both modes)VRAM24,91749,83474,752
Qwen3.5-9B Uncensored (both modes)VRAM25,77051,54177,312
Gemma 4 E4B (both modes)Trained context (128K)43,69087,381131,072

The idea is that the Max tier is a good default for most use, and the smaller tiers exist for when VRAM is needed by a second model.

Capping at trained context

Two models fit more context in VRAM than they were trained to handle:

  • Gemma 3 1B: measured 262,144 in VRAM, but the Gemma 3 model card lists 32K tokens for the 1B size.
  • Gemma 4 E4B (and its uncensored fine-tune): measured about 185K in VRAM, but the Gemma 4 model card lists 128K tokens for E2B and E4B.

Their Max tiers use the trained size (32,768 and 131,072), and the Small and Medium tiers were recalculated from that. The Qwen3.5 maxima (180,224 for the 4B, 74,752 and 77,312 for the 9B models) are below Qwen3.5’s native context, which is understood to be 262,144 but was not re-verified here. n_ctx_train in each model’s load log shows what llama.cpp itself reads from the file.


Power profile vs. GPU-bound throughput — Llama 3.1 8B, -ngl 999

Power Profilepp512 (t/s)tg128 (t/s)
performance1551.00 ± 212.7731.72 ± 0.44
power-saver2081.93 ± 213.3359.98 ± 0.23

power-saver beat performance here by ~34% on pp512 and ~89% on tg128 — the opposite of what the profile names suggest. The root cause is a laptop hardware characteristic, not a llama.cpp one: see the Gigabyte laptop hardware page for the nvidia-smi power-limit numbers and explanation.

Practical takeaway: for GPU-bound inference (-ngl high/full offload) on this laptop, use power-saver.

Power profile vs. CPU-only throughput — Llama 3.1 8B, -ngl 0

Power Profilepp512 (t/s)tg128 (t/s)
power-saver470.88 ± 36.382.84 ± 0.02
performance725.47 ± 2.737.29 ± 0.56

Here performance wins, as its name suggests — ~54% faster pp512, ~2.6x faster tg128. This confirms the profile is tuned around sustained CPU clocks: that’s a win for CPU-bound work and a loss for GPU-bound work, per the hardware-level explanation.

Note: setting -ngl 0 does not stop llama.cpp from loading the CUDA backend — llama-bench’s backend column still reports CUDA, which reflects what loaded, not what computed. Confirmed via btop that the CPU (not GPU) did the work in these runs. CUDA_VISIBLE_DEVICES="" would suppress CUDA entirely for a cleaner label, if wanted for future runs.

Combined rule for this machine:

  • GPU-bound (-ngl high/full) → power-saver.
  • CPU-only (-ngl 0) → performance.
  • Picking the wrong profile is a bigger loss (up to ~2.6x) than most other single tuning choice tested on this machine so far.

Open items:

  • balanced profile not yet tested for the CPU-only case.
  • Thread count (-t) wasn’t explicitly set for these runs — worth a sweep given the hybrid P/E-core CPU (12+4), to see if the P/E split changes where diminishing returns kick in compared to a uniform-core CPU.

Full GPU offload vs. CPU-only, by mode — Llama 3.1 8B Q4_K_M

Modepp512 (t/s)tg128 (t/s)
Full GPU (-ngl 999)1707.84 ± 26.9839.42 ± 0.22
CPU-only (-ngl 0), power-saver470.88 ± 36.382.84 ± 0.02
CPU-only (-ngl 0), performance725.47 ± 2.737.29 ± 0.56

-nkvo vs. context size — Llama 3.1 8B, -ngl 999

Purpose: whether an oversized KV cache (relative to remaining VRAM after weights) causes a hard cutover to CPU-speed generation, or a gradual slowdown — and where -nkvo becomes worth using on this GPU.

Context (-c)Without -nkvo (t/s)With -nkvo (t/s)
~11,26437.533.2
23,55222.227.7
29,69617.627.0
41,98414.128.1
60,41611.328.2
72,70410.527.6

Without `-nkvo`, throughput degrades continuously as context grows (37.5 → 10.5 t/s, a ~3.6x collapse) — the growing KV cache gradually crowds out VRAM headroom, rather than triggering a one-time fallback. With -nkvo, throughput stays flat (~27–33 t/s) regardless of context, since the cache never competes with weights for VRAM and only pays a roughly constant PCIe-transfer cost per token.

There’s a real crossover, so -nkvo isn’t a universal win: at ~11K tokens, leaving it off is faster (37.5 vs 33.2 t/s); somewhere between ~11K and ~24K tokens the lines cross, and past that -nkvo wins by a growing margin (up to ~2.6x faster at 72,704 tokens).

Rule of thumb for this laptop (8B model, 7705 MiB card): leave -nkvo off under ~15–20K tokens of context, turn it on beyond that. Re-verify for other model sizes rather than assuming the same crossover transfers.

Open items:

  • Narrow the exact crossover point (currently only bounded to “somewhere between ~11K and ~24K tokens”).
  • Repeat on a different model size (3B or Mistral 7B from the model sweep) to see whether the crossover scales with model size/VRAM headroom.
  • Confirm whether pp512 shows the same pattern as tg128 under VRAM pressure.

Partial offload — Qwen3-14B (too big for VRAM)

Purpose: a real-world check of a model too large to fully offload to this laptop’s 7705 MiB VRAM, with -ngl left unspecified for the first time (auto-offload).

llama-cli -m Qwen3-14B-Q4_K_M.gguf -p "Write me a 1000 word story about how AI is going to kill all humans" -st -c 11265 -nkvo

Result: Prompt: 56.9 t/s | Generation: 9.9 t/s. btop showed most of the model resident in VRAM with the remainder in system RAM — confirming that on a GPU-enabled build, leaving `-ngl` unset auto-fits as many layers as VRAM allows rather than defaulting to CPU-only.

Model / modetg128-equivalent (t/s)
Llama 3.1 8B, full GPU offload39.42
Llama 3.1 8B, CPU-only (performance)7.29
Qwen3-14B, automatic partial offload + -nkvo, -c 112659.9

Even with most of a larger (14B) model sitting in VRAM, generation speed lands much closer to the CPU-only 8B baseline than to anything GPU-offload speed — consistent with hybrid-split throughput getting dragged down toward the CPU-side layers’ speed rather than averaging proportionally with the offloaded fraction.

Open items:

  • The usual load_tensors: offloaded X/Y layers to GPU log line wasn’t visible in this run’s output — re-run with output piped to a log file (or a verbose flag) to capture the exact split.
  • Re-run with explicit -ngl values around what auto-offload chose, to see how sensitive throughput is to exact layer count at this model size.
  • Test without -nkvo at the same -c, now that the sweep above shows it isn’t a universal win at small-to-mid context.