Skip to content

QNN HTP fails to initialize on Snapdragon 8 Elite (SM8750P) — native “No Snapdragon SOC detected” / transport error 4000 #21586

Closed

Description

@ivaylo681-dev

🐛 Describe the bug

Hello!
I am opening the topic here as closing the old one (seems the old was on a wrong place).

The failure that I have is with identical failure signature as #16465 (QnnDsp: No Snapdragon SOC detected → error 4000), but on a different sun-platform device (my soc_id=639 confirmed via /sys/devices/soc0/soc_id).
In the thread that I have found it has been replied that the issue for soc_id=705 will be fixed in qnn-runtime 2.43.0. I am already with the newest version 2.48.0, but as my soc is different version of 7850 seems the problem is not solved for it.
Adding here the full description and I will be really gratefull for any help!

Summary

On a Snapdragon 8 Elite (SM8750P) Android device, the Hexagon HTP backend fails to initialize via QNN, regardless of which framework or SDK version is used to reach it. The failure occurs deep inside Qualcomm’s native QNN libraries — at DSP SoC-detection / transport-initialization — not in any application-level or third-party framework code. This has been reproduced identically through two independent, unrelated frameworks (ONNX Runtime’s QNN Execution Provider, and TensorFlow Lite’s QNN delegate), both calling into the same underlying QAIRT native libraries, both failing at the same point with the same error codes.

Device

• SoC model: SM8750P (adb shell getprop ro.soc.model)

• Board platform: sun (adb shell getprop ro.board.platform)

• Hardware: qcom

• OS: Android 16, MIUI/HyperOS (Xiaomi)

• Native QNN libs present on device (confirmed via run-as ls -la on installed APK): libQnnHtp.so, libQnnHtpV68/V69/V73/V75/V79/V81Skel.so + matching Stub.so, libQnnSystem.so — all present, correctly loaded (confirmed via nativeloader log: Load .../libqnn_delegate_jni.so ... ok)

Reproduction 1 — ONNX Runtime QNN Execution Provider

Using onnxruntime-android-qnn (tested versions 1.27.0 and 1.28.0, identical result on both):

val qnnOptions = OrtSession.SessionOptions().apply {

addQnn(mapOf(

"backend_path" to "libQnnHtp.so",

"profiling_level" to "detailed"
))

}

createdSession = ortEnv!!.createSession(modelBytes, qnnOptions)

Result — session creation does not throw, but GetCapability() silently assigns 100% of graph nodes to CPU:

W onnxruntime: [qnn_backend_manager.cc:1680 SetupBackend] Failed to setup so cleaning up

E onnxruntime: [qnn_execution_provider.cc:1046 GetCapability] QNN SetupBackend failed Failed to create device. Error: QNN_DEVICE_ERROR_INVALID_CONFIG: Invalid config values

Confirmed via enableProfiling() trace inspection: every node across multiple full inference passes shows "provider": "CPUExecutionProvider"; zero occurrences of “QNN” in the raw trace JSON.

Reproduction 2 — TensorFlow Lite QNN delegate (independent framework, same device, same app process)

Using com.qualcomm.qti:qnn-litert-delegate:

val options = QnnDelegate.Options()

options.setBackendType(QnnDelegate.Options.BackendType.HTP_BACKEND)

options.setSkelLibraryDir(context.applicationInfo.nativeLibraryDir)

val qnnDelegate = QnnDelegate(options)

val tfliteOptions = Interpreter.Options().apply { addDelegate(qnnDelegate) }

val interpreter = Interpreter(tfliteModel, tfliteOptions)

Result — this surfaces the real native failure, at the QnnDsp layer, independent of ORT entirely:

E QnnDsp: QnnDsp loadRemoteSymbols failed with err 4000

E QnnDsp: QnnDsp Failed to create transport for device, error: 4000

E QnnDsp: QnnDsp Failed to load skel, error: 4000

E QnnDsp: QnnDsp Transport layer setup failed: 14001

E QnnDsp: QnnDsp Failed to parse default platform info: 14001

E QnnDsp: QnnDsp Failed to load default platform info: 14001

E QnnDsp: QnnDsp Failed to parse platform config: 14001

This is a native-level failure inside libQnnHtp.so / the skel loading path — not a Java/Kotlin exception, not framework-specific code. Two different frameworks, two different SDK entry points, same underlying native failure.

Matches a known, previously-reported issue on the same platform

This closely matches #16465 (“QNN HTP init fails on CQ8750S (soc_id=705): ‘No Snapdragon SOC detected’”), filed against the same ro.board.platform=sun device family and already labeled partner: qualcomm by the ExecuTorch maintainers. That issue’s log shows the same error code surfacing at a slightly earlier stage of initialization:

QnnDsp No Snapdragon SOC detected

QnnDsp No Snapdragon SOC detected

QnnDsp Failed to init router

QnnDsp failed sg_htpSingletonProvider initialize: 4000

Same error code (4000), same platform family, consistent with a SoC-identification failure early in QNN’s device-detection path that cascades into transport/skel-load failure. My device reports a clean ro.soc.model=SM8750P (not the garbled CQ8750S string in that report), so this may be a related but distinct SoC-ID/SKU variant not recognized by the current QAIRT SoC lookup table.

Ruled out (not the cause)

Exhaustively tested and eliminated before concluding this is an SDK-level issue:

Variable

Tested

Result

htp_arch provider option

unset, 81, 79 (invalid — not in ORT enum), 69

No change

soc_model provider option

69

No change

Model precision

fp32, native fp16

No change — fails before model is evaluated

onnxruntime-android-qnn version

1.27.0, 1.28.0

Identical failure both versions

qnn-runtime native library version

bundled vs. explicit override to 2.48.0 (confirmed via file-size diff on installed APK: 2,642,248 ? 3,760,632 bytes — genuinely a different binary)

No change

Manual ADSP_LIBRARY_PATH override

present vs. removed entirely

No change

vtcm_mb config

unset vs. 8

No change

Op-level HTP support

checked all model ops against published QNN operator table — all supported

Not the cause; failure occurs before op-level partitioning

App-level DSP device-node permissions (disproven as the cause, included for completeness)

Initially suspected the app’s read-only access to /dev/fastrpc-cdsp (owner/group system:system) as the cause. This is disproven: a third-party benchmarking app (Geekbench AI), running with no elevated privileges, achieves genuine HTP acceleration on this exact device via its own TFLite QNN backend — confirmed via a large FP16/INT8 score differential versus its NNAPI backend on the same device (QNN: 21,627/55,112 vs. NNAPI: 485/1,111 for half-precision/quantized workloads respectively) — https://browser.geekbench.com/ai/v1/542278. This proves third-party app-level HTP access is possible on this device in principle. I do not know what QAIRT/QNN SDK version Geekbench bundles; it’s possible they have a vendor-provided or newer build with correct SoC recognition for this chip that isn’t yet available via the public qnn-runtime Maven releases I tested (through 2.48.0).

Versions

PyTorch version: 2.13.0+cpu
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: Microsoft Windows 11 Pro (10.0.26100 64-bit)
GCC version: Could not collect
Clang version: Could not collect
CMake version: version 3.31.7
Libc version: N/A

Python version: 3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)] (64-bit runtime)
Python platform: Windows-10-10.0.26100-SP0
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
Is XPU available: False
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: False
Caching allocator config: N/A

CPU:
Name: Intel(R) Core(TM) i5-10400 CPU @ 2.90GHz
Manufacturer: GenuineIntel
Family: 205
Architecture: 9
ProcessorType: 3
DeviceID: CPU0
CurrentClockSpeed: 2901
MaxClockSpeed: 2901
L2CacheSize: 1536
L2CacheSpeed: None
Revision: None

Versions of relevant libraries:
[pip3] numpy==2.4.6
[pip3] onnx==1.22.0
[pip3] onnxruntime==1.27.0
[pip3] onnxslim==0.1.94
[pip3] optree==0.19.1
[pip3] torch==2.13.0
[pip3] torchvision==0.28.0
[conda] Could not collect

cc @cbilgin @psiddh

Activity

  1. ashish-frozo commented on Aug 5, 2026

    @ashish-frozo

    This is a strong repro because it separates app/framework behavior from the native QNN failure path. The most useful next evidence would be a tiny device matrix: same APK/model, same QAIRT/QNN version, but different soc_id / board platform / HTP arch, with three columns: QNN setup status, provider assignment from profiling, and measured CPU load. The silent fallback part is the real deployment risk here: session creation can look successful while the graph is effectively 100% CPU.

  2. ivaylo681-dev commented on Aug 5, 2026

    @ivaylo681-dev
    Author

    I will receive a device from a different OEM within 60 days...
    But now....
    I read again #16465
    And I find it useful that fast they have confirmed working soc_model=105 for soc_id=705 with the old QNN.
    So as the failure here is with identical signature, could you help identify the correct soc_model value for soc_id=639 specifically?

  3. added
    module: qnn
    on Aug 5, 2026
  4. added theissue type on Aug 5, 2026
  5. nil-is-all commented on Aug 5, 2026

    @nil-is-all
    Contributor

    @ivaylo681-dev thanks for filing this issue. @haowhsu-quic @shewu-quic @winskuo-quic @DannyYuyang-quic is this SoC not supported with v2.48+ and hence causing this issue?

    cc @psiddh

  6. ivaylo681-dev commented on Aug 5, 2026

    @ivaylo681-dev
    Author

    I have tried today to check the soc_model override across the full numeric range, but with no success. I ran an exhaustive brute-force test from 0 to 9999 on soc_id=639 (SM8750P), tested against both the real production model and a minimal static-shape control model, with session.disable_cpu_ep_fallback set to force a hard failure signal instead of a silent fallback. Every single value across the full range failed identically, with the same QNN_DEVICE_ERROR_INVALID_CONFIG error. This suggests soc_model only works when pointed at an existing table entry, rather than being something one can discover by guessing — unlike the 705→105 case above, 639 may simply have no corresponding entry in the table at all yet. Could you confirm whether soc_id=639 exists anywhere in the current SoC table, even internally/unexposed?

  7. shewu-quic commented on Aug 7, 2026

    @shewu-quic
    Contributor

    Hi @ivaylo681-dev,

    Could you please help to try the below command? Because SM8750P should be the same soc info as SM8750.

    QcomChipset.SM8750: SocInfo(QcomChipset.SM8750, HtpInfo(HtpArch.V79, 8)),

    python mobilenet_v2.py --device <device_serial> --soc_model "SM8750" --build_folder path/to/build-android/ -d /path/to/imagenet-mini/val
    
  8. ivaylo681-dev commented on Aug 7, 2026

    @ivaylo681-dev
    Author

    Update:
    soc_model="SM8750" gets past QNN init — supports this being a SoC-ID table gap, plus found a separate ExecuTorch bug along the way

    Tried --soc_model "SM8750" (base chip name, since SM8750P isn't in the table) via ExecuTorch on a device reporting SM8750P / soc_id=639 / ro.board.platform=sun. Setup: executorch @ latest main as of 2026-08-07, QAIRT SDK 2.49.0.260730, Android NDK r27c, target arm64-v8a.

    Result: QNN device/backend creation succeeds, graph compilation succeeds — real "Finalizing Graph Sequence" stage with actual DDR bandwidth stats, clean Destroy Qnn context / Destroy Qnn device / Destroy Qnn backend teardown, files push to device, qnn_executor_runner launches. This is useful supporting evidence for the request above: it shows this chip + QAIRT SDK combination genuinely can work once given a recognized SoC identity — reinforcing that SM8750P's soc_id=639 just needs its own table entry, same as the 705→105 fix already applied for a related device.

    Tombstone (attached: tombstone_14.txt) confirms FastRPC/DSP access itself works fine on this SM8750P device once SoC detection passes — real open fds to /dev/fastrpc-cdsp, DMA buffer allocations, a live worker thread:

    fd 8: /dev/fastrpc-cdsp (unowned)
    fd 10: /dev/fastrpc-cdsp (unowned)
    fd 5: /dev/dma_heap/system (owned by unique_fd ...)
    #3 pc 0000000000035bdc /vendor/lib64/libcdsprpc.so (fastrpc_latency_thread_handler.cfi+396)

    So this isn't a permissions/access issue — purely SoC recognition. (I'd earlier suspected an app-level FastRPC device-node permission restriction; this tombstone disproves that directly.)

    Execution then crashes with a deterministic SIGSEGV (SEGV_MAPERR), reproducible across fully-cleared workspaces (device + host) every time:

    [INFO] QnnContextCustomProtocol expected magic number: 0x5678abcd but get: 0x4034b50
    [WARNING] Failed to interpret QNN context binary. Error code 30010. Try verifying binary with online-prepare format.
    [INFO] Skip qnn_graph_create, graph has already been composed from Dlc.
    Segmentation fault

    Tried --online_prepare (the tool's own suggested fix) — no change, identical crash, byte-for-byte the same log sequence.

    Traced the crash to a concrete bug, unrelated to the SoC/hardware itself — in backends/qualcomm/runtime/backends/QnnGraphCommon.cpp, QnnGraph::Configure():

    cpp
    Qnn_GraphHandle_t graph_handle = nullptr;
    if (context_->GetCacheState() == QnnBackendCache::DESERIALIZE) {
    // ... assigns graph_handle via qnn_graph_retrieve
    } else if (... SERIALIZE || MULTI_GRAPH) {
    // ... assigns graph_handle via qnn_graph_create
    } else if (context_->GetCacheState() == QnnBackendCache::ONLINE_PREPARE) {
    QNN_EXECUTORCH_LOG_INFO(
    "Skip qnn_graph_create, graph has already been composed from Dlc.");
    // graph_handle is never assigned in this branch
    } else {
    QNN_EXECUTORCH_LOG_ERROR("QNN context cache is invalid.");
    return Error::Internal;
    }

    handle_[graph_name] = graph_handle; // stores nullptr when state == ONLINE_PREPARE

    In the ONLINE_PREPARE branch — reached whenever QnnBackendCache::Configure() falls back from a failed context-binary magic-number check — graph_handle stays nullptr and is stored directly into handle_[graph_name] with no validation. Whatever later consumes that handle (GraphExecute, or wherever it's retrieved during execution) operates on a null/invalid handle — a sufficient, deterministic explanation for the crash, confirmed via a symbolized on-device lldb session (backtrace lands in generic Method::execute_instruction → event-tracer bookkeeping, consistent with invalid state entering execution rather than a hardware fault, not an unwind artifact of the earlier unsymbolized tombstone).

    This second bug is separate from the main SoC-ID request above and specific to ExecuTorch's own code — flagging it here since it's what I hit while testing the workaround, but the primary ask remains: could SM8750P's soc_id=639 be added to the SoC-ID table, the same way 705 was?

    tombstone_14.txt

  9. ivaylo681-dev commented on Aug 8, 2026

    @ivaylo681-dev
    Author

    @shewu-quic , @nil-is-all ,
    I have updated few times the answer above, please re-check it and thank you for your cooperation!

  10. shewu-quic commented on Aug 9, 2026

    @shewu-quic
    Contributor

    Hi @ivaylo681-dev ,
    Thanks for the detailed analysis. One thing I'd like to clarify is that soc_model is not equivalent to soc_id. For an SM8750P device, there should be no need to add a dedicated soc_id=639 entry in order to run ExecuTorch. Since SM8750P belongs to the SM8750 family, no additional changes should be required.

  11. ivaylo681-dev commented on Aug 9, 2026

    @ivaylo681-dev
    Author

    Hi @shewu-quic ,
    Tried soc_model="SM8750" in ONNX Runtime's QNN EP — it throws immediately: ORT_RUNTIME_EXCEPTION: stoi: no conversion. It looks like ORT's soc_model provider option only accepts numeric IDs (calls std::stoi() internally) and has no code path for family-name strings like ExecuTorch's --soc_model flag does.
    Actually, I recall soc_model=69 specifically — that was one of the values I tested manually early on, and it's also covered by the full 0–9999 brute-force sweep I ran afterward (with disable_cpu_ep_fallback forcing a hard failure signal so any success would be unmistakable). Every value in that range, including 69, produced the identical QNN_DEVICE_ERROR_INVALID_CONFIG. If 69 (or whatever the correct SM8750 family value is) is genuinely already recognized and SM8750P should map to it automatically, why did it fail the same way as every other value? Is it possible ORT's soc_model provider option isn't actually reaching the same code path as ExecuTorch's --soc_model flag — i.e., they're not equivalent mechanisms despite the shared name?"

  12. shewu-quic commented on Aug 10, 2026

    @shewu-quic
    Contributor

    Hi,

    Sorry, I'm not sure how ORT handles SoC information internally.

    In ExecuTorch, we map device information through soc_model. Have you seen any issues when running with --soc_model SM8750 directly in ExecuTorch, without making any changes for SM8750P?

    Regarding the ORT issue, it would be best to open an issue in the ORT repository so the ORT maintainers can take a closer look.

    For reference: Supported Snapdragon Devices
    Thank you.

  13. ivaylo681-dev commented on Aug 10, 2026

    @ivaylo681-dev
    Author

    @shewu-quic , @nil-is-all ,
    Update: filed the ORT-side portion separately at microsoft/onnxruntime#31353 — their engineer confirmed the htp_arch=79 parser gap and submitted a fix (PR #31638, currently open/pending review, not yet merged) — but also independently concluded the actual QNN_DEVICE_ERROR_INVALID_CONFIG failure "points at SoC detection inside the QNN HTP backend rather than at ORT," from their own reading of the code: it's returned by deviceCreate() with an empty config list. Same conclusion reached here, from a completely independent codebase and engineer.

    To be clear this isn't an ORT-side parsing artifact: the identical QNN_DEVICE_ERROR_INVALID_CONFIG reproduces with no provider options set at all (ORT's default/auto-detect path), and separately across an exhaustive brute-force sweep of every numeric soc_model value from 0–9999 (using session.disable_cpu_ep_fallback to force a hard failure signal on any partial success) — all producing the identical error. The stoi: no conversion exception mentioned in earlier testing here was a separate, expected result of passing a non-numeric string ("SM8750") to ORT's soc_model option, which only accepts integers — not related to the underlying deviceCreate() failure, which occurs identically regardless of which numeric value (or none) is passed.

    So this remains squarely a QAIRT/qnn-runtime SoC-ID table issue for soc_id=639 (SM8750P), independent of which downstream framework (ORT, ExecuTorch/TFLite via Geekbench) is calling into it. Any update on whether soc_id=639 can be added to the table?

  14. chenweng-quic commented on Aug 12, 2026

    @chenweng-quic
    Contributor

    Hi @ivaylo681-dev ,
    soc_model are enum values in SDK (path: <SDK_PATH>/include/QNN/QnnTypes.h).
    Or you can refer the document: https://docs.qualcomm.com/nav/home/enum_QnnTypes_8h_1aea3262897ad2f237f9e5189419ad2214.html?product=1601111740010412?

  15. ivaylo681-dev commented on Aug 12, 2026

    @ivaylo681-dev
    Author

    Hello @chenweng-quic ,
    I have checked QnnTypes.h as suggested - confirmed QNN_SOC_MODEL_SM8750 = 69. This is exactly the value I already tested (both manually and as part of the 0–9999 brute-force sweep) - it produces the identical QNN_DEVICE_ERROR_INVALID_CONFIG as every other value. So passing the correct, documented enum value for the SM8750 family does not resolve this on SM8750P/soc_id=639 - which directly contradicts the earlier suggestion that no additional table changes should be needed. This confirms SM8750P isn't actually being recognized as belonging to the SM8750 family at the native detection layer, regardless of what soc_model value is passed. Could someone confirm whether soc_id=639 specifically needs its own table entry, since soc_model=69 alone clearly isn't sufficient?

  16. chenweng-quic commented on Aug 12, 2026

    @chenweng-quic
    Contributor

    Hi @ivaylo681-dev ,
    Could you confirm following .so are pushed to device, and LD_LIBRARY_PATH is set?
    SDK/lib/aarch64-android/libQnnHtp*.so
    SDK/lib/hexagon-v79/unsigned

  17. ivaylo681-dev commented on Aug 12, 2026

    @ivaylo681-dev
    Author

    Confirmed — libQnnHtpV79Skel.so, libQnnHtpV79Stub.so, along with libQnnHtp.so, libQnnSystem.so, and all other architecture variants (V68/V69/V73/V75/V81) are present in the installed APK's lib/arm64/ directory. Full listing:

    libQnnHtp.so
    libQnnHtpPrepare.so
    libQnnHtpV68Skel.so / Stub.so
    libQnnHtpV69Skel.so / Stub.so
    libQnnHtpV73Skel.so / Stub.so
    libQnnHtpV75Skel.so / Stub.so
    libQnnHtpV79Skel.so / Stub.so
    libQnnHtpV81Skel.so / Stub.so
    libQnnSystem.so

    LD_LIBRARY_PATH is also confirmed set correctly at runtime, pointing at the app's own nativeLibraryDir (same folder as this listing), via Os.setenv("ADSP_LIBRARY_PATH", ...) before session creation.

    So all the expected files are genuinely present and correctly loaded — this rules out missing libraries as the cause. The failure still points back to SoC-ID recognition at deviceCreate(), not missing native libraries.

  18. chenweng-quic commented on Aug 12, 2026

    @chenweng-quic
    Contributor

    Hi @ivaylo681-dev ,
    Would you mind setting log_level verbose and generate the log file?
    Also, could you also provide logcat log?

    in terminal1, run

    adb shell "logcat -c"
    adb shell "logcat" > logcat.txt
    # ctrl-C when application exit.
    

    in terminal2, run your application on android.

    A better option is to print your application's logs to logcat, refer https://github.com/pytorch/executorch/blob/main/backends/qualcomm/runtime/Logging.cpp

  19. ivaylo681-dev commented on Aug 12, 2026

    @ivaylo681-dev
    Author

    arch_69_logcat.txt
    arch_69_ort_trace_2026-08-12_17-10-43_787.json
    arch_79_logcat.txt

    arch_79_ort_trace_2026-08-12_17-03-14_120.json

    Once I have tried with
    val qnnConfig = mapOf(
    "backend_path" to "libQnnHtp.so",
    "profiling_level" to "detailed",
    "soc_model" to "69",
    "htp_arch" to "79"
    )
    and once with
    val qnnConfig = mapOf(
    "backend_path" to "libQnnHtp.so",
    "profiling_level" to "detailed",
    "soc_model" to "69",
    "htp_arch" to "69"
    )

  20. chenweng-quic commented on Aug 13, 2026

    @chenweng-quic
    Contributor

    Hi @ivaylo681-dev ,
    ORT doesn't support v79.
    see https://github.com/onnxruntime/onnxruntime-qnn/blob/3fbe9db02aee911d766f16c21ac3b6ad5443a414/docs/execution_providers/QNN-ExecutionProvider.md

    Image

    Your log also shows

    Image

    Also, you are using ORT, you should report your issue there, not executorch.

  21. ivaylo681-dev commented on Aug 13, 2026

    @ivaylo681-dev
    Author
  22. chenweng-quic commented on Aug 13, 2026

    @chenweng-quic
    Contributor

    @ivaylo681-dev ,

    This thread here remains about the underlying issue that's
    framework-independent: soc_id=639 (SM8750P) failing QNN device creation
    regardless of htp_arch/soc_model value (including the confirmed-correct
    soc_model=69 for the SM8750 family per QnnTypes.h), reproduced identically
    via ORT, TFLite, and ExecuTorch. That's the core ask still open here —
    could soc_id=639 be recognized at the native SoC-detection layer?

    Could you provide reproduce commands in excutorch for your soc_id=639?
    By the way I won't use /sys/devices/soc0/soc_id to get soc_id, do you see any document mention this?

  23. ivaylo681-dev commented on Aug 13, 2026

    @ivaylo681-dev
    Author

    @chenweng-quic , Good catch! You're right that /sys/devices/soc0/soc_id isn't a QNN concept at all. I checked QnnTypes.h again and there's no socId field anywhere in it, only socModel. I've been using the kernel-level soc_id (639) purely as a convenient way to identify which physical chip I'm testing on (since ro.soc.model=SM8750P alone doesn't disambiguate SKU variants). It has never been itself passed into any QNN API or config field. I don't have a document establishing equivalence between it and anything QNN-internal. Apologies if that caused confusion in how I framed earlier reports.

    The actual QNN-facing values tested, for the record:

    ORT's soc_model provider option: 69 (confirmed correct value for SM8750 per QnnTypes.h) - fails
    ExecuTorch's --soc_model flag: "SM8750" (string form) - device creation succeeds, crashes later at execution (separate bug, tracked above)

    Reproduce command in ExecuTorch (on the device reporting soc_id=639/SM8750P):

    python mobilenet_v2.py --device <device_serial> --soc_model "SM8750" --build_folder /path/to/build-android -d /path/to/imagenet-mini/val
    Full setup: executorch @ latest main as of 2026-08-07, QAIRT SDK 2.49.0.260730, Android NDK r27c, target arm64-v8a.

    From my "notes":
    [INFO] [Qnn ExecuTorch]: QnnContextCustomProtocol expected magic number: 0x5678abcd but get: 0x4034b50
    [INFO] [Qnn ExecuTorch]: Deserializing processed data using Dlc
    [INFO] [Qnn ExecuTorch]: Creating new backend bundle.
    [INFO] [Qnn ExecuTorch]: create QNN Logger with log_level 1
    [INFO] [Qnn ExecuTorch]: Initialize Qnn backend parameters for Qnn executorch backend type 2
    [INFO] [Qnn ExecuTorch]: Caching: Caching is in RESTORE MODE.
    [INFO] [Qnn ExecuTorch]: QnnContextCustomProtocol expected magic number: 0x5678abcd but get: 0x4034b50
    [WARNING] [Qnn ExecuTorch]: Failed to interpret QNN context binary. Error code 30010. Try verifying binary with online-prepare format.
    [INFO] [Qnn ExecuTorch]: create QNN Logger with log_level 1
    [INFO] [Qnn ExecuTorch]: Running level=1 optimization.
    [INFO] [Qnn ExecuTorch]: Skip qnn_graph_create, graph has already been composed from Dlc.
    Segmentation fault

  24. chenweng-quic commented on Aug 13, 2026

    @chenweng-quic
    Contributor

    For segmentation fault issue, could you create another issue and close current one if there is no issue leave?

  25. ivaylo681-dev commented on Aug 13, 2026

    @ivaylo681-dev
    Author

    @chenweng-quic ,
    I have opened the segfault as a separate issue: #21804
    On closing this one - the original device-creation failure itself is still open: soc_id=639 (SM8750P) isn't recognized at the native QNN SoC-detection layer inside the qnn-runtime library itself, which is framework-independent - it's the same underlying issue whether triggered via ORT (QNN_DEVICE_ERROR_INVALID_CONFIG), TFLite (QnnDsp: No Snapdragon SOC detected), or auto-detection inside ExecuTorch itself when soc_model isn't explicitly overridden.
    To be clear, I'm not asking about anything ORT- or ExecuTorch-specific here - this is squarely a qnn-runtime package bug, since that's the component doing the actual SoC recognition underneath all three frameworks. That's what this thread is actually about, and it's unresolved regardless of which downstream framework calls into it. Could we keep this open until that's addressed, or is there a reason to consider it resolved that I'm missing?

  26. ivaylo681-dev commented on Aug 13, 2026

    @ivaylo681-dev
    Author

    @chenweng-quic ,
    I have something new!
    Found the mapping in your own SDK: <QNN_SDK_ROOT>/lib/python/qti/aisw/tools/core/utilities/devices/android/android_device_constants.py contains:

    python
    "639": "SM8750",

    So soc_id=639 → SM8750 → soc_model=69 is the correct mapping according to your own SDK. But soc_model=69 still fails at deviceCreate() in the native runtime (libQnnHtp.so), producing "No Snapdragon SOC detected" / QNN_DEVICE_ERROR_INVALID_CONFIG.

    So the mapping exists and is correct — it's just not being honored by the native library ((libQnnHtp.so/libQnnSystem.so))at device creation time. Can this be checked on your end?

  27. ivaylo681-dev commented on Aug 19, 2026

    @ivaylo681-dev
    Author

    @chenweng-quic @nil-is-all ,
    Update — the ORT-side portion of this is now fixed, and the remaining problem turns out to be something different from what I described earlier.

    On the ORT side, @qti-mbadnara raised onnxruntime/onnxruntime-qnn#736, which adds string-name support for the soc_model provider option. I built and validated it on this device: soc_model="SM8750" now parses and resolves correctly to model value 69 (confirmed against a deliberately-invalid control string, which does produce a warning). That fix works as intended and closes the ORT parsing gap. Thanks for the quick turnaround on it.

    More importantly: my earlier diagnosis in this thread was wrong. I've now run Qualcomm's own qnn-platform-validator (QAIRT 2.49.0.260730) on this device, and it passes every check — the chip is identified correctly as Hexagon V79, and a unit test executes successfully on the DSP. So please disregard my previous comment about android_device_constants.py and the SoC-ID table: soc_id=639 is recognized, and no table change is needed. I withdraw that request.

    What's left is narrower and, I think, genuinely answerable. Below is what's now eliminated, and the three specific questions remaining.

    Device: SM8750P, soc_id=639, Android 16 (HyperOS). QAIRT 2.49.0.260730, libraries copied directly from the SDK — libQnnHtp.so is byte-identical (3,786,064) in both tests below.

    Qualcomm's qnn-platform-validator, shell context:

    DSP,Supported,Found,Not Found,Hexagon Architecture V79,Passed,Passed

    Calculator unit test executed on the DSP using the unsigned hexagon-v79 skel. No testsig required.

    Same libraries, loaded from the app's nativeLibraryDir:

    qnn_execution_provider.cc:2081 — QNN SetupBackend failed
    Failed to create device. Error: QNN_DEVICE_ERROR_INVALID_CONFIG

    Eliminated: SoC recognition (validator above); DSP/FastRPC/skel loading (validator above); ORT config construction — option tags, arch.arch, arch.deviceId, socModel all verified populated at qnn_backend_manager.cc:776–871; soc_model ("SM8750", 69, and no config at all — [nullptr] — fail identically, so there are no config values present to be invalid); htp_arch (v79 parsed and carried to the struct); QAIRT version (2.48, 2.49; Maven and SDK builds); ADSP_LIBRARY_PATH (unset, app-dir-first, ; and : separators — all identical).

    The failure takes ~2 ms and produces no QnnDsp-tagged native output. The validator, same device and libraries, logs verbosely at every stage.

    Questions:

    Does QNN_DEVICE_ERROR_INVALID_CONFIG from QnnDevice_Create() indicate rejection at config-struct validation, before SoC detection runs? The absence of any native logging suggests it returns before doing real work.
    What differs for QnnDevice_Create() between a shell process and an Android app process, given the platform validator passes on this hardware with these libraries?
    What is the correct ADSP_LIBRARY_PATH value and separator for an Android app loading skels from its own nativeLibraryDir? ORT warns about the existing value on every run, whether the app sets it or not.

  28. chenweng-quic commented on Aug 19, 2026

    @chenweng-quic
    Contributor

    Hi @ivaylo681-dev ,
    For any questions about ORT-QNN, could you open an issue there?
    If you see any errors in executorch, could you zip up all artifacts and share the steps to reproduce?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: qnn

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions