What this thread does
Do first: inspect the selected device and actual offload log after setting --n-gpu-layers, before interpreting the machine's shared-memory total.
Short answer
As of November 2026, this card follows current llama.cpp server/build docs. Two separate repair landmarks matter: b8361 makes an unsupported APU memory hint nonfatal; superm1's PR #27083 skips the UMA override for HIP builds on Linux in commit 60eeeb6.
Choose / don't choose
- HIP/ROCm: choose GPU acceleration on HIP-supported AMD GPUs; follow the HIP build guide. Don't copy an architecture override from another GPU.
- Vulkan: choose a supported driver path when HIP support is unsuitable, or when the same workload measures better; follow the Vulkan guide. Don't infer backend performance from nominal shared RAM.
Not for: LM Studio device-loss recovery; see llama-cpp-lm-studio-assert-device-lost-plugin-errors.
Settings that matter
| Setting or flag | Value / default | Applies to | Source |
|---|---|---|---|
--n-gpu-layers | Exact layer count, auto (default) or all; use all only if full offload fits. Confirm the actual logged fraction | Current server | Server |
--ctx-size | Default 0 loads model context; set a supported smaller explicit context when KV allocation dominates | Current server | Server |
--cache-type-k / --cache-type-v | Default f16; q8_0 and q4_0 are listed lower-precision alternatives. Check model/backend compatibility and output quality | Current server KV cache | Server |
--ubatch-size | Physical batch limit; default 512. Reduce it when compute buffers, rather than weights, hit allocation limits | Current server | Server, allocation report |
--parallel | Default auto (-1); set an explicit supported slot count and inspect total/per-slot context before estimating KV requirements | Current server | Server |
GGML_CUDA_ENABLE_UNIFIED_MEMORY | 1 enables main-memory sharing between CPU and integrated GPU on Linux; it can hurt non-integrated GPU performance | Current HIP build guidance | Build guide |
Order of operations
1. Record build/backend, driver, physical RAM, GPU allocation limits and the exact GGUF. Read the model's device placement, offloaded ... layers to GPU and model buffer sizes by backend buffer name (model source). Full offload is a count to confirm, not a universal magic layer number. 2. Fix context, slots, batch and KV types; collect weight, KV and compute-buffer allocations at those settings. Budget unique resident weights plus retained host copies, KV cache, compute/graph buffers, other processes and OS headroom. Respect both physical total and backend per-buffer limits. Changing KV precision/context leaves model weights unchanged, but may affect quality or usable context. 3. Distinguish an allocation-limit message from total exhaustion. ratcampaign's Strix Halo report shows KV allocation and a failing compute buffer. More free RAM alone does not fix a driver/API maximum allocation. Reduce the responsible context/batch allocation or compare a supported HIP route; the historical report is not a universal current Vulkan ceiling. 4. Compare identical model, prompt length, generation length and context depth across HIP/Vulkan and layer counts. The llama-bench reference accepts comma-separated -ngl counts and reports prompt processing separately from token generation. Also measure the actual application's latency; its tokenizer/sampling overhead is outside that benchmark.
Known failures and fixes
| Error (short quote) | Cause | Fix | Source |
|---|---|---|---|
Requested buffer size exceeds device memory allocation limit: ErrorOutOfDeviceMemory | An individual Vulkan buffer exceeds the reported allocation limit | Identify the failing KV/compute/weight buffer; reduce its allocation or compare a supported alternative backend | ratcampaign #15009 |
hipErrorInvalidValue | On AMD APU/iGPU devices, hipMemAdviseSetCoarseGrain returns hipErrorInvalidValue | Use the release’s fix treating the hint as optional | b8361 note |
| Free capacity appears too small (symptom) | The issue reports available GPU memory limited to system RAM’s MemAvailable, ignoring larger AMD APU TTM allocation | On Linux, use a build containing 60eeeb6 and compare the same log again | AmesianX #18159, superm1 repair |
TheDarkTrumpet's discussion #18839 shows another misleading counter: shared memory: 65536. 0cc4m explains it is workgroup-local memory in bytes, unrelated to model VRAM capacity. Inspect the actual device/free-memory line instead.
Missing
- Neither repair means every allocation can consume all physically free system RAM. Linux integrated-GPU UMA: consider the documented UMA setting; don't count system RAM and the iGPU carveout as independent physical capacities. A proposed issue-only environment variable is not a released fix.
- No model, RAM size, context, concurrency or runtime logs identify this particular machine. An exact GiB budget and winning backend cannot be stated; collect the allocation ledger above.
- These reports do not establish a universal safe GTT reservation, Vulkan allocation size or HIP speed advantage.
Checked
2026-11-12; server/build/model/benchmark references, b8361 note, PR #27083 and dated reports by ratcampaign, AmesianX and TheDarkTrumpet read. No model load or hardware benchmark executed.
Started from a post by @ggml-org, packaged by the editor. Original post