Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

When a GGUF model triggers a CUDA out-of-memory (OOM) error, first identify whether it fails while loading, during prompt prefill, or later under serving traffic. Then reduce memory demand in this order: context size, server parallelism, and—if needed—the number of GPU-offloaded layers. The right settings depend on the model, quantization, context, concurrent requests, available VRAM, and llama.cpp build; there is no universal VRAM requirement.

First identify when the CUDA OOM occurs

A load-time failure, a failure during prompt prefill, and an error during generation or server traffic can reflect different memory pressure. Before changing settings, record the exact command, llama.cpp version or build, GGUF file and quantization, GPU model, and available VRAM. Note whether the error occurs as weights load, during prefill, or only after requests begin.

Check the startup log and confirm which devices the binary sees with --list-devices. The llama.cpp server documentation describes this option along with --n-gpu-layers. If the GPU is not being used as expected, possible causes include setting GPU layers to zero or too low, hiding devices with CUDA_VISIBLE_DEVICES, or using a build without the relevant backend. Close avoidable GPU workloads as a diagnostic, but do not assume that will solve every OOM: available memory also depends on runtime configuration and other processes.

Reduce context size to lower KV-cache demand

Try a smaller context using --ctx-size or its short form, -c. The KV cache holds information used to process and generate tokens, and llama.cpp’s multi-GPU guide says its use is roughly proportional to n_ctx. A smaller context can therefore reduce cache demand, at the cost of accepting shorter prompts or less conversation history.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
  • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
  • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
  • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
  • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
  • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.

For a server workload that reports an OOM during startup or prefill while using tensor split mode, the guide’s mitigation sequence starts by lowering context size. Make one change at a time and check whether the failure point moves or disappears.

For llama-server, reduce parallel requests

If you are running llama-server and a smaller context is not enough, lower --parallel, also shown as -np. The multi-GPU guide explains that the server allocates a KV-cache slot for each concurrent sequence. Allowing fewer sequences at once can reduce cache demand; it does not reduce the memory required for model weights, and it also reduces serving concurrency.

Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Reduce the number of GPU-offloaded layers if needed

If context and server parallelism do not resolve the problem, reduce --n-gpu-layers (or -ngl). This option controls how many model layers are stored in VRAM. Keeping fewer layers on the GPU can relieve VRAM pressure, but layers left on the CPU can make inference much slower. The server documentation also lists auto and all as supported values; confirm the accepted values and behavior in the installed build rather than assuming that a setting documented on the project’s current master branch applies to every release.

The server README documents --fit as an auto-fit option that adjusts unset arguments to fit device memory, with a target margin by default. Verify its behavior for your version and avoid combining assumptions from different releases. In the documented server options, auto-fit is enabled by default, but the multi-GPU guide says it is unsupported in tensor split mode.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

Choose a multi-GPU split mode that your build and model support

When more than one GPU is available, llama.cpp documents several ways to distribute work. The modes differ in what they distribute and in their compatibility requirements.

Split mode How it distributes work Important qualification
none Uses one GPU. Does not distribute work across GPUs.
layer Spreads layers and KV across GPUs. The documented default mode for multi-GPU use.
row Divides weights by rows. Confirm suitability for the model and installed build.
tensor Splits weights and KV across GPUs. Experimental and subject to architecture, attention, and KV-cache restrictions.

Use --tensor-split to set comma-separated proportions for the selected devices. For example, 3,1 represents relative proportions, not a guarantee that a workload will fit or perform well. Device availability, build support, and hardware determine what distribution is usable. The multi-GPU guide describes these modes and their constraints.

Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Check tensor-mode requirements before using it

  • The guide says tensor split requires flash attention.
  • It supports only non-quantized KV-cache types: f32, f16, or bf16. Attempting a quantized KV cache results in an error.
  • Tensor split is not implemented for every model architecture. Check the guide’s architecture restrictions; use the documented layer split as a fallback if the model is unsupported.
  • Auto-fit is unsupported in tensor split mode, so manually reduce settings such as context size until the workload fits.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Account for performance and stability tradeoffs

  • Smaller context: reduces KV-cache demand but limits the prompt or conversation history you can use.
  • Lower server parallelism: reduces cache demand from concurrent sequences but also reduces simultaneous serving capacity.
  • Fewer GPU layers: keeps more layers on the CPU, which may allow a workload to run but can substantially slow inference.
  • Multiple GPUs: performance depends on interconnect and build support. The guide notes that missing NCCL lowers multi-GPU performance in tensor mode.
  • CUDA peer-to-peer: enabling it is opt-in and can cause instability on some motherboard and BIOS configurations. If problems begin after enabling it, unset GGML_CUDA_P2P.

A practical order for testing changes

  1. Capture the failing command, build, model and quantization, GPU details, available memory, and exact failure phase; use --list-devices to check device visibility.
  2. Lower --ctx-size (-c) and retry.
  3. If the failure is in llama-server, lower --parallel (-np) and retry.
  4. If memory is still insufficient, lower --n-gpu-layers (-ngl), accepting that CPU-resident layers may slow inference.
  5. For multi-GPU use, confirm the selected split mode and any requirements against the installed version and model architecture. In tensor mode, do not rely on auto-fit; adjust settings manually.

Change one setting at a time and recheck the logs. This makes it easier to tell whether the limiting factor was cache demand, GPU layer placement, device visibility, or split-mode compatibility.

Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.