验证

使用此页面确认 Alauda Build of NPU Operator 已安装 NPU 堆栈,并且工作负载可以使用 NPU 资源。

验证 operator 状态

检查 NPUOperatorCtl 实例:

kubectl -n npu-operator get npuoperatorctl

Deployed 条件应为 True。新安装的 NPUOperatorCtl 会报告原因为 InstallSuccessful;成功完成 Helm release 升级后,则会报告 UpgradeSuccessful。

检查已部署命名空间中的组件 pod:

kubectl -n npu-operator get pods
kubectl -n kube-system get pods -l name=ascend-device-plugin-ds
kubectl -n npu-exporter get pods -l app=npu-exporter
kubectl -n mindx-dl get pods
kubectl -n default get daemonset mindio-tft mindio-acp --ignore-not-found

在默认安装中,Operator、Driver、Runtime 和 NPU Feature Discovery 运行于 npu-operator;如果选择了其他命名空间,这些资源将遵循 Operator 的安装命名空间。Ascend Device Plugin 运行于 kube-system,NPU Exporter 运行于 npu-exporter,可选的 MindCluster 组件运行于 mindx-dl,可选的 MindIO DaemonSet 运行于 default。启用相应组件时,其 pod 应处于 Running 状态;禁用这些组件时,可选组件返回空结果是预期行为。

验证节点资源

检查节点可分配资源:

kubectl get node ${nodeName} -o jsonpath='{.status.allocatable}'

预期示例:

{
  "huawei.com/Ascend910": "8",
  "huawei.com/Ascend310P": "1"
}

具体的键和值取决于芯片型号、device plugin 版本和卡数量。910 系列节点(包括 910B 节点)可能会报告 huawei.com/Ascend910。使用目标节点可分配资源中显示的资源键。

验证驱动就绪状态

检查 NPU 节点上的驱动 DaemonSet 是否已就绪:

kubectl -n npu-operator get pods -l app=npu-driver-daemonset -o wide

启用运行时驱动树模式后,驱动 pod 会在主机上的 /run/ascend/.ready/driver-ready 写入就绪门控,并从 /run/ascend/driver 暴露运行时驱动树。

在每个选定的 NPU 节点上,验证持久化的运行时模式是否与 NPUOperatorCtl 中选择的模式一致。通过已批准的节点调试或主机管理路径运行第一条命令:

cat /etc/ascend-docker-runtime.d/driver-mode
kubectl -n npu-operator get ds ascend-runtime-containerd -o jsonpath='{range .spec.template.spec.initContainers[?(@.name=="prepare-runtime")].env[*]}{.name}={.value}{"\n"}{end}'

在场景 1 和 2.1 中,该文件应报告 installMode=host;在场景 2.2 中,应报告 installMode=containerized。其 driverRoot 也应与所选场景(/usr/local/Ascend/driver 或配置的 spec.driver.driverInstallDir)一致。运行时脚本会按设计拒绝 installMode 不匹配;将 driverRoot 不匹配视为部署配置错误,并在运行工作负载前修正。对于任一情况,请先按照拒绝驱动模式更改中的步骤操作,然后再继续。

NOTE

对于 Ascend 910B,节点重启后驱动初始化可能需要几分钟,因为芯片 PHY 启动速度比 310P 慢。请等待驱动 pod 处于 Ready 状态后,再检查工作负载注入。

验证 RuntimeClass 集成

检查目标业务集群中的 RuntimeClass 和运行时集成 DaemonSet:

kubectl get runtimeclass ascend
kubectl -n npu-operator get ds ascend-runtime-containerd
kubectl -n npu-operator logs ds/ascend-runtime-containerd -c prepare-config --tail=100
kubectl -n npu-operator logs ds/ascend-runtime-containerd -c inject --tail=100

RuntimeClass 名称和 handler 都应为 ascend。在 v26.6.0 中,将交付的 operator.runtimeClass 值保持为 ascend,使其与运行时集成 DaemonSet 注册的 containerd handler 匹配。该 DaemonSet 会安装 ascend-docker-runtime 负载,并维护相应的 containerd handler 配置。在预编译驱动模式下,主机侧运行时 Driver 树暂存于 /run/ascend/driver 下。在预安装 Driver 和普通 OS 管理安装模式下,运行时使用 /usr/local/Ascend/driver 下的 Host Driver。

如果 RuntimeClass 存在,但工作负载在运行时设置之前失败,请参阅RuntimeClass 存在但缺少 containerd handler。节点升级可能会移除 handler,同时保留未更改的 RuntimeClass 对象。

验证工作负载

在 NPU 节点上运行一个小型工作负载镜像。使用节点实际播发的资源键。不同的 Ascend 集群可能会播发不同的 huawei.com/Ascend* 键,因此请先检查节点可分配资源,而不要为每个集群硬编码同一个键。

如果集群处于隔离网络环境,或实施了镜像白名单策略,请将镜像替换为内部镜像。

NOTE

启用默认准入 webhook 时,请勿在此示例中添加 runtimeClassName。webhook 检测到 Ascend 资源请求后会添加 runtimeClassName: ascend。如果 webhook 已禁用,请显式设置 runtimeClassName: ascend。

apiVersion: v1
kind: Pod
metadata:
  name: npu-smoke
spec:
  restartPolicy: Never
  containers:
  - name: probe
    image: <your-npu-image>
    command: ["/bin/bash", "-lc"]
    args:
    - |
      set -euo pipefail
      echo "=== devices ==="
      ls -la /dev/davinci* /dev/davinci_manager /dev/devmm_svm /dev/hisi_hdc 2>/dev/null
      echo "=== Ascend runtime paths ==="
      grep -E '/usr/local/(bin/npu-smi|Ascend/driver)' /proc/mounts || true
      echo "=== npu-smi ==="
      /usr/local/bin/npu-smi info
      echo "=== application check ==="
      # Run the smallest supported ACL or application probe used by your image.
    resources:
      limits:
        <huawei.com/Ascend-resource-key>: 1

应用 YAML,然后检查日志:

kubectl get pod npu-smoke -o jsonpath='{.spec.runtimeClassName}{"\n"}'
kubectl logs npu-smoke

准入后的 Pod 应使用 ascend RuntimeClass。设备节点和 npu-smi info 只能证明设备可见性。在接受该节点之前,请运行 ACL 探测程序,确认其能够初始化设备、分配和释放内存、重置设备并成功完成终结, 然后运行受支持的最小 NPU 应用操作。删除 Pod,并确认另一个工作负载可以获取该设备。 工作负载镜像必须提供 CANN、框架以及探测程序或应用;运行时负责提供设备和 Driver 文件。 运行时路径正常工作时,npu-smi 可在 /usr/local/bin/npu-smi 中找到, Driver 库会挂载到 /usr/local/Ascend/... 下。在预编译 Driver 模式下,运行时 Driver 树的主机侧源路径为 /run/ascend/driver。

验证监控

如果已启用 NPU Exporter,operator 会在 npu-exporter 命名空间中创建其 ServiceMonitor:

kubectl -n npu-exporter get servicemonitor npu-exporter-servicemonitor

使用 ACP 监控页面管理监控面板。有关监控面板操作,请参阅 管理监控面板。