Repository navigation
Description
A Firebase Test Lab pilot of the actual Flutter/llamadart application crashed on the first GGUF Vulkan generation on a physical Galaxy S24. CPU generation completed beforehand. This is a native crash investigation; the stack identifies the failing path but does not yet establish whether the origin is the driver, upstream llama.cpp, the packaged artifact, or consumer integration.
Reproduction inputs
- Observed 2026-09-16; llamadart main commit
a5df1c4fcbb1766d26efb5b1d9becda191df89a3, llama.cpp artifactv0.4.0. - Flutter 3.47.1 / Dart 3.13.1, Android Debug APK, arm64, both runtime families included. Package inference code was unmodified; the pilot only added a Flutter integration-test wrapper.
- Firebase physical model
SC-51E, Galaxy S24, API 36 / Android 16, Adreno 750. - Build fingerprint:
samsung/SC-51E/SC-51E:16/BP2A.250605.031.A3/SC51EOMS1CZB4:user/release-keys. - Model: stories15M.gguf at pinned revision, 98,357,920 bytes, SHA256
61b50d457809a5194818fd22e6724b456cd7bb9a6264c52c8110684c53f3704a. Download hash verified on device.
Using package:llamadart/llamadart.dart and a local path to that model:
final engine = LlamaEngine(LlamaBackend());
await engine.setNativeLogLevel(LlamaLogLevel.info);
await engine.loadModel(modelPath, modelParams: const ModelParams(
contextSize: 1024,
numberOfThreads: 4,
numberOfThreadsBatch: 4,
gpuLayers: ModelParams.maxGpuLayers,
preferredBackend: GpuBackend.vulkan,
));
await for (final piece in engine.generate(
'Once upon a time',
params: const GenerationParams(maxTokens: 32, temp: 0, seed: 1),
)) {
print(piece);
}
await engine.dispose();The observed execution first ran the CPU configuration (gpuLayers: 0, preferredBackend: GpuBackend.cpu) through one warm-up and three generations, disposed that engine, then created the Vulkan engine. A fresh-process GPU-only reproduction is still needed to separate standalone failure from prior CPU initialization effects. No successful Release-build or second-device Vulkan control has been collected yet.
Expected and actual
Expected: nonempty streamed generation, a clean completion, and evidence of actual GPU offload.
Actual: load returned and reported Vulkan; the first generation killed the app with SIGSEGV / SEGV_MAPERR, fault address 0x2d0. Essential crash frames:
#00 /vendor/lib64/libllvm-qgl.so
#09 /vendor/lib64/libllvm-qgl.so CreateQGLCProgram(QGPUCompiler::CompileData*)
#12 /vendor/lib64/hw/vulkan.adreno.so
#14 /vendor/lib64/hw/vulkan.adreno.so qglinternal::vkCreateComputePipelines(...)
#15..19 base.apk native Vulkan module
#20 libggml-base.so ggml_backend_sched_graph_compute_async
#21 libllama.so llama_context::graph_compute
#22 libllama.so llama_context::process_ubatch
#23 libllama.so llama_context::decode
#24 libllama.so llama_decode
Relevant build IDs: vendor compiler e45a6c21c17a933fce15407e32a702bd; Vulkan driver 16fb0afc08003d7e9cb34edb847a0e53; packaged Vulkan module cb3986d59f53f6bdedc8bb85f9bff8173df839f5; libllama 2bf312b67373a8d028386b84581073cc8ccbfc66.
Firebase execution (project access required). CPU success is recorded in app events; the crashed overall instrumentation execution is not a passing matrix. iPhone CPU/Metal passed with the same GGUF, which does not qualify Android Vulkan.
Investigation and acceptance
- Reproduce in a fresh process on this exact device/OS, in Release and the original Debug mode; retain the CPU-before-GPU sequence as a separate case.
- Compare the same model, prompt and settings using a direct native/upstream reference at the artifact's recorded upstream revision. Preserve build flags, driver version and runtime identity.
- Cross-check a different Adreno generation and a Mali device before claiming a general Android or vendor-specific failure.
- Fix in the owning layer, or provide an explicit actionable unsupported-path policy if the combination cannot be supported. A silent CPU fallback must not count as a GPU pass.
- Add model-backed regression qualification and rerun CPU and verified Vulkan generation on the failing device after the fix.
Related qualification tracker: leehack/llamadart#476. That older-CPU/ISA coverage gap is separate from this reproduced GPU crash. No upstream defect attribution or new regression range has been established.
Activity
leehack commentedon Sep 19, 2026
Verified v0.4.1 and fresh standalone control — 2026-09-19
The crash persists on the current published v0.4.1 runtime (upstream
b29c606e28a01b1bc8c1351026a0fa6e616bf6c4). Two bounded SC-51E/API36 executions now establish:matrix-2jkcwdec9di91: CPU warmup plus three generations passed and disposed; first Vulkan generation crashed. Original corea5df1c4...and settings retained, native tag overridden to v0.4.1. This is not a current-core-main test.matrix-29hxzbl7p2w4a: same crash without Dart, Flutter/Impeller, libllamadart, or preceding CPU-only inference. The Android app loads unchanged official v0.4.1 libraries and calls llama.cpp through a minimal JNI shim. This is not a raw-upstream rebuild or a modified Vulkan backend.Both returned the original fingerprint
samsung/SC-51E/SC-51E:16/BP2A.250605.031.A3/SC51EOMS1CZB4:user/release-keys, compiler BuildIde45a6c21c17a933fce15407e32a702bd, and Vulkan driver BuildId16fb0afc08003d7e9cb34edb847a0e53.Standalone package SHA256
146c84029fee7fcc721719a04e65a6b5f68066733e314862e85f5a5342d378ed. All 11 runtime libraries match the official archive byte-for-byte; only the JNI consumer shim is newly compiled. Model hash/size match the issue. Native logs confirm 57 F32 tensors, Adreno750, and 7/7 layers actually offloaded (57.95MiB Vulkan model buffers). CPU backend remains for non-offloaded ops; no prior CPU-only model run occurred.Context settings match the original Android path: context1024, batch1024, microbatch512, threads4/4, F16 KV,
offload_kqv=false,op_offload=false, Flash Attention disabled; max GPU layers. The firstllama_decodereceived the five-token promptOnce upon a timeand crashed before prefill returned or any token was generated.Same SIGSEGV/SEGV_MAPERR at
0x2d0. Current Vulkan BuildIdb16b1f2040b472a8f57561d1cdb7f0be2f1816f4; symbolized PCs match in both v0.4.1 runs:Conclusion: Dart/wrapper lifecycle, Flutter rendering, and prior CPU disposal are not required to trigger this crash. We have not yet distinguished shader selection/configuration, artifact build, raw upstream behavior, and Qualcomm compiler compatibility. No driver-only attribution or safe fix yet. The exact selected shader/specialization remains uncaptured. All-F32 weights also mean this must not be labeled the Q4_K issue reported in upstream #28635; that report's initial NDK theory was retracted.
Next bounded investigation: same-revision pre-compilation diagnostics or upstream matrix-vector control to identify the selected F32 pipeline and then test a single configuration change against CPU correctness. Release and raw-upstream controls remain missing. No runtime pin/publication or speculative production patch made.
leehack commentedon Sep 21, 2026
Third reproduction, 2026-09-21: recent core main, Q4_0 chat model, same crash
The crash is not tied to the all-F32
stories15Mweights used in the previous two runs, and it reproduces from a recent core-main commit through the Flutter chat example. The 2026-09-19 comment flagged run 1 as "not a current-core-main test"; this run is on core4da97bc10d0b0edeb7c2d099e5daadec3264cd05, 13 commits behind today's main5cb979855(the earlier pilot'sa5df1c4…is 51 behind).Run: Firebase Test Lab matrix
matrix-1j07e6udlnhze, execution 8678470619493359905, outcomeFAILURE,A non-retryable error occurred., 2026-09-21 15:26Z.What is new
Qwen3.5-0.8B-Q4_0.gguf, 563,036,064 bytes, SHA25657d1997790d1744fba5b40a7317df71ea5e2acee28c47e78f0cce39c0703f8cf, pinned revision8fea620810c4afa23dd6443f999a48574c1611a3;general.file_type = 2in the loaded metadata;preparation.verified = trueon device. Q4_0 crashes exactly like the F32 model, so weight type is not the discriminator either way.4da97bc1…, native tagv0.4.1, bridgev0.1.44,com.example.llamadart_chat_exampledebug APK driven by thechat-gguf-vulkanvalidation profile — not the olda5df1c4…pilot and not the minimal JNI shim.chat-gguf-vulkan); of the 123 s process uptime the tombstone reports, 111.7 s was model download (preparation.download_ms = 111691).C01.loadPASS (backend_nameVulkan,reported_gpu_layers 999, context 1024, threads 4/4) andC02.unicodePASS (tokenizer only, 8 token ids) — thenC03.raw, the next case and the first generation (promptOnce upon a time), has no terminal record:reason: missing terminal record after crash/interruption. Remaining 12 casesNOT_RUN; summary recordsRun did not complete normallyandEngine cleanup did not complete.Identity with the previous v0.4.1 runs
Same
SIGSEGV/SEGV_MAPERR, fault addr0x2d0,Cause: null pointer dereference, on threadDartWorker;#09 CreateQGLCProgram(QGPUCompiler::CompileData*)→#14 qglinternal::vkCreateComputePipelines→#20 ggml_backend_sched_graph_compute_async→#23 llama_context::decode→#24 llama_decode.The five in-APK frames
#15-#19are byte-identical offsets to the ones symbolized in the previous comment:1b36a9c,1b282d4,1b81aa0,1b8df58,1b512e0(i.e.createComputePipeline→ggml_vk_load_shaders→ggml_pipeline_request_descriptor_sets→ggml_vk_mul_mat_vec_q_f16→ggml_vk_build_graph / graph_compute), under the same packaged Vulkan module BuildIdb16b1f2040b472a8f57561d1cdb7f0be2f1816f4. This tombstone also recordslibllama.soBuildIdf8700d9b6f8155c0465b9ad86ba716cb5b68e44dandlibggml-base.so1fd7cfcc3583e64f4a5c2f8d004935e44c810212. Device unchanged:samsung/SC-51E/SC-51E:16/BP2A.250605.031.A3/SC51EOMS1CZB4:user/release-keys, API 36, compiler BuildIde45a6c21c17a933fce15407e32a702bd, Vulkan driver BuildId16fb0afc08003d7e9cb34edb847a0e53.Same-day non-Adreno datum, not a qualification
iPhone 16 Pro, Metal, release build, same commit / model / native tag: all 14 cases ran, 13 PASS and one content assertion failure (
C06.history), no crash. Per this issue's own note, an Apple GPU pass does not qualify Android Vulkan.Still missing
Unchanged from the previous comment, plus one caveat specific to this run: accelerator evidence was not collected (
accelerator_evidence.verified = false,reason: native placement evidence unavailable), so this execution does not itself prove layer offload — the earlier standalone run did (7/7 layers, 57.95 MiB Vulkan buffers). Also still absent: an Android Release-mode control, a second Adreno generation, a Mali device, and the identity of the selected shader/specialization.Verified by execution: the Firebase device run above, and local reads of
native_crash.txt,logcat.crash.txt,results.jsonandmatrix.json; the commit distances viagit merge-base/git rev-list --count. Verified by reading only: the frame-to-symbol mapping, which reuses the symbolization already recorded in this issue rather than re-symbolizing this tombstone.leehack commentedon Sep 24, 2026
Blocker status, 2026-09-23: still blocked
b29c606e28. 14 of them touchggml-vulkan, and none is Adreno/Qualcomm-specific. The DMMV reduction-mode selection that picks the crashing F32 subgroup, no-shared-memory matvec pipeline is identical at the pin and at v0.5.0.v0.4.1-1rebuilds the same llama.cpp commit. It adds nothing for Vulkan.GGML_VULKAN_ADRENO_750_SHMEMoption. It has been open since 2026-09-20 with no maintainer review, and the bot flagged the PR template. The v0.4.1 variant passed on S24 (2026-09-19, matrixmatrix-1c3p43dix5mga, F32stories15M). The upstream port has not been device-qualified, and nobody has shown that the guard covers the 2026-09-21 Q4_0 Qwen3.5 crash.VK_QCOM_cooperative_matrix_conversionextension.Unblocking needs #29165 to move forward. Fill in its template, then qualify its head on S24 with both the F32 and the Q4_0 models, then mark it ready. A Firebase re-run on the current pins would only reproduce the crash; nothing has changed on that path.
Raman-Raje commentedon Sep 24, 2026
Could you the error log here...?
leehack commentedon Sep 27, 2026
Still reproduces on native v0.5.0. On Firebase Galaxy S24 (llamadart pre-release sweep at 3d6b838), the first GGUF generation (C03.raw) crashes with the same signature: SIGSEGV at 0x2d0 inside Adreno pipeline creation, same compiler and driver builds.
Second failure mode, not recorded above: when a CPU engine ran first in the same process, pipeline creation returned an error instead of crashing, and ggml-vulkan's uncaught C++ exception aborted the app (SIGABRT,
vk::SystemError ... ErrorUnknown).Raman-Raje commentedon Sep 27, 2026
@leehack could you build llama with flag DGGML_VULKAN_DEBUG=ON and share the logs here... Would be easy to understand
leehack commentedon Sep 29, 2026
@Raman-Raje thanks, here are the
GGML_VULKAN_DEBUG=ONlogs.Setup
7fe450e19). The build uses the release Android arm64 Vulkan configuration plus-DGGML_VULKAN_DEBUG=ON, and nothing else changed. Its embedded SPIR-V is identical to the release build (1031/1031 shaders). All other libraries are the unmodified official v0.5.0 bundle.Once upon a time. stderr is redirected to a file, which is how the debug output survives the crash.Result
Both models crash on the first
llama_decode, while the driver compiles the firstmul_mat_vecpipeline. The only pipeline created before it,rms_norm_mul_f32, compiles fine.stories15M, all F32 (7/7 layers offloaded):
Qwen3.5-0.8B Q4_0 (25/25 layers offloaded):
The last three fields are
disable_robustness, require_full_subgroups, required_subgroup_size. Both crashing pipelines ask for full subgroups of size 64. The pipeline that compiled does not.The crash signature is the same as in the earlier comments:
SIGSEGV/SEGV_MAPERRat0x2d0inCreateQGLCProgram←qglinternal::vkCreateComputePipelines←ggml_vk_create_pipeline_func←ggml_vk_load_shaders←ggml_pipeline_request_descriptor_sets←ggml_vk_mul_mat_vec_q_f16. The compiler and driver builds are also the same.Caveats
specialization_constants. From the v0.5.0 source, on Qualcomm the DMMV path selectsDMMV_WG_SIZE_SUBGROUP/SHADER_REDUCTION_MODE_SUBGROUP, so the SPIR-V should be the*_subgroup_no_shmemvariant, with spec constants{64, 1, 5}(F32) and{64, 2, 4}(Q4_0). This comes from reading the code; the log does not show it.Trimmed logs (the full logs are 220 KB / 570 KB, mostly per-op trace; I can share more on request):
stories15M F32: GGML_VULKAN_DEBUG log (device line, then from the last pipeline created before the crash)
stories15M F32: tombstone header and backtrace #00-#26
Qwen3.5-0.8B Q4_0: GGML_VULKAN_DEBUG log (device line, then from the last pipeline created before the crash)
Qwen3.5-0.8B Q4_0: tombstone header and backtrace #00-#26
Raman-Raje commentedon Sep 29, 2026
@leehack This is mostly due to insufficient shared memory , Is this error shown after the below fix ggml-org/llama.cpp@3423f94 or Latest release. PLease give a try with latest release
leehack commentedon Sep 29, 2026
@Raman-Raje thanks. I tested the latest release as you suggested: b11256 (
c85b92c69), which includes ggml-org/llama.cpp@3423f94. It still crashes. I also tested a wider version of our workaround.Setup matches my previous comment: Galaxy S24 (SC-51E, Adreno 750, API 36) on Firebase Test Lab, the same minimal JNI app,
-DGGML_VULKAN_DEBUG=ON, and the same settings and prompt. This time every library was built from b11256. Each model was also run on CPU in the same app as a reference.Why I don't think 3423f940e or shared memory is the cause
SIGSEGVat0x2d0inCreateQGLCProgram, at the same compiler PCs, on the same first pipelines:mul_mat_vec_f32_f32_f32, main, 5, (1,1,1), specialization_constants, 0, 1, 64mul_mat_vec_q4_0_f32_f32, main, 5, (2,1,1), specialization_constants, 1, 1, 64warp size: 64 | shared memory: 32768 | int dot: 0 | matrix cores: none. The driver doesn't seem to expose the cooperative-matrix path (I did not dump its extension list), so the 3423f940e changes, which are gated on coopmat plusVK_QCOM_cooperative_matrix_conversion, never activate. Itsggml_vk_should_use_mmvqchange doesn't matter here either, because this device has no integer dot and the crashing pipelines are DMMV.subgroup_no_shmemvariant (inferred from source), which uses no shared memory. Moving matvec onto the shared-memory reduction is exactly what makes it pass.What triggers it
All crashing pipelines have
require_full_subgroups = 1andrequired_subgroup_size = 64. A standalone per-op probe on the same device, one process per case, checked against a double-precision reference:The widened guard is still behind the default-OFF
GGML_VULKAN_ADRENO_750_SHMEMand still matches only this exact driver (vendor0x5143, driverID 8, driverVersion2150604839,Adreno (TM) 750, Android). When it matches, it setsuse_subgroups = falsefor the matrix-vector block inggml_vk_load_shaders, the same fallback upstream already uses for the Imagination proprietary driver. Every matvec pipeline then uses the existing shared-memory reduction, with no full-subgroup-64 requirement.A separate problem that remains
On this driver, q8_0, q2_K–q6_K, iq4_xs and iq3_s matvec give wrong results (relative error 0.06–0.31) in every build, including unpatched upstream. q4_K at 1 column also fails pipeline creation with
VK_ERROR_UNKNOWN. A SmolLM2-135M Q4_K_M end-to-end run fails that way, without crashing. This does not depend on the reduction mode, the subgroup flags or the workgroup size, so it looks like a separate driver issue. I have not confirmed that on another Vulkan implementation.Driver details, from
vkGetPhysicalDeviceProperties2: vendor0x5143, driverID 8, driverVersion2150604839, driver buildc81b28e1a5(06/20/25), compilerE031.45.02.26.Runs used flash attention off and
offload_kqv=false, so flash-attn/topk/ssm and other subgroup-64 pipelines were not exercised.gated_delta_net_f32_d128(subgroup 64) compiled and ran fine on Qwen3.5.Next
build: skip a patch that does not fit the llama.cpp being built
leehack commentedon Oct 29, 2026
Retest on llama.cpp v0.8.0, 2026-10-29: no crash with patch 0001, but wrong F32 output on Vulkan
Galaxy S24
SC-51E, Android 16 / API 36, Firebase Test Lab. The driver is unchanged: Adreno (TM) 750, vendor0x5143, driverID 8, driverVersion2150604839, buildc81b28e1a5, compiler BuildIde45a6c21c17a933fce15407e32a702bd.Harness: the standalone JNI app on the llama.cpp C API, with each case in a fresh process. Settings: ctx 1024, batch 1024, ubatch 512, F16 KV, flash attention off,
offload_kqv=false,op_offload=false, every layer on the GPU, promptOnce upon a time, 32 greedy tokens. Vulkan output is compared with CPU.Builds:
main5092f19with llama.cpp8642541b, built locally with the release recipe (tools/build.py android --backend vulkan, NDK 28.2, Ubuntu 24.04glslc 2023.8-1build1). Built once as shipped (patches 0001–0003) and once without 0001.Without the patch, v0.8.0 crashes exactly as before:
SIGSEGVat0x2d0,libllvm-qgl.sopcde2fb0→CreateQGLCProgram→vkCreateComputePipelines→ggml_vk_load_shaders→ggml_vk_mul_mat_vec_q_f16, on the first prefill. Upstream still has no fix, so patch 0001 stays.New: with the patch, F32 Vulkan output is wrong on v0.7.0 and v0.8.0, although the same patch on b11256 matched CPU 32/32. On v0.8.0,
GGML_VK_DISABLE_FUSION=1makes stories15M equal to CPU (32/32). Turning off graph optimization, async, or descriptor reuse, or prefilling one token at a time, does not help (run). So a fused Vulkan op that arrived or changed after b11256 computes wrong results on this driver. Which op it is has not been identified.What this means:
Evidence:
llamadart-evidence/issue-79-v080/.leehack commentedon Oct 30, 2026
The wrong F32 output is the RMS_NORM_MUL fusion (rms_norm.comp with multiply), 2026-10-29
Same S24 and driver as before. The build is a local v0.8.0 build from the release recipe, with patch 0001. Each case runs in a fresh process, and output is compared with CPU.
rms_norm.compin the v0.8.0 buildrms_norm.comp(#30145) in the v0.8.0 buildRMS_NORM_MUL_ADDandRMS_NORM_MUL_ROPEfail with a broadcast weight at ne0 511 and 16385 (ERR 1.4–1.9). Plain RMS_NORM passes. Mali passes everything with the same SPIR-V, which points to the Adreno shader compiler.MUL_MATq8_0 is wrong at n=5–8, and q4_K mul_mat_vec fails pipeline creation.Routing this driver to CPU (leehack/llamadart#996) stays, because of the K-quant defect. A driver-gated disable of the RMS_NORM+MUL fusions inside patch 0001 is prototyped (above) but not applied. Evidence:
llamadart-evidence/issue-79-v080/fusion-diag/.leehack commentedon Oct 30, 2026
Published v0.8.0 android-arm64 on Galaxy S24 (Adreno 750, SC-51E, Android 16), new affected models. Soprano F16 on Vulkan returns the same non-speech PCM for all 4 inputs and runs to its 512-frame limit, silently, with finite non-silent samples: an output failure, not a crash. LFM3-1.7B Q4_K_M throws at the first decode:
compute pipeline creation failed for matmul_quant_f32_f16acc_aligned_0: ErrorUnknown. Same harness on Mali-G715 and Xclipse 530 Vulkan: both correct. The S24 CPU path is correct for both models. Not rerun withGGML_VK_DISABLE_FUSION. Evidence:llamadart-evidence/v080-qualification/ftl/s24-r2,s24-r3.leehack commentedon Nov 26, 2026
Candidate PR #241 retires carry 0001 for llama.cpp v1.1.0. Upstream #30826 (
8bf88ba9, in v1.1.0) setssubgroup_arithmetic = falseforvk::DriverId::eQualcommProprietary, which disables the subgroup-reduction dequantmul_mat_vecshaders the patch avoided. This is not retirement evidence by itself. Required before release: on SC-51E/API36 (Adreno 750, driver2150604839, buildc81b28e1a5), old unpatched FAIL / old patched PASS / candidate unpatched PASS with stories15M F32 and Qwen3.5-0.8B Q4_0 multi-token prefill, plus Adreno decode throughput against v1.0.0 (the upstream change also turns off ADD+RMS_NORM fusion on every Qualcomm proprietary driver). If the candidate unpatched run fails, restore 0001 from git history. Gate recorded indocs/v110_qualification.md. This issue stays open.