Local LLM Deployment: Why Your GPU Isn't Accelerating Inference and How to Fix It

    After deploying a large language model locally, many users assume the GPU isn't being used at all when generation feels slow. This article explains the real cause—usually the model exceeds available VRAM and the framework silently offloads part of the computation to host memory—then walks through a three-step troubleshooting method, real benchmarks showing how partial offloading tanks speed, and the only three viable options when the model simply won't fit. You'll learn how to confirm whether the GPU is actually working, diagnose external-GPU issues, and plan capacity around dedicated VRAM.

    1. First, correct a common misdiagnosis: the GPU isn’t idle, it just can’t keep up

    After deploying a large model locally, the most common assumption is that “the GPU isn’t participating at all.” The real reason is usually more mundane: the model is larger than the VRAM available on the GPU. At runtime the framework neither crashes nor refuses to start—instead it automatically keeps some computation layers in VRAM and places the rest in host memory for the CPU to handle. This happens silently, so from the outside it looks like “text still comes out, but it’s so slow you start to wonder whether the GPU is even plugged in.”

    The math makes it obvious. A dense model in the 30-billion-parameter range, quantized to 4-bit, needs about 16–17GB just for the weights—while a mainstream laptop discrete GPU often has only 8GB of VRAM. That gap can’t be closed by tweaking parameters. It’s a size problem, not a configuration problem.

    2. Measured relationship between VRAM usage and generation speed

    To quantify the cost of partial offloading, I ran the same 8-billion-parameter 4-bit quantized model on the same machine and changed only the number of layers loaded into VRAM, keeping everything else constant. The results:

    Layers in VRAM VRAM usage Generation speed
    All layers 5328 MiB 38.7–39.0 t/s
    32 layers 2656 MiB 11.3–11.8 t/s
    24 layers 2136 MiB 7.3–8.2 t/s
    0 layers (CPU only) — 5.05 t/s

    The third row is the key one: with 2.1GB of weights already in VRAM, speed still drops to roughly one-fifth of the full-GPU configuration. The reason is that autoregressive decoding fetches the weights for the current layer every time it generates a token. When the model doesn’t fit entirely, the non-resident portion has to make a round trip across the high-speed bus (PCIe) between host and GPU on every step. That latency is amplified per token, and the compute available in VRAM ends up sitting idle.

    Trying to fit a 30-billion-parameter model into 8GB of VRAM lands you in exactly this tier, or worse—more layers need to be shuttled across the bus, and the total weight volume is several times that of the table above.

    3. Three-step troubleshooting method

    Step 1: Disprove “the GPU isn’t working”

    Start the local inference service in one terminal, then sample GPU status once per second in another window:

    1. # Pseudocode: continuously sample VRAM usage
    2. while true:
    3. print(query_gpu_memory_used())
    4. sleep(1s)

    Watch whether the reading jumps from a few hundred MB to several GB:

    • Stays near zero the whole time: it really isn’t using the GPU—go to Step 2.
    • Steady at 6–7GB: the GPU is working and the problem is that the model doesn’t fit—skip straight to Step 3.

    Step 2: Three common external-GPU failure types

    1. Output and detection: when the laptop’s integrated GPU handles screen output, the external GPU must be enumerated correctly by the driver. It should appear in the system’s device manager with no error markers.
    2. Expansion link bandwidth: an external GPU usually connects through a high-speed direct interface or a general high-speed expansion interface. The former offers ample bandwidth but depends on motherboard and port support; the latter incurs protocol-conversion overhead, so the actual usable bandwidth is reduced, which directly affects transfer speed.
    3. Log evidence: at startup the inference framework typically prints something like “offloading N/M layers to GPU.” N is the number of layers actually resident; compare it against the table in Section 2 to see which tier you’re in.

    Step 3: Accept the ceiling and choose among only three paths

    Running a 30-billion-parameter dense model on 8GB of VRAM can’t be rescued by any parameter, because the weights that must be moved per token are 16–17GB. Only three options are viable:

    • Reduce the size: switch to an 8-billion to 14-billion-parameter model. A 14-billion-parameter 4-bit model is about 8.5–9GB, so an 8GB card needs a compressed context to fit it.
    • Change the architecture: pick a Mixture-of-Experts (MoE) model with a small number of activated parameters—for example, one that activates only about 3 billion parameters per token. It’s slower but usable.
    • Accept the performance: settle for 5–8 t/s, suitable only for non-urgent batch jobs, offline summarization, format conversion, and similar tasks.

    4. Two easily overlooked details

    • Concurrency and context: the default concurrency and context length in local inference frameworks consume extra VRAM. Lowering the context length before you start often frees up enough room to fit more layers.
    • Distorted monitoring readings: if the desktop OS has a shared-VRAM mechanism enabled, the total usage shown in the GPU monitor gets “inflated” by system memory. It looks like the model fits, but very few layers are actually resident. Only the dedicated-VRAM column is accurate.

    5. Practical recommendations

    The troubleshooting order should be disprove first, then locate, then optimize—don’t start by tweaking quantization parameters. If you want to bring local inference into a production pipeline, consider storing model files in object storage, deploying the runtime uniformly through a container platform, collecting the offloaded-layer count via a logging service, and using monitoring alerts to watch dedicated VRAM usage and token generation rate. For capacity planning, treat a hard constraint that the sum of “weight size + context cache + concurrency overhead” must not exceed dedicated VRAM.

    Test environment note: the 8-billion-parameter figures were measured on a local machine, each repeated 2–4 times; the 30-billion-parameter tier was estimated from weight size and was not actually run on an 8GB GPU. Hardware: an 8GB laptop discrete GPU + a mobile high-performance CPU + 32GB of memory.