Skip to content

QNN backend fails on second model load (DMA-BUF preregistration issue) #15732

@nambn007

Description

@nambn007

🐛 Describe the bug

Hi, I am currently facing an issue when using ExecuTorch with the QNN backend on Android.
The model loads and runs correctly the first time, but after I unload (reset) the model and try to load it again within the same app session, the QNN backend fails with the error PreRegisterMem failed to get file descriptor / Fail to initialize Qnn Manager.

PreRegisterMem failed to get file descriptor.
Fail to pre register custom memory handle
Fail to initialize Qnn Manager

#if defined(__aarch64__)
  ET_CHECK_OR_RETURN_ERROR(
      PreRegisterMem() == Error::Ok,
      Internal,
      "Fail to pre register custom memory handle");
#endif

This happens specifically after QNN tries to preregister external memory (DMA-BUF / AHardwareBuffer).

Versions

SM8550

ExecuTorch version: 1.0 / Nightly (please update if different)

Backend: QNN (HTP / DSP)

Device: Qualcomm Snapdragon (CDSP)

OS / Platform: Android (via JNI)

Model: LLaMA .pte (Hybrid KV cache mode enabled)

cc @cccclai @winskuo-quic @shewu-quic @haowhsu-quic @DannyYuyang-quic @cbilgin

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: qnnIssues related to Qualcomm's QNN delegate and code under backends/qualcomm/partner: qualcommFor backend delegation, kernels, demo, etc. from the 3rd-party partner, Qualcomm

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions