Here is a concise troubleshooting checklist for slow prompt evaluation (pre-fill) in llama.cpp on a single GPU:

1.  **Maximize GPU Offloading**
    *   **Action:** Run with `-ngl 9999` (or the maximum number of layers).
    *   **Why:** If any layers remain on the CPU, the prompt must be processed sequentially by the CPU before being passed to the GPU, creating a massive bottleneck.

2.  **Increase Prompt Batch Size**
    *   **Action:** Increase the prompt processing batch size using `-ub 2048` (or higher, up to your VRAM limits).
    *   **Why:** Prompt evaluation is highly parallel. A small batch size underutilizes the GPU's parallel cores. Increasing this allows more tokens to be processed simultaneously.

3.  **Enable Flash Attention**
    *   **Action:** Add the `-fa` flag.
    *   **Why:** Flash Attention significantly reduces memory bandwidth requirements during the pre-fill phase, which is often the limiting factor for prompt speed.

4.  **Verify VRAM Fit**
    *   **Action:** Check logs to ensure the model + KV cache fits entirely in VRAM. Look for warnings about "offloading to CPU" or "swapping."
    *   **Why:** If the model spills over to system RAM, memory bandwidth drops drastically, slowing down both prompt eval and generation (but often hurting prompt eval more due to the bursty nature of the workload).

5.  **Trim Context Window**
    *   **Action:** Lower the context size with `-c` if the maximum isn't required.
    *   **Why:** Prompt evaluation time scales linearly with the context length. A massive context window forces the GPU to do significantly more work before generating the first token.

6.  **Check Quantization Format**
    *   **Action:** Use balanced GGUF quantizations (e.g., `Q4_K_M` or `Q5_K_M`).
    *   **Why:** Heavier quantizations or uncompressed models increase memory bandwidth pressure. Ensure you aren't using a format that is inefficient for your specific GPU architecture.

7.  **Monitor for Throttling**
    *   **Action:** Check GPU clocks and temperatures during prompt processing.
    *   **Why:** Prompt evaluation is a bursty, high-compute workload. If your cooling is inadequate, the GPU may downclock immediately upon receiving a large prompt, causing the delay.