Here’s a concise troubleshooting checklist for llama.cpp on a single GPU when prompt evaluation (prefill) is bottlenecking:

**GPU & Backend**
- [ ] **Full GPU Offload:** Set `--ngl` to the model’s total layer count (e.g., `--ngl 99`). Any CPU layers severely throttle prefill.
- [ ] **Enable Flash Attention:** Add `--flash-attn` (requires CUDA/ROCm). Single biggest prefill speedup for long contexts.
- [ ] **Verify Backend:** Run `llama-cli -m model.gguf -n 1 -p "test" -v` to confirm GPU backend is active and no fallback warnings appear.

**Batch & Threading**
- [ ] **Increase Prefill Batch:** Set `--batch 2048` (or higher) and `--ubatch 2048`. Default (512) caps prefill throughput.
- [ ] **Thread Configuration:** Set `--threads` to physical cores. Mirror with `--threads-batch` for prefill parallelism.

**Memory & I/O**
- [ ] **VRAM Capacity:** Ensure full model + KV cache fits in VRAM. Check `nvidia-smi`/`rocm-smi`. Hitting system RAM/pagefile tanks prefill.
- [ ] **Disable MMAP:** Add `--no-mmap` if prefill is inconsistent or disk-bound. Forces direct memory load, avoiding page faults.

**Model & Environment**
- [ ] **Quantization Check:** Use standard quants (Q4_K_M, Q5_K_M). Exotic quants may lack optimized GPU kernels.
- [ ] **Update llama.cpp:** Pull latest `master`. GPU prefill optimizations are frequent.
- [ ] **Context Length Test:** Benchmark short vs. long prompts. Prefill scales with token count; flash-attn mitigates quadratic attention overhead.

**Quick Validation Command:**
`llama-server -m model.gguf --ngl 99 --flash-attn --batch 2048 --ubatch 2048 --threads 8 --threads-batch 8 --no-mmap`
*(Adjust `--ngl`, `--threads`, and batch sizes to your hardware.)*