故障排查

使用以症状为先的故障排查方式。本页面介绍 Alauda AI Infrastructure NPU Management 及其 ACP 集成点。对于硬件健康状况、BIOS、固件和厂商驱动的深度调优,请参阅 Huawei 或 openFuyao 文档。

本页面中的命令使用默认的 Operator 命名空间 npu-operator。如果 Operator 安装在其他命名空间中,请将 npu-operator 替换为该命名空间;使用 Operator 命名空间的 operands 遵循安装时使用的命名空间。

Driver Pod 处于 ImagePullBackOff 状态

检查调度到受影响节点的 Driver Pod:

kubectl -n npu-operator get pods -l app.kubernetes.io/component=npu-driver -o wide
kubectl -n npu-operator describe pod <driver-pod-name>

常见原因:

  • 未镜像根据 HDK 版本、芯片和完整内核版本派生出的标签;
  • 目标业务集群中的 ImageWhiteList 不包含完整的镜像引用;
  • registry 凭据缺失或已过期。

按照准备 Driver 镜像中的说明重新准备镜像。如果镜像和白名单修复后,Pod 仍保留原有的拉取失败状态,请在维护窗口期间删除失败的 Driver Pod,以便 DaemonSet 重新创建它。

Driver 模式更改被拒绝

如果 ascend-runtime-containerd 记录了类似 refusing to change Ascend driver install mode from host to containerized 的错误,则表示节点持久化的运行时状态与请求的 NPU Operator 模式不一致。 这是用于防止混用 Host 和容器化 Driver 目录树的有意安全保护机制,并非文件权限错误。

此节点级保护机制独立于 Operator 的配置保护机制: NPUClusterPolicy.spec.driver.installMode 在策略 创建后不可变。不要仅通过编辑模式字段来切换现有的 NPUOperatorCtl;Operator 会报告 spec.driver.installMode cannot be changed 并保留原先应用的模式。请先使用文档中介绍的卸载和重新创建 工作流,以新模式创建策略。

将节点状态与 DaemonSet 环境进行比较:

# Run on the affected node through the approved node-debug or host access path.
cat /etc/ascend-docker-runtime.d/driver-mode
# Run from a workstation with access to the target workload cluster.
kubectl -n npu-operator get ds ascend-runtime-containerd -o jsonpath='{range .spec.template.spec.initContainers[?(@.name=="prepare-runtime")].env[*]}{.name}={.value}{"\n"}{end}'

状态文件包含类似以下内容的值:

installMode=host
driverRoot=/usr/local/Ascend/driver

仅可在经过批准的卸载/重新创建 迁移过程中删除状态文件,并且必须同时满足以下所有条件:

  • 管理员已明确批准模式迁移;
  • 节点上的 NPU 工作负载已停止或完成排空;
  • 新的 Driver 根目录、运行时配置和所需的 Driver 目录树均已准备就绪。

新安装呈现所选模式后,重新创建运行时 Pod,使其能够为该模式建立节点状态:

# Run on the affected node through the approved node-debug or host access path.
rm -f /etc/ascend-docker-runtime.d/driver-mode
# Run from a workstation with access to the target workload cluster.
kubectl -n npu-operator delete pod -l app.kubernetes.io/name=ascend-runtime-containerd

在恢复工作负载之前,验证新状态和 Pod 就绪情况:

# Run on the affected node through the approved node-debug or host access path.
cat /etc/ascend-docker-runtime.d/driver-mode
# Run from a workstation with access to the target workload cluster.
kubectl -n npu-operator get pod -l app.kubernetes.io/name=ascend-runtime-containerd -o wide

删除文件不会安装、卸载或迁移 Driver。如果 运行时仍针对 /mnt/tmp/runtime/ascend-docker-runtime 报告 cp: cannot overwrite non-directory, 请将其视为单独的临时 payload 目录或镜像内容问题,并继续检查运行时 Pod 日志。

节点未显示 NPU 可分配资源

检查 driver pod、device plugin、节点标签和可分配资源:

kubectl -n npu-operator get pods -o wide | grep -E "npu-driver|runtime|hccn"
kubectl -n npu-operator get daemonset ascend-device-plugin -o wide
kubectl get node ${nodeName} --show-labels
kubectl get node ${nodeName} -o jsonpath='{.status.allocatable}'

常见原因:

  • 共享的 NFD 或 NPU Feature Discovery 尚未就绪,或缺少必需的节点标签;
  • driver pod 尚未就绪;
  • device plugin 组件已禁用,例如设备由 HAMi 分配;
  • 持有卡的 Pod 卡在 Terminating,因此卡未被释放;
  • /run/ascend/.ready/driver-ready 中的运行时 driver 树尚未就绪;
  • 对于 Ascend 910 节点,缺少 HCCN 设备 IP 配置,或该配置尚未完成 reconcile;
  • 芯片在升级或恢复期间被报告为不健康。

对于 Ascend 910 节点,请检查 Device Plugin 日志。如果出现 spec.hccnBootstrap.enabled=true,还要检查 HCCN Bootstrap agents:

kubectl -n npu-operator logs ds/ascend-device-plugin --tail=100
kubectl -n npu-operator get ds hccn-bootstrap
kubectl -n npu-operator logs ds/hccn-bootstrap -c reporter --tail=100
kubectl -n npu-operator logs ds/hccn-bootstrap -c executor --tail=100

如果 device plugin 报告 HCCN 或设备 IP 错误,请确认目标节点具有所需的 HCCN 配置,然后再将 device plugin 视为根因。

NPU 组件 Pod 因缺少放置标签而处于 Pending 状态

Operator manager 和某些可选组件使用 masterselector=dls-master-node 或 workerselector=dls-worker-node 选择节点。核心 Driver、runtime、Device Plugin 和 Exporter 则使用已发现的 openfuyao.com/npu.present 标签。NPU Feature Discovery 通常会自动维护所有这些发现标签和角色标签。

检查发现组件是否在受影响的节点上运行,以及预期标签是否存在:

kubectl -n npu-operator get daemonset npu-feature-discovery
kubectl -n npu-operator get pods -l app=npu-feature-discovery -o wide
kubectl get nodes \
  -L node-role.kubernetes.io/control-plane,masterselector,workerselector,openfuyao.com/npu.present
kubectl describe pod <pending-component-pod>

对于控制平面节点,自动添加主节点标签需要标准的 node-role.kubernetes.io/control-plane 标签,以及一个能够在该节点上运行的 npu-feature-discovery Pod。在修改标签之前,请检查节点污点和 DaemonSet 调度。如果节点只有旧版 node-role.kubernetes.io/master 角色标签,请添加标准控制平面角色标签;否则,正在运行的发现 Pod 会将其视为 worker,并移除手动添加的 masterselector。

如果发现组件无法覆盖预期节点,并且使用角色选择器的组件仍处于 Pending 状态,请应用匹配的放置标签作为临时后备方案:

kubectl label node <control-plane-node-id> masterselector=dls-master-node --overwrite
kubectl label node <npu-worker-node-id> workerselector=dls-worker-node --overwrite

请勿同时使用这两个标签来选择互不相关的节点。当发现组件稍后在该节点上运行时,它会将这些值 reconcile 为检测到的节点角色。

Pod 处于 Pending 状态

描述该 Pod:

kubectl describe pod <pod-name>

检查请求的资源键是否与节点上的资源键匹配:

  • huawei.com/Ascend910
  • huawei.com/Ascend310P
  • 已安装的 Device Plugin 报告的其他 huawei.com/Ascend* 键

同时检查所有 NPU 资源是否都已分配:

kubectl describe node ${nodeName} | sed -n '/Allocated resources:/,/Events:/p'

如果 ACP 项目或命名空间配额阻止了调度,请在 ACP 中调整配额。有关配额字段的可见性,请参阅 Accelerator Resource Quota。

Pod 正在运行,但无法看到 NPU 设备

检查准入后的 Pod、RuntimeClass、Device Plugin 和运行时集成组件:

kubectl get pod <pod-name> -o jsonpath='{.spec.runtimeClassName}{"\n"}'
kubectl get runtimeclass ascend
kubectl -n npu-operator get pods -o wide | grep -E "runtime|toolkit"
kubectl -n npu-operator logs ds/ascend-device-plugin --tail=100
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

准入后的 Pod 应使用 ascend RuntimeClass。运行时集成 DaemonSet 会暂存 ascend-docker-runtime 有效负载,并使用 npu-container-toolkit 维护 ascend containerd handler 配置。在场景 2.2 中,主机侧运行时 Driver 树会暂存到 /run/ascend/driver 下;在场景 1 和 2.1 中,运行时使用 /usr/local/Ascend/driver 下的 Host Driver。

预期的工作负载侧检查:

kubectl logs <pod-name> --tail=100
kubectl exec <pod-name> -- ls -la /dev/davinci* /dev/davinci_manager
kubectl exec <pod-name> -- /usr/local/bin/npu-smi info

如果需要从调试容器内部检查挂载,请检查 /usr/local/bin/npu-smi 和 /usr/local/Ascend/... 等工作负载侧路径。不要将这些工作负载路径与 /run/ascend/driver 下的主机侧预编译运行时树混淆。

启用默认准入 webhook 后,提交的工作负载清单无需设置 runtimeClassName;准入后的 Pod 应包含 runtimeClassName: ascend。如果缺少该字段,请检查 webhook 是否已启用并就绪,以及 Pod 是否请求了可识别的 huawei.com/Ascend* 资源。如果 webhook 已禁用,请显式设置 runtimeClassName: ascend。

如果准入后的 Pod 使用了预期的 RuntimeClass,但仍未获得设备,请检查 Device Plugin 的分配结果以及 ascend containerd handler。重启组件时,务必遵循当前产品版本随附的运行时集成操作步骤。

Pod 在准入后没有 RuntimeClass

Operator webhook 使用 failurePolicy: Ignore。如果 webhook 不可用,API server 可能会准入 Pod,而不添加 runtimeClassName。这并不能证明 runtime 注入正常工作。请检查 webhook 和已准入的 Pod:

kubectl get pod <pod-name> -o jsonpath='{.spec.runtimeClassName}{"\n"}'
kubectl -n npu-operator get deployment npu-pod-webhook
kubectl -n npu-operator logs deployment/npu-pod-webhook --tail=100

对于请求 Ascend 资源的工作负载,在修复 webhook 期间显式设置 RuntimeClass:

spec:
  runtimeClassName: ascend

只使用一个注入所有者。如果 HAMi 或其他 admission 组件注入 RuntimeClass,请在另一个组件中禁用重复的注入器。

RuntimeClass 存在,但 containerd handler 缺失

ascend RuntimeClass 与 containerd handler 是两个独立的对象。主机升级或 containerd 配置替换可能会导致 RuntimeClass 仍然存在,但删除其引用的 handler。请在受影响的节点上检查这两个值:

kubectl get runtimeclass ascend -o jsonpath='{.handler}{"\n"}'
kubectl -n npu-operator get ds ascend-runtime-containerd -o wide
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

handler 名称必须与 RuntimeClass handler 匹配,通常为 ascend。恢复节点的 containerd 配置后,重启该节点上的 runtime integration Pod,并等待 DaemonSet 就绪。然后重新创建一个小型测试 Pod,并验证其已准入的 RuntimeClass 和设备文件。

当 runtime integration DaemonSet 正在管理 containerd 配置时,请勿手动编辑该配置。

Metrics 缺失

检查 exporter 和 ServiceMonitor:

kubectl -n npu-exporter get pods -l app=npu-exporter
kubectl -n npu-exporter get servicemonitor npu-exporter-servicemonitor

如果两者都存在,请继续参阅 ACP monitoring 文档,检查 dashboard 导入、Prometheus 发现和抓取错误。

手动 Driver 升级未启动

此条目描述的是 v26.6.0 中交付的 Driver 升级;Driver 升级在 v26.9.0-1 中尚未验证。使用 spec.driver.upgradePolicy.autoUpgrade=false 时,v26.6.0 不会在手动批准之前创建重启事务。请仅在维护窗口期间批准目标节点:

kubectl annotate node ${nodeName} npu.openfuyao.com/approve-reboot=true --overwrite

Operator 使用该批准后,检查重启事务和 Rebooter Pod:

kubectl get node ${nodeName} \
  -o custom-columns=NAME:.metadata.name,REBOOT-REQUIRED:.metadata.labels.npu\.openfuyao\.com/reboot-required,REBOOT-REASON:.metadata.annotations.npu\.openfuyao\.com/reboot-reason,TARGET-DRIVER-ID:.metadata.annotations.npu\.openfuyao\.com/target-driver-id
kubectl get nodes -l npu.openfuyao.com/reboot-required=true
kubectl -n npu-operator get pods | grep npu-rebooter
kubectl -n npu-operator logs ds/npu-rebooter --tail=100

随后,目标节点应具有 npu.openfuyao.com/reboot-required=true。如果未出现该标签,请检查 NPU Operator controller 日志,并确认该节点位于当前 Driver 目标集合中。请勿为所有 NPU 节点批量添加 annotation,因为未使用的原始批准可能会留在某个节点上,并批准后续事务。

升级后旧版 Device Plugin 记录了 forbidden 错误

从 v26.6.0 升级后,kube-system 中的 Device Plugin Pod 每秒都会记录以下错误:

configmaps "mindx-dl-deviceinfo-<node-name>" is forbidden: User "system:serviceaccount:kube-system:ascend-device-plugin-sa" cannot update resource "configmaps"

检查 Ascend Device Plugin DaemonSet 的数量:

kubectl get daemonset -A | grep ascend-device-plugin

如果 kube-system 中列出了一个,Operator 命名空间中也列出了一个,则说明升级时遗留了 v26.6.0 的 Device Plugin。请按照从 v26.6.0 升级到 v26.9.0-1中的说明将其移除。名为 hami-ascend-device-plugin 的 DaemonSet 属于 HAMi,与此问题无关。

ClusterD 处于 CrashLoopBackOff 状态

kubectl -n mindx-dl logs deployment/clusterd --tail=20

如果日志以 init k8s servers failed, error: volcano not exist, please deploy volcano 结尾,则说明启用了 ClusterD,但未启用 Volcano。可以禁用 ClusterD(clusterd.enabled: false),也可以按照启用 MindCluster Volcano中的说明同时启用 Volcano 组件。创建 Volcano CRD 后,ClusterD 会自行恢复。

Volcano Pod 处于 Pending 状态

kubectl -n volcano-system get pods -o wide
kubectl -n volcano-system describe pod <volcano-pod-name>
kubectl -n npu-operator get pods -l app=npu-operator -o wide
kubectl get nodes -L masterselector

调度消息会指出未满足的约束:

消息包含原因操作
didn't match Pod's node affinity/selector没有节点带有 masterselector=dls-master-node,或者只有没有可用资源的节点带有此标签。按照由于缺少放置标签,NPU 组件 Pod 处于 Pending 状态中的说明检查标签。
didn't match pod affinity rulesVolcano Pod 必须运行在 NPU Operator Pod 所在的节点上,而该节点不符合条件。使用 operator.nodeSelector 将 Operator Pod 移至带有标签且资源充足的节点。
Insufficient cpu 或 Insufficient memory运行 Operator Pod 的节点无法满足 Volcano 的资源请求。降低 vccontroller.controllerResources 和 vcscheduler.schedulerResources 的值,包括限制值和请求值。

有关相关设置,请参阅启用 MindCluster Volcano。

Volcano Job 一直处于 Pending 状态

kubectl get podgroup -n <namespace> -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.conditions[*].message}{"\n"}{end}'

如果 PodGroup 报告 require npu num is 1, but cluster npu num is 0,则 Volcano scheduler 看不到空闲的 NPU。请检查两个常见原因:

  1. Device Plugin 未处于 Volcano 模式。其参数必须包含 -volcanoType=true:

    kubectl -n npu-operator get ds ascend-device-plugin \
      -o jsonpath='{.spec.template.spec.containers[0].args}{"\n"}'

    在 NPUOperatorCtl 实例中设置 devicePlugin.args.volcanoType: true。

  2. 另一 Pod 仍占用该卡。例如,卡在 Terminating 的 Pod(如一直未能拉取镜像的 Pod)会持续占用其设备,直到该 Pod 被删除:

    kubectl get pods -A --field-selector spec.nodeName=<node-name> | grep -E 'Terminating|Pending'
    kubectl -n kube-system get configmap mindx-dl-deviceinfo-<node-name> -o jsonpath='{.data.DeviceInfoCfg}'

    卡被占用时,该资源键对应的设备列表为空。删除卡住的 Pod 后,Job 就会被调度。

如果 Job 完全没有状态,且未创建 PodGroup,请检查 Volcano controller 日志中是否有 is forbidden 消息,并确认产品版本为 v26.9.0-1。

HAMi Device Plugin 找不到驱动程序库

HAMi 分配设备时,HAMi Ascend Device Plugin Pod 处于 CrashLoopBackOff 状态,日志中显示:

deviceManager init failed, prepare dcmi failed, err: cannot found valid driver lib

HAMi Ascend Device Plugin 配置(hostPaths.ascendDriver)中的 Ascend 驱动程序主机路径与节点上的 Driver 路径不匹配。Driver 安装在主机上时使用 /usr/local/Ascend/driver;NPU Operator 以容器化模式安装 Driver 时使用 /run/ascend/driver。修正路径后,Pod 将启动,节点也会通过 HAMi 报告其 Ascend 资源。请参阅为 HAMi 准备 Ascend 基础环境。

在运行 HAMi 的集群上,Pod 因节点未注册而处于 Pending 状态

请求 Ascend 资源的 Pod 一直处于 Pending 状态,其事件中包含 node unregistered 或来自 hami-scheduler 的 FilteringFailed 消息,尽管节点已报告该资源:

kubectl get pod <pod-name> -o jsonpath='{.spec.schedulerName}{"\n"}'
kubectl describe pod <pod-name> | sed -n '/Events:/,$p'

集群正在运行 HAMi。HAMi admission webhook 会为请求 Ascend 资源的 Pod 设置 schedulerName: hami-scheduler,但 NPU 节点由 NPU Operator Device Plugin 提供服务,且未在 HAMi 中注册。请选择以下一种方式:

  • 让 HAMi 分配设备。请按照为 HAMi 准备 Ascend 基础环境中的说明操作。

  • 继续通过 NPU Operator Device Plugin 直接分配设备,并将工作负载命名空间排除在 HAMi webhook 之外:

    kubectl label namespace <namespace> hami.io/webhook=ignore

    此后在该命名空间中创建的 Pod 将使用默认调度器。