NvMap allocator crashes + SBSA-targeted CUDA runtime in nvidia-ai-iot/llama_cpp container on Jetson Orin Nano (JetPack 7.2 / 7.2.1)
Summary
Update: since drafting this report, we found and verified a fix for our specific crashes —
newer llama.cpp build flags (--fit off --ctx-size <explicit value> --cache-ram 0) eliminated
the failures entirely across 60+ consecutive requests. The SBSA/CUDA-target finding below was
not the actual cause of our crashes (a genuinely Tegra-native rebuild hit the identical
failure with default flags), but we’re still sharing it since it’s a real, independently
verified discrepancy that seems worth knowing about regardless.
Running a vision-language model (Gemma 3 4B, multimodal) via the officially published
ghcr.io/nvidia-ai-iot/llama_cpp:latest-jetson-orin container on a Jetson Orin Nano 8GB, we with Claude AI
found that the container’s bundled CUDA 13.0 runtime is built for the sbsa-linux target —
the server-class ARM target — rather than a Tegra-specific one, on both JetPack 7.2 GA and
7.2.1. We’re flagging this in case it’s relevant to others, even though it turned out not to be
the cause of the reliability issue we were originally investigating.
Environment
- Hardware: Jetson Orin Nano 8GB Developer Kit (P-Number p3767-0005)
- JetPack tested: 7.2 GA (L4T r39.2.0,
REVISION: 2.0) and 7.2.1 (L4T r39.2.1,
REVISION: 2.1) — both flashed via the ISO installer method, confirmed via
/etc/nv_tegra_releaseandnvidia-l4t-corepackage version - Power mode: MAXN_SUPER (
nvpmodel -m 2) - Container:
ghcr.io/nvidia-ai-iot/llama_cpp:latest-jetson-orin, run with
--runtime nvidia --network host - Model:
ggml-org/gemma-3-4b-it-GGUF(multimodal — loads with a separate mmproj vision
projector;--hf-filemust be omitted or automatic mmproj loading breaks) - Server config:
llama-server --hf-repo ggml-org/gemma-3-4b-it-GGUF --port 8080 --host 0.0.0.0
(defaultn_slots=4,kv_unified=true,n_ctx_slot≈16640-22528depending on run) - Workload: single-stream, sequential HTTP requests only (one image + text prompt per
request via/v1/chat/completions), no concurrency
The SBSA CUDA target finding
Inside the container, on both JetPack versions tested:
$ docker exec llama-cpp-ocr find / -iname "libcudart.so*"
/usr/local/cuda-13.0/targets/sbsa-linux/lib/libcudart.so
/usr/local/cuda-13.0/targets/sbsa-linux/lib/libcudart.so.13
/usr/local/cuda-13.0/targets/sbsa-linux/lib/libcudart.so.13.0.88
Identical CUDA version and target path on both r39.2.0 and r39.2.1 — meaning this is a property
of the published container image, not something a host OS point release changes. Given
JetPack 7’s SBSA alignment is documented as being specifically for Jetson Thor (server-class
ARM hardware), and the Orin Nano is Tegra unified-memory hardware, we’re unsure whether an
SBSA-targeted CUDA runtime is expected to work correctly on Orin under JetPack 7’s “unified
CUDA 13 across targets” packaging, or whether this container should be shipping a
Tegra-specific build instead. We also noticed dusty-nv/jetson-containers issue #1286
independently describes exactly this SBSA vs. Tegra-aarch64 detection ambiguity as still
unresolved in NVIDIA’s own container tooling under JetPack 7, which is why we suspect this may
not be isolated to our container.
Observed crash behavior
Two distinct, directly distinguishable failure signatures, both reproduced on both JetPack
versions:
Signature A — NvMap allocator failure (exit 139, SIGSEGV), fails despite free memory:
NvMapMemAllocInternalTagged failed: error 12
Failed ioctlCmd: 1075858947
NvMapMemHandleAlloc failed: error 12
ggml_backend_cuda_buffer_type_alloc_buffer: allocating 100.77 MiB on device 0: cudaMalloc failed: out of memory
ggml_gallocr_reserve_n_impl: failed to allocate CUDA0 buffer of size 105662592
graph_reserve: failed to allocate compute buffers
Occurs with substantial memory genuinely available at the time — confirmed via both free -h
(5.4GB free / 5.5GB available) and continuous monitoring of mem_available (~1.1-1.3GB) at the
moment of failure. A ~100MB allocation failing with gigabytes free is consistent with address
space fragmentation rather than exhaustion.
Signature B — Linux OOM-kill (exit 137, SIGKILL), genuine memory pressure:
Occurs when mem_available has declined to ~37-102MB. Continuous monitoring (free -m polled
every 3s across full container lifetimes) shows a steady, roughly monotonic decline in
available memory across each container instance’s entire lifetime — not fluctuating around a
stable baseline between requests, but trending downward request after request from a
post-load peak of ~1.1-1.3GB down toward zero, over roughly 2.5-4 minutes / ~9-10 sequential
requests, at which point one of the two signatures above occurs.
Ruled out as an explanation: the model reloading per request. docker logs shows
loading model / loaded multimodal model exactly once per container lifetime; the
slot print_timing output’s graphs reused counter climbs steadily across successive requests
within the same instance (98 → 195 → 325 → 422 → 483 → 580 → 676 → 773), confirming cached
computation graphs are being reused, not rebuilt.
Ruled out as a contributing factor: desktop/display-manager overhead. Disabling the GUI
(systemctl set-default multi-user.target) removed the ~57-58MB of Xorg/gnome-shell/mutter
NvMap allocation (confirmed via /sys/kernel/debug/nvmap/iovmm/clients), but the crash-time
mem_available floor was unchanged (~37-102MB either way).
Not yet tested: whether reducing --slots from the default 4 to 1 (matching our actual
sequential-only, non-concurrent usage pattern) changes the decline rate — we suspect KV-cache
slot retention may be part of what’s not fully releasing between requests, but haven’t isolated
this yet.
Relation to existing forum threads
We found what looks like the same underlying error signature reported in two other threads,
but neither exactly matches our setup, so we’re unsure if it’s the same root cause:
- Intermittent NvMapMemAlloc error 12 and CUDA allocator crash during PyTorch inference on
Jetson Orin Nano —
PyTorch/YOLO workload, JetPack 6.2.1. Includes an NVIDIA moderator (AastaLLL) response noting
“this issue is related to the r36.4.7 update and has a failure rate… our internal team is
working on the issue” (referencing a related Ollama thread). This is JetPack 6.x, not 7.x,
and CNN/vision inference rather than an LLM/VLM server. - NvMapMemHandleAlloc error 12 in Llama.cpp model load when upgrading to JetPack 35.6.x —
llama.cpp specifically, but JetPack 5.x (L4T 35.6.x), and the reported failure is at model
load time, not after N successful requests as we observe.
Neither thread covers JetPack 7.x, and neither describes the request-count-dependent pattern or
the two-signature split we’re seeing. If this is a known, already-tracked issue under a
different thread, a pointer there would save us duplicating effort.
Questions for the NVIDIA team
- Is the
sbsa-linux-targeted CUDA 13.0 runtime inghcr.io/nvidia-ai-iot/llama_cpp:latest-jetson-orin
expected/correct for Orin Nano under JetPack 7.x, or should this container be shipping a
Tegra-specific CUDA build? Is this related to the SBSA/tegra-aarch64 detection ambiguity
tracked industy-nv/jetson-containers#1286? - Is the r36.4.7-era NvMap regression (acknowledged in the PyTorch/Ollama thread above) known
to still be present under JetPack 7.2/7.2.1, or is what we’re seeing a distinct issue that
happens to share the same error code? - Is there a known interaction between
llama-server’s multi-slot KV-cache management
(n_slots=4,kv_unified=true) and NvMap allocation/reclamation that would explain the
steady, non-reclaiming decline in available memory across a container’s lifetime, independent
of request content?
Artifacts available on request
- Full
docker logs --timestampsoutput spanning multiple crash events (both signatures), on
both JetPack versions restart-log.csvwith exact crash timestamps, exit codes, and uptime-before-failure for all
observed events- Continuous memory monitor logs (system RAM, Docker cgroup memory, and
/sys/kernel/debug/nvmap/iovmm/clientsoutput, polled every 3s across full test runs) - A synthetic, reproducible 20-case test harness (Python, no real/sensitive data) that
reliably triggers the failure under sequential load within a single run