我尝试在spacemit k1-x MUSE-Pi-Pro上运行int8量化后的yolo图像模型,但是很快便遇到报错:
2026-10-20 23:16:38.713879167 [E:onnxruntime:, compiler_depend.ts:2105 operator()] Exception during initialization: compiler_depend.ts:149 virtual onnxruntime::common::Status onnxruntime::SpaceMITExecutionProvider::Compile(const std::vector<onnxruntime::IExecutionProvider::FusedNodeAndGraph>&, std::vector<onnxruntime::NodeComputeInfo>&) SpaceMIT EP does not support Compile
Traceback (most recent call last):
File "/home/bianbu/ort.py", line 15, in <module>
session = ort.InferenceSession(
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/dist-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 419, in __init__
self._create_inference_session(providers, provider_options, disabled_optimizers)
File "/usr/lib/python3.12/dist-packages/onnxruntime/capi/onnxruntime_inference_collection.py", line 491, in _create_inference_session
sess.initialize_session(providers, provider_options, disabled_optimizers)
File "/usr/lib/python3.12/dist-packages/spacemit_ort/__init__.py", line 37, in _wrap_func
return ort_method(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
onnxruntime.capi.onnxruntime_pybind11_state.RuntimeException: [ONNXRuntimeError] : 6 : RUNTIME_EXCEPTION : Exception during initialization: compiler_depend.ts:149 virtual onnxruntime::common::Status onnxruntime::SpaceMITExecutionProvider::Compile(const std::vector<onnxruntime::IExecutionProvider::FusedNodeAndGraph>&, std::vector<onnxruntime::NodeComputeInfo>&) SpaceMIT EP does not support Compile
查询资料发现我的板子上运行的spacemit-ort后端版本过低(实际上是1.2.2),我随后从官方仓库安装了更新版本的EP后端(版本号为2.0.3),然而我遇到了TCM驱动版本不兼容(内核TCM驱动版本过低)的问题,程序在初始化onnx runtime推理会话的时候便报错:
*************** EP Error ***************
EP Error tcm buffer alloc failed for core id 0. when using ['SpaceMITExecutionProvider']
Falling back to ['CPUExecutionProvider'] and retrying.
****************************************
使用人工智能工具分析后我了解到,目前公开的K1板子操作系统镜像似乎都仅仅携带了TCMv1驱动,而spacemit-ort 2.0.x需要TCMv2驱动,而且还需要K1公开内核镜像缺少的/dev/tcm_sync_mem节点
我希望能够在spacemit k1-x MUSE-Pi-Pro上使用AI加速运行int8量化后yolo模型以期更快地进行图像推理,但是经历上述调试和排错后我好像卡住了。我看到官方文档https://gitee.com/bianbu/spacemit-demo/blob/main/README.md#cv%E6%A8%A1%E5%9E%8B%E6%80%A7%E8%83%BD中提及K1上yolo11在int8量化下可以跑到35FPS,那我该怎么复现呢?
实际上 spacemit-tcm_3.0.1_riscv64.deb 无法在我的系统上安装:
bianbu@bianbu:~$ sudo apt install ./spacemit-tcm_3.0.1_riscv64.deb
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取状态信息... 完成
注意,选中 'spacemit-tcm' 而非 './spacemit-tcm_3.0.1_riscv64.deb'
有一些软件包无法被安装。如果您用的是 unstable 发行版,这也许是
因为系统无法达到您要求的状态造成的。该版本中可能会有一些您需要的软件
包尚未被创建或是它们已被从新到(Incoming)目录移出。
下列信息可能会对解决问题有所帮助:
下列软件包有未满足的依赖关系:
spacemit-tcm : 依赖: linux-image-6.18.3-generic (> 6.18.3-1.0.0~rc3.4) 但无法安装它
E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。
bianbu@bianbu:~$ sudo apt install linux-image-6.18.3-generic
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取状态信息... 完成
E: 无法定位软件包 linux-image-6.18.3-generic
E: 无法按照 glob ‘linux-image-6.18.3-generic’ 找到任何软件包
我尝试使用apt搜索更多有关内核的信息:
bianbu@bianbu:~$ apt search linux-image
正在排序... 完成
全文搜索... 完成
alsa-base/noble/snapshots/v2.2,now 1.0.25+dfsg-0ubuntu7 all [已安装,自动]
ALSA driver configuration files
linux-image-6.1.15/noble-porting/snapshots/v2.2 6.1.15-1.0.15+20241122144323 riscv64
Linux kernel, version 6.1.15
linux-image-6.1.15-dbg/noble-porting/snapshots/v2.2 6.1.15-1.0.15+20241122144323 riscv64
Linux kernel debugging symbols for 6.1.15
linux-image-6.6.36/noble-porting/snapshots/v2.2,bianbu-v2.2-updates 6.6.36-2.0.4.2 riscv64
Linux kernel, version 6.6.36
linux-image-6.6.36-dbg/noble-porting/snapshots/v2.2,bianbu-v2.2-updates 6.6.36-2.0.4.2 riscv64
Linux kernel debugging symbols for 6.6.36
linux-image-6.6.63/now 6.6.63-20250922112039 riscv64 [已安装,本地]
Linux kernel, version 6.6.63
linux-image-6.6.63-cloud/noble-porting/snapshots/v2.2 6.6.63-2.2.0.2 riscv64
Linux kernel, version 6.6.63-cloud
linux-image-6.6.63-cloud-dbg/noble-porting/snapshots/v2.2 6.6.63-2.2.0.2 riscv64
Linux kernel debugging symbols for 6.6.63-cloud
linux-image-6.6.63-dbg/noble-porting/snapshots/v2.2 6.6.63-2.2.0.2 riscv64
Linux kernel debugging symbols for 6.6.63
linux-image-6.6.63-dev/noble-porting/snapshots/v2.2 6.6.63-2.2~rc5.2+20250430010753 riscv64
Linux kernel, version 6.6.63-dev
linux-image-6.6.63-dev-dbg/noble-porting/snapshots/v2.2 6.6.63-2.2~rc5.2+20250430010753 riscv64
Linux kernel debugging symbols for 6.6.63-dev
linux-image-6.6.63-rt/noble-porting/snapshots/v2.2 6.6.63-2.2.0.2 riscv64
Linux kernel, version 6.6.63-rt
linux-image-6.6.63-rt-dbg/noble-porting/snapshots/v2.2 6.6.63-2.2.0.2 riscv64
Linux kernel debugging symbols for 6.6.63-rt
linux-image-6.8.0-31-generic/noble/snapshots/v2.2 6.8.0-31.31.1 riscv64
Linux kernel image for version 6.8.0 on RISC-V SMP
linux-image-allwinner/noble/snapshots/v2.2 6.8.0-31.31.1 riscv64
Allwinner Linux kernel image
linux-image-extra-virtual/noble/snapshots/v2.2 6.8.0-31.31.1 riscv64
Extra drivers for Virtual Linux kernel image
linux-image-generic/noble-porting/snapshots/v2.2 6.6.63 riscv64
Generic Linux kernel image
linux-image-virtual/noble/snapshots/v2.2 6.8.0-31.31.1 riscv64
Virtual Linux kernel image
linux-virtual/noble/snapshots/v2.2 6.8.0-31.31.1 riscv64
Minimal Generic Linux kernel and headers
(apt没能发现合适的linux-image包)
这是我的系统信息:
bianbu@bianbu:~$ uname -a
Linux bianbu 6.6.63 #20250922112039 SMP PREEMPT_RT Mon Sep 22 11:22:55 CST 2025 riscv64 riscv64 riscv64 GNU/Linux
bianbu@bianbu:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Bianbu
Description: Bianbu 2.2
Release: 2.2
Codename: noble
bianbu@bianbu:~$ cat /etc/os-release
PRETTY_NAME="Bianbu 2.2"
NAME="Bianbu"
VERSION_ID="2.2"
VERSION="2.2 (Noble Numbat)"
VERSION_CODENAME=noble
ID=bianbu
ID_LIKE=debian
HOME_URL="https://bianbu.spacemit.com"
SUPPORT_URL="https://bianbu.spacemit.com"
BUG_REPORT_URL="https://ticket.spacemit.com"
PRIVACY_POLICY_URL="https://www.spacemit.com/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=bianbu-logo
我需要使用更新版本的系统吗?以及哪里可以取得为K1预编译的这样的系统镜像?(老实说,我有点担心换系统,因为我依赖目前我系统上的 ros2 humble 组件)
链接中所提及的 spacemit-tcm_3.0.1_riscv64.deb 包貌似并不适合bianbu 2.2系统(on K1),或者说可能我的安装手法有问题