Why Your Local LLM Runs on CPU Instead of GPU

    This article explains why a local LLM may be detected on the GPU yet still run on the CPU, with GPU utilization near zero. It breaks down five common root causes—insufficient VRAM triggering layer offloading, backend and architecture mismatches, incomplete operator coverage with frequent host synchronization, overly conservative wrapper defaults, and environment or resource contention—and provides a step-by-step troubleshooting order and capacity planning tips.

    1. The Symptom: VRAM Is Used, but Compute Happens on the CPU

    Many developers run into a puzzling situation after loading a quantized 8B or 14B model locally: the GPU is recognized and a few hundred MiB to one or two GB of VRAM is occupied, yet GPU utilization in Task Manager stays close to 0% while CPU usage is maxed out and generation speed drops to single-digit tokens/s.

    This is not a broken GPU or a missing driver. Rather, the inference framework has made conservative decisions on two questions: whether the GPU can be used, and how much of the workload should run on it. To understand this, break a single inference pass into three steps: where model weights and the KV cache are stored, which backend executes the matrix multiplications, and which operators can run on the device. If any one of the three falls back to the CPU, the whole system behaves as if “the GPU is sleeping.”

    2. Root Cause 1: Insufficient VRAM Triggers Layered Offloading

    The most common cause is simply that the model does not fit. The VRAM required for inference is not equal to the model file size, but rather:

    1. Total VRAM demand ≈ weights + KV cache + compute buffers + context reserve
    2. KV cache ≈ 2 × num_layers × hidden_dim × context_length × batch_size × bytes_per_value

    A 14B model at 4-bit quantization takes roughly 8–9GB for weights, which seems to fit into a 12GB GPU. But once you add a context length above 8K, a larger batch size, and the temporary buffers used during inference, the total exceeds the available VRAM. The framework then places the overflow in system memory, producing layered execution where “some layers are on the GPU and some on the CPU.” Because layers have serial dependencies, the CPU portion becomes the bottleneck and the GPU spends most of its time waiting, so utilization stays low.

    A typical signal is a log message stating that the first N layers were assigned to the device while the remaining layers stay on the host, or VRAM usage that stops right around the available capacity. There are only three fixes: shorten the context and batch size, switch to a lower-bit quantization, or move to a device with more VRAM.

    3. Root Cause 2: Backend Capability and Compiled Architecture Mismatch

    The second cause is more subtle: the framework does want to use the GPU, but the acceleration backend in the current runtime does not support this card, or was not compiled with support for it at all.

    An illustrative log snippet looks like this:

    1. found 1 CUDA devices (Total VRAM: 11907 MiB)
    2. compute capability: 8.6
    3. selected platform: 'NVIDIA CUDA'
    4. Unsupported GPU: <device>
    5. drop unsupported device.
    6. system_info: n_threads = 16 | CUDA: ARCHS = 750,800,860,890,1200,1210
    7. using device CUDA0

    Two points matter here. First, the acceleration backend enumerates devices during initialization and validates their capabilities; if a device’s compute capability is not in the supported list, it is dropped outright and execution falls back to the CPU. Second, the set of architectures a backend supports is fixed at compile time, so a newer card cannot be enabled at runtime if the installed package does not include its architecture. Also, the same card may be enumerated by multiple backends, and the framework keeps one and skips the rest—this is normal deduplication, not a fault.

    The checks are straightforward: confirm the acceleration backend is correctly installed and is a GPU build, confirm its compiled architectures cover your device, and confirm the driver and runtime versions match. If any one of the three is missing, the GPU path will not take effect.

    4. Root Cause 3: Incomplete Operator Coverage and Frequent Host Synchronization

    Even when the backend is available, it does not mean the entire compute graph can run on the device. Operators such as attention implementations, positional encoding, normalization, sampling, and dequantization may lack efficient implementations in the current backend and instead run through compatibility paths, generating large volumes of data copies between host and device. Each copy goes through limited transfer bandwidth and breaks the pipeline, leaving the GPU idle again and again.

    To diagnose this, enable detailed per-layer or per-operator logging and look for many “fallback to host” entries, or use a profiler to see whether time is concentrated in memory copies rather than matrix multiplications. Possible responses include upgrading to a runtime version with more complete operator coverage, reducing context length to lower attention overhead, and disabling unnecessary parallelism and batching features.

    5. Root Cause 4: Conservative Defaults in Wrapper Layers

    Many out-of-the-box local inference wrappers place most layers on the CPU by default, or default to a very small context, so they do not crash on ordinary laptops. They are essentially a layer over the underlying inference engine, expose only limited tuning options, and make it hard for users to precisely control layer allocation, batch size, thread count, and backend selection.

    So when you see “the card is recognized but not fully used,” the most effective path is not to reinstall the wrapper repeatedly, but to tune the underlying inference engine directly: explicitly specify the device, explicitly set the number of layers offloaded to the GPU, explicitly set context and batch size, and run controlled comparisons with the same input. Running a 30B-class sparse-activation model on 12GB of VRAM is not impossible with reasonable quantization and a moderate context—the key is whether the parameters are properly opened up.

    6. Root Cause 5: Runtime Environment and Resource Contention

    Another easily overlooked factor is that the device is occupied by other processes, not passed through inside a container, or inaccessible due to missing device permissions in the session; thermal and power limits may also cause downclocking, and memory bandwidth may be taken by other tasks. All of these can make the GPU path “nominally enabled but effectively useless.” For containerized deployments, explicitly mount the device and driver, and monitor VRAM, utilization, temperature, and power curves together rather than drawing conclusions from a single metric.

    Recommended order, from lowest to highest cost:

    1. Check the device enumeration result in the logs to confirm the card was kept rather than dropped;
    2. Check the layered allocation records to see how many layers actually landed on the device;
    3. Use the formulas to estimate the sum of weights, KV cache, and buffers, and judge whether capacity is exceeded;
    4. Verify the acceleration backend’s architecture coverage and version match;
    5. Enable detailed logs to check for operator fallback and host synchronization;
    6. Finally, check permissions, container passthrough, and resource contention.

    For capacity planning, reserve at least one to two GB of headroom for the KV cache and temporary buffers, set context length to actual needs rather than maxing it out, and choose a lower-bit quantization within an acceptable quality range. If local VRAM is truly insufficient, you can store model files on shared storage or object storage and load them into a compute instance on demand, combined with container platforms and monitoring/alerting services for elastic scaling—a common general practice on cloud platforms such as Baidu AI Cloud.

    8. Conclusion

    “A GPU that is recognized but runs on the CPU” is almost always the combined result of five constraints: capacity, backend, operators, parameters, and environment. Verify the inference chain in three layers—where things are stored, who computes, and whether computation is complete—and most issues can be located within ten minutes.