J. Rogers, SE Ohio
Getting the Qualcomm Hexagon V73 NPU running on mainline Linux on a commercial Snapdragon X Elite laptop (Dell Latitude 7455, running Arch/Omarchy) is an exercise in separating kernel plumbing, FastRPC process domains, and firmware signature boundaries.
Tonight, instead of guessing at high-level AI frameworks, we stripped the stack down to its lowest layers and traced every syscall and RPC return code from the kernel up. Here is what actually happens under the hood—and what works today.
1. The Hardware & Kernel Plumbing Works Out of the Box
At the lowest level, mainline Linux on
x1e80100 already brings up the Compute DSP (CDSP) cleanly:- The
remoteprocsubsystem boots the CDSP (32300000.remoteproc) using the OEMqccdsp8380.mbnfirmware. - Character devices
/dev/fastrpc-cdsp,/dev/fastrpc-cdsp-secure, and/dev/dma_heap/systemare present and active. - The userspace FastRPC listener daemon (
cdsprpcd) attaches todomain 3(attachguestosandadsp_default_listener) without errors.
2. Signed Process Domains (
-U 0) Are Live on the NPURunning Qualcomm’s low-level FastRPC diagnostic suite (
fastrpc_test) in Signed Process Domain mode (-U 0) proves that the Hexagon V73 NPU is actively executing code and sharing dma_heap / ION buffers with the ARM64 Oryon CPU:text
Allocate 4000 bytes from ION heap
Creating sequence of numbers from 0 to 999
Compute sum on domain 3
Call calculator_sum on the DSP
Sum = 499500
Call calculator_max on the DSP
Max value = 999
[PASS] libcalculator.so
[PASS] libmultithreading.so
Use code with caution.
libcalculator.soandlibmultithreading.soboth pass. The CPU allocates a buffer indma_heap, passes it over FastRPC to the Hexagon V73 NPU, and reads back the computed sum (499500) and max (999).libhap_example.sofails with0x4e(ENOSYS): The older AndroidHAP_mem_map_dmahandleioctl is unsupported on mainline Linuxdma_heap, which is expected.
3. Why Unsigned PDs (
-U 1) and QNN HTP (libQnnHtpV73Skel.so) FailWhen moving from Qualcomm’s pre-signed test libraries to custom DSP code or QAIRT’s
QnnHtp backend, two distinct errors appear depending on which Process Domain mode you request:A. Unsigned Process Domain (
-U 1) Fails With 0x8000054fEven after generating a device-specific
testsig-0xd2b85295.so for the SoC serial number (3535520405 / 0xd2b85295), strace on fastrpc_test -d 3 -U 1 revealed the exact point of failure:text
openat(AT_FDCWD, "/dev/fastrpc-cdsp-secure", O_RDONLY|O_NONBLOCK) = 7
openat(AT_FDCWD, "/usr/lib/rfsa/adsp/cdsp/fastrpc_shell_unsigned_3", O_RDONLY) = 8
ioctl(7, FASTRPC_IOCTL_INIT_CREATE, 0xffffeeb64c00) = 18446744071562069327
Use code with caution.
That return value (
0xffffffff8000054f -> 0x8000054f) is AEE_EQURTBADASID (an ASID allocation failure inside adsp_process_group_create_mpd_attrs on the CDSP). Crucially, FASTRPC_IOCTL_INIT_CREATE fails inside the CDSP firmware before userspace ever searches for or loads testsig-*.so.As tracked in
qualcomm/fastrpc Issue #400, 0x8000054f occurs when the CDSP boot firmware (qccdsp8380.mbn) and the DSP userland shells (fastrpc_shell_unsigned_3) come from mismatched firmware builds—or when the OEM CDSP image restricts unsigned shell creation.B. Signed Process Domain (
-U 0) Fails With 0x80000406 on HTP SkelsForcing QAIRT’s
QnnHtp device creation into Signed PD mode (QNN_HTP_DEVICE_CONFIG_OPTION_SIGNEDPD) gets past FASTRPC_IOCTL_INIT_CREATE—the session opens—but immediately fails when loading the HTP skeleton library:text
<E> DspTransport.openSession qnn_open failed, 0x80000406, prio 100
<E> IDspTransport: Unable to load lib 0x80000406
Use code with caution.
0x80000406 is AEE_EUNABLETOLOAD:- QAIRT’s Linux
libQnnHtpV73Skel.soships inhexagon-v73/unsigned/without a production CDSP ELF signature, so Signed PD rejects it. - Windows ARM64 OEM Driver Packs (
.cab) includelibQnnHtpV73SkelDrv.sosigned via a Windows Authenticode.catcatalog (qcnspmcdm8380.cat). The Linux CDSP loader does not parse Windows.catcatalogs—it verifies embedded Qualcomm MBN/ELF hash segments—so it rejects the Windows.soas well.
4. Where Things Stand for
X1E80100 Linux Developers- The Silicon Works: On
x1e80100Linux,/dev/fastrpc-cdsp+cdsprpcd+dma_heapis functional today for properly signed Linux CDSP binaries. - Matched Firmware Is Critical for User PDs: Recent community testing in
qualcomm/fastrpcIssue #377 demonstrated that pairing a matchedCDSP.HT.2.9.c1-00075firmware and DSP shell set with QAIRT 2.48 resolves0x8000054fand runsLlama-3.2-1BonX1E80100Linux at ~195 tok/s. - Zero-Copy CPU + GPU Is Unblocked: While CDSP firmware/signature parity catches up across OEM laptops, the Oryon CPU (
NEON/i8mm) and Adreno X1-85 GPU (Mesa Turnip Vulkan) already sharedma_heapbuffers cleanly with zero firmware gates.
No comments:
Post a Comment