7,635
社区成员
发帖
与我相关
我的任务
分享在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].
...
...
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
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
解决方案与变通方法
该资源已从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文件,且它们可能相互不兼容。
对于此SDK,V73 dsp没有适用于Ubuntu的对应存根。作为变通方法,即使平台是ubuntu-24.04-QCS9075,我们也使用aarch64-oe-linux-gcc9.4库/二进制文件
这是一个内核问题:
通过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驱动程序的设备树节点没有正确引用这个预留内存节点。
QCS9075 部署 SD 2.1 — 速查