在QCS9075上部署Stable diffusion 2.1时遇到如下问题

weixin_38498942 2026-03-05 17:39:45

在QCS9075上部署Stable diffusion 2.1时遇到如下问题

  • 无法从Hugingface获取某些内容,例如:

'(MaxRetryError("HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded with url: /stabilityai/stable-diffusion-2-1-base/resolve/main/unet/config.json (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f63e93610>: Failed to establish a new connection: [Errno 101] Network is unreachable'))"), '(Request ID: 4e87f358-0d0a-41dc-87a5-ba4cf79d15ce)')' thrown while requesting HEAD https://huggingface.co/stabilityai/stable-diffusion-2-1-base/resolve/main/unet/config.json
Retrying in 1s [Retry 1/5].
...
...
  • 使用aarch64-ubuntu-gcc9.4的AP侧库运行:
     1.0ms [VERBOSE]  <V> Config not passed. Loading default config
     1.0ms [VERBOSE]  <V> Setting default value for unsigned PD usage
     1.0ms [ ERROR ]  <E> HtpRuntimeStub: Unsupported SoC 0
     1.0ms [ ERROR ]  <E> failed to initialize skel/stub file path
     1.2ms [WARNING]  <W> Failed in loading stub: libQnnHtp: cannot open shared object file: No such file or directory
     1.2ms [WARNING]  <W> Failed to create transport instance: 4000
     1.2ms [ ERROR ]  <E> Failed to create transport for device, error: 4000
     1.2ms [ ERROR ]  <E> Failed to load skel, error: 4000
     1.2ms [VERBOSE]  <V> exits device initialization with  14001
  • 内存问题(1002)
     1.2ms [VERBOSE]  <V> Effective cdsp_id is: 0, Session_id is: 0 for DeviceId: 0, CoreId: 0, pdId: 0
     1.2ms [ ERROR ]  <E> Fail to get effective domain id from rpc with DeviceId 0 coreId 0 pdId 0
     1.2ms [ ERROR ]  <E> error in creation of transport instance
     1.2ms [WARNING]  <W> Failed to create transport instance: 1002
     1.2ms [ ERROR ]  <E> Failed to create transport for device, error: 1002
     1.2ms [ ERROR ]  <E> Failed to load skel, error: 1002
     1.2ms [VERBOSE]  <V> exits device initialization with  14001
     1.2ms [ ERROR ]  <E> Transport layer setup failed: 14001
...全文
159 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
github_39180342 03-09 19:17
  • 打赏
  • 举报
回复

解决方案与变通方法

  1. 有多种可能导致此问题。
  • 该资源已从Huggingface移除。在这种情况下,我们需要使用社区版d2-community/stable-diffusion-2-1-base,而不是官方的stabilityai/stable-diffusion-2-1-base进行时间嵌入(更新Python模块[diffusers transformers]可能会有帮助,但我们尚未尝试)

  • 中国大陆无法访问Huggingface。它需要一个VPN或执行中国大陆的生成。另一种推荐的方法是通过导出HF_ENDPOINT=https://hf-mirror.com/
    分词器JSON文件clip-vit-large-patch14-tokenizer.json将从openai/clip-vit-large-patch14下载。不同的Python分词器版本可能会下载不同的JSON文件,且它们可能相互不兼容。

  1. 对于此SDK,V73 dsp没有适用于Ubuntu的对应存根。作为变通方法,即使平台是ubuntu-24.04-QCS9075,我们也使用aarch64-oe-linux-gcc9.4库/二进制文件

  2. 这是一个内核问题:
    通过journalctl -k | grep dsp -i ,我们发现内核错误日志:
    没有为FASTRPC保留DMA内存

Jul 02 14:04:33 Thundercomm kernel: OF: reserved mem: initialized node secure-cdsp-region, compatible id shared-dma-pool
Jul 02 14:04:33 Thundercomm kernel: OF: reserved mem: 0x00000000fdc00000..0x00000000ffbfffff (32768 KiB) map reusable secure-cdsp-region
Jul 02 14:04:33 Thundercomm kernel: OF: reserved mem: 0x0000000094a00000..0x00000000951fffff (8192 KiB) nomap non-reusable adsp-rpc-remote-heap@94a00000
Jul 02 14:04:33 Thundercomm kernel: OF: reserved mem: 0x0000000095900000..0x00000000976fffff (30720 KiB) nomap non-reusable pil-adsp@95900000
Jul 02 14:04:33 Thundercomm kernel: OF: reserved mem: 0x0000000097700000..0x000000009777ffff (512 KiB) nomap non-reusable q6-adsp-dtb@97700000
Jul 02 14:04:33 Thundercomm kernel: OF: reserved mem: 0x0000000097780000..0x00000000977fffff (512 KiB) nomap non-reusable q6-gdsp0-dtb@97780000
Jul 02 14:04:33 Thundercomm kernel: OF: reserved mem: 0x0000000097800000..0x00000000995fffff (30720 KiB) nomap non-reusable pil-gdsp0@97800000
Jul 02 14:04:33 Thundercomm kernel: OF: reserved mem: 0x0000000099600000..0x000000009b3fffff (30720 KiB) nomap non-reusable pil-gdsp1@99600000
Jul 02 14:04:33 Thundercomm kernel: OF: reserved mem: 0x000000009b400000..0x000000009b47ffff (512 KiB) nomap non-reusable q6-gdsp1-dtb@9b400000
Jul 02 14:04:33 Thundercomm kernel: OF: reserved mem: 0x000000009b480000..0x000000009b4fffff (512 KiB) nomap non-reusable q6-cdsp0-dtb@9b480000
Jul 02 14:04:33 Thundercomm kernel: OF: reserved mem: 0x000000009b500000..0x000000009d2fffff (30720 KiB) nomap non-reusable pil-cdsp0@9b500000
Jul 02 14:04:33 Thundercomm kernel: OF: reserved mem: 0x000000009d380000..0x000000009d3fffff (512 KiB) nomap non-reusable q6-cdsp1-dtb@9d380000
Jul 02 14:04:33 Thundercomm kernel: OF: reserved mem: 0x000000009d400000..0x000000009f1fffff (30720 KiB) nomap non-reusable pil-cdsp1@9d400000
Jul 02 14:04:33 Thundercomm kernel: platform soc@0:qcom,dma-heaps:qcom,secure_cdsp: assigned reserved memory node secure-cdsp-region
Jul 02 14:04:33 Thundercomm kernel: qcom_dma_heap_probe: DMA-BUF Heap: Created qcom,cma-secure-cdsp
Jul 02 14:04:35 Thundercomm kernel: remoteproc remoteproc0: Booting fw image qcom/sa8775p/gpdsp0.mbn, size 5836800
Jul 02 14:04:35 Thundercomm kernel: remoteproc remoteproc1: Booting fw image qcom/sa8775p/gpdsp1.mbn, size 5808128
Jul 02 14:04:35 Thundercomm kernel: remoteproc remoteproc2: Booting fw image qcom/sa8775p/cdsp0.mbn, size 3080192
Jul 02 14:04:35 Thundercomm kernel: remoteproc remoteproc3: Booting fw image qcom/sa8775p/cdsp1.mbn, size 3084288
Jul 02 14:04:35 Thundercomm kernel: remoteproc remoteproc4: Booting fw image qcom/sa8775p/adsp.mbn, size 6647808
Jul 02 14:04:35 Thundercomm kernel: qcom,fastrpc 20c00000.remoteproc:glink-edge.fastrpcglink-apps-dsp.-1.-1: no reserved DMA memory for FASTRPC
Jul 02 14:04:35 Thundercomm kernel: qcom,fastrpc 21c00000.remoteproc:glink-edge.fastrpcglink-apps-dsp.-1.-1: no reserved DMA memory for FASTRPC
Jul 02 14:04:35 Thundercomm kernel: qcom,fastrpc 30000000.remoteproc:glink-edge.fastrpcglink-apps-dsp.-1.-1: no reserved DMA memory for FASTRPC
Jul 02 14:04:35 Thundercomm kernel: fastrpc: fastrpc_setup_service_locator: pdr_add_lookup enabled for avs/audio (audio_pdr_adsp, msm/adsp/audio_pd)
Jul 02 14:04:35 Thundercomm kernel: fastrpc: fastrpc_setup_service_locator: pdr_add_lookup enabled for tms/servreg (sensors_pdr_adsp, msm/adsp/sensor_pd)
Jul 02 14:04:40 Thundercomm kernel: qcom,fastrpc 26300000.remoteproc:glink-edge.fastrpcglink-apps-dsp.-1.-1: failed to create endpoint
Jul 02 14:04:40 Thundercomm kernel: qcom,fastrpc: probe of 26300000.remoteproc:glink-edge.fastrpcglink-apps-dsp.-1.-1 failed with error -12
Jul 02 14:04:42 Thundercomm kernel: qcom,apr 30000000.remoteproc:glink-edge.adsp_apps.-1.-1: Adding APR/GPR dev: gprsvc:service:2:1
Jul 02 14:04:42 Thundercomm kernel: qcom,fastrpc 30000000.remoteproc:glink-edge.fastrpcglink-apps-dsp.-1.-1: fastrpc_pdr_cb: msm/ads/audio_pd (audio_pdr_adsp) is up for PDR on adsp
Jul 02 14:04:42 Thundercomm kernel: qcom,apr 30000000.remoteproc:glink-edge.adsp_apps.-1.-1: Adding APR/GPR dev: gprsvc:service:2:2
Jul 02 14:04:55 Thundercomm kernel: qcom,fastrpc 26300000.remoteproc:glink-edge.fastrpcglink-apps-dsp.-1.-1: no reserved DMA memory for FASTRPC
Jul 02 14:04:55 Thundercomm kernel: qcom,fastrpc 2a300000.remoteproc:glink-edge.fastrpcglink-apps-dsp.-1.-1: no reserved DMA memory for FASTRPC
Jul 02 14:06:55 Thundercomm kernel: UBSAN: array-index-out-of-bounds in /home/thundersoft/SSD/Qcs9100_DevKit_Ubuntu_X05/linux/noble/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c:242:65
Jul 02 14:06:55 Thundercomm kernel: UBSAN: array-index-out-of-bounds in /home/thundersoft/SSD/Qcs9100_DevKit_Ubuntu_X05/linux/noble/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c:149:31
Jul 02 14:06:55 Thundercomm kernel: UBSAN: array-index-out-of-bounds in /home/thundersoft/SSD/Qcs9100_DevKit_Ubuntu_X05/linux/noble/sound/soc/qcom/qdsp6/q6apm-lpass-dais.c:156:21

关键冲突点
在设备树中,“adsp - rpc - remote - heap”已被定义。
驱动程序报告错误:“没有为FASTRPC预留DMA内存”。
这强烈表明FastRPC驱动程序未能找到其应使用的预留内存区域。换句话说,FastRPC驱动程序的设备树节点没有正确引用这个预留内存节点。

weixin_38498942 03-09 09:42
  • 打赏
  • 举报
回复

QCS9075 部署 SD 2.1 — 速查

  1. HuggingFace 网络不可达
    板子无外网。在主机下载模型后 scp 推送到板子,或配置 https_proxy。
  2. "Unsupported SoC 0" + 缺 libQnnHtp
    用了错误的库路径。QCS9075 对应 HTP v79,设置:
    export LD_LIBRARY_PATH=$QNN_SDK_ROOT/lib/aarch64-ubuntu-gcc9.4:$LD_LIBRARY_PATHexport ADSP_LIBRARY_PATH=$QNN_SDK_ROOT/lib/hexagon-v79/unsigned:$ADSP_LIBRARY_PATH
    确认 QAIRT SDK >=2.28 且含 libQnnHtp.so、libQnnHtpV79Stub.so、libQnnHtpV79Skel.so。
  3. 错误码 1002 — DSP Transport 失败
    RPC 会话建立不了。检查:
    sudo chmod 666 /dev/adsprpc-smd # DSP 设备节点权限sudo systemctl start adsprpcd # FastRPC 守护进程dmesg | grep -i "cdsp|hexagon" # cDSP firmware 是否正常加载
    ADSP_LIBRARY_PATH 必须指向 hexagon-v79/unsigned。

7,635

社区成员

发帖
与我相关
我的任务
社区描述
本论坛以AI、WoS 、XR、IoT、Auto、生成式AI等核心板块组成,为开发者提供便捷及高效的学习和交流平台。 高通开发者专区主页:https://qualcomm.csdn.net/
人工智能物联网机器学习 技术论坛(原bbs) 北京·东城区
社区管理员
  • csdnsqst0050
  • chipseeker
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧