Hyperpod Node Debugger
AWS LabsOfficialPublished by AWS Labs
- Skill
- Workflow
- Cloud and DevOps
- Apache-2.0
- Low risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The HyperPod Node Debugger provides a structured, read-only diagnostic workflow for identifying and resolving issues on individual nodes within a HyperPod cluster. It covers a wide range of failure modes, including EFA networking, GPU/accelerator hardware faults (XID, ECC, NVLink), Slurm node states, resource exhaustion, and container runtime errors. The skill emphasizes a safe, non-destructive triage process, requiring explicit customer approval for any remediation steps, and includes specific guidance for Infrastructure-as-Code (IaC) environments to prevent configuration drift.
What it does
- Performs read-only triage of cluster nodes to identify health failures.
- Maps detected symptoms to specific diagnostic sections for targeted troubleshooting.
- Provides verified commands for remediation, including rebooting or replacing nodes.
- Includes safety checks for IaC-managed resources to prevent configuration drift.
- Supports both EKS and Slurm orchestrators for HyperPod environments.
- Guides the user through a structured investigate-reboot-replace escalation path.
When to use it
- When a specific node in a HyperPod cluster is unhealthy, unresponsive, or stuck.
- When training jobs hang due to suspected hardware or networking issues on a single node.
- When GPU/accelerator errors (e.g., XID, ECC, NVLink) are suspected.
- When investigating node-level resource exhaustion (disk, memory, OOM).
- When Slurm nodes are marked as down or drained unexpectedly.
Advantages
- Standardizes the diagnostic process for complex HyperPod node failures.
- Reduces manual effort by automating the collection of cluster and node health signals.
- Prioritizes safety by enforcing a read-only triage phase before any remediation.
- Provides clear guidance on when to escalate to AWS Support.
- Integrates with existing IaC workflows to maintain infrastructure integrity.
Usage examples
- “My node i-0123456789abcdef0 is stuck in a Pending state. How do I check it?”
- The agent will run the triage script focused on that specific instance ID, identify the failure reason (e.g., lifecycle script or hardware), and provide the corresponding diagnostic steps.
- “I suspect a GPU hardware failure on node i-0987654321fedcba0. What should I do?”
- The agent will guide you to check for XID or ECC errors using the provided diagnostic commands and, if confirmed, suggest the appropriate batch-reboot or batch-replace procedure.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/awslabs/hyperpod-node-debugger/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip hyperpod-node-debugger.zip -d .agents/skills
Documentation by AWS Labs
HyperPod Node Debugger
Operating policy. Run read-only diagnostics yourself. Never run a command that changes cluster, node, or workload state — present each one as a Suggested command (run this yourself) block and wait for the customer. Destructive order: investigate → reboot → replace (replace destroys root + secondary volumes; not supported on Slurm controller nodes). Never discard training state, logs, or caches on speculation.
IaC note (always include with mutation commands). When you suggest any command that changes cluster, VPC, SG, subnet, or EKS configuration (e.g. authorize-security-group-*, modify-vpc-attribute, update-cluster, kubectl label/cordon/drain, create namespace, set env daemonset), ask the customer first whether the cluster / VPC / SG is managed by Infrastructure-as-Code (CloudFormation, CDK, Terraform, Pulumi). If yes, tell them: "Apply this change in your IaC source first, then deploy through the pipeline — running the command directly will drift from your template and the next stack update may overwrite it." If they need to fix the issue immediately and the IaC change will follow, flag the drift explicitly so they remember to reconcile.
Read-only triage. scripts/triage-cluster.sh (and helpers check-efa-sg.sh, check-node-reachability.sh, check-vpc-config.sh) read state and print each issue as [FAIL] ... → references/node-diagnostics-detail.md § <section>. Catalog of customer-ticket patterns: references/node-issue-catalog.md.
Workflow
Collect cluster name, region, suspect instance ID, exact error string from logs.
Run
scripts/triage-cluster.sh(add--node <INSTANCE-ID>to focus one node).For every
[FAIL]/ issue entry,Readthe referenced section.Present: what script detected (copy the line verbatim), root cause, exact command(s) with instance/SG IDs filled in, blast radius (e.g. "reboots i-xxx", "wipes volumes on replacement"). For any command that mutates cluster/VPC/SG/EKS state, ask whether the affected resource is IaC-managed and surface the drift warning from the operating-policy note above.
Wait for explicit customer approval. Destructive order: investigate → reboot → replace.
Re-run triage to confirm. Iterate if not cleared.
Step 1: Triage
bash scripts/triage-cluster.sh --cluster <CLUSTER_NAME_OR_ARN> --region <REGION>
# Focus on one node:
bash scripts/triage-cluster.sh --cluster <CLUSTER_NAME_OR_ARN> --region <REGION> --node <INSTANCE_ID>One pass collects: cluster status + NodeRecovery, events, per-node health (HyperPod + EKS labels, Slurm states), VPC/SG snapshot, CloudWatch availability, SSM readiness, on-node resource checks (disk, memory, /dev/shm, OOM, NVMe, time sync, SSM agent), Slurm node→instance mapping.
Tags: [PASS] passed · [FAIL] issue with a → references/... pointer · [WARN] advisory · [INFO] informational. Priorities: P0 blocks operation · P1 degraded · P2 informational.
Step 2: Match signal → section
Events (list-cluster-events) — provisioning-time:
| Event | Section |
|---|---|
"EFA health checks did not run successfully" (public-doc verbatim signal) | A: EFA/SG |
| Instance bootstrap or network-misconfiguration event | A + B: VPC |
| Lifecycle-script failure or timeout | D: Lifecycle |
| Insufficient-capacity or AZ-mismatch failure at creation | C: Capacity |
Hardware failure / UnschedulablePendingReplacement | F: Hardware |
EKS labels:
| Label | Section |
|---|---|
node-health-status: UnschedulablePendingReplacement | F |
node-health-status: UnschedulablePendingReboot | F |
deep-health-check-status: Failed | G → F |
Symptoms:
| Symptom | Section |
|---|---|
| Training hangs at NCCL init / AllReduce | A → E |
Slurm node down / "Node unexpectedly rebooted" | H: Slurm |
| Jobs stuck PENDING / COMPLETING | H |
| Auto-repair not triggering | F |
| GPU not visible / XID / ECC errors | G |
| GPU row-remap pending/failed / silent NaNs / DCGM Fail | G § G.1.a/b |
Disk full / OOM / "Cannot allocate memory" | I: Resources |
| Wrong vCPU count (e.g. 96 instead of 192 on p5.48xlarge) | J: Config |
| Container CrashLoopBackOff / runtime crash | M: Container Runtime |
aws-node CrashLoopBackOff / gRPC 50051 refused | O: CNI / Pod Networking |
| Pods stuck Pending with no IP / CNI error | O |
DNS resolution / enableDnsSupport | B § B.2 |
| Public subnet / IGW misconfigured | B § B.3 |
| Missing VPC endpoints (ECR / STS / FSx) | B § B.4 |
| EKS VPC / SG mismatch with HyperPod | B § B.5 |
| Kernel panic / watchdog / hung task | N: Kernel |
| Need shell on a node | K: SSM |
| Collect logs for AWS Support | L: Log Collection |
A: EFA / Security Group
Per the HyperPod prerequisites doc, the SG must allow all inbound and outbound to itself. scripts/check-efa-sg.sh validates self-ref rules on every cluster SG. On-node EFA check via scripts/check-node-reachability.sh over SSM. Full: § A.
B: VPC / Routing
SG/subnet VPC mismatch, missing S3 Gateway endpoint, EKS auth mode, worker→controller routing, VPC DNS support, private-subnet + NAT / VPC endpoints, EKS↔HyperPod VPC alignment. scripts/check-vpc-config.sh. Full: § B.
C: Capacity / AZ
Insufficient-capacity failure at creation, or no subnets in the AZ where capacity is available. Check AZ offerings via describe-instance-type-offerings, then change subnet AZ or use Flexible Training Plans / ODCR. Full: § C.
D: Lifecycle Scripts
Surfaced in cluster events + CloudWatch under LifecycleConfig/<group>/<instance-id>. Common: S3 connectivity, IAM gaps, CRLF line endings, infinite loops, parameter-name mismatch. Full: § D.
E: Software Versions
Delegate to hyperpod-version-checker to compare NVIDIA driver, CUDA, NCCL, EFA installer, OFI NCCL, PyTorch across nodes. Ensure job env has FI_PROVIDER=efa, FI_EFA_USE_DEVICE_RDMA=1, NCCL_SOCKET_IFNAME=^lo,docker. Full: § E.
F: Hardware / Auto-Repair
Confirm NodeRecovery=Automatic, inspect the EKS health labels + sagemaker.amazonaws.com/fault-details annotation, and read the SagemakerHealthMonitoringAgent/<group>/<instance> CloudWatch stream. HMA runs passive background checks on GPU and Neuron state and reboots the node on count mismatch (per the HMA doc: "if there's a mismatch between the expected number of GPUs … and the count returned by nvidia-smi, then HMA reboots the node"; same for neuron-ls). Manual recovery order: reboot first, replace only if reboot fails; the preferred path is the batch APIs (BatchReboot/BatchReplaceClusterNodes). Full: § F · patterns: node-issue-catalog.md.
G: GPU / Accelerator
NVIDIA (p4d/p5/g5/g6): nvidia-smi + dmesg over SSM for Xid, ECC, thermal throttling. Xid classification per NVIDIA's catalog: 13 Graphics Engine Exception (application-level), 31 GPU memory page fault (application, can be driver/HW), 63 GPU memory remapping event (HW/ECC), 71 CE4 Error (HW copy engine), 74 NVLink Error (HW), 79 GPU has fallen off the bus (PCIe bus), 109 Context Switch Timeout Error (HW). Any uncorrectable ECC → drain and replace. Row-remap state is the authoritative silent-degradation signal (§ G.1.a).
Trainium / Inferentia (trn1/trn2/inf2): Neuron SDK — neuron-ls, neuron-top, neuron-monitor. nvidia-smi does not apply.
GPU / accelerator failures flow into § F for reboot / replace. Full: § G.
H: Slurm Node Management
Node down/unresponsive, unexpected reboots, stuck PENDING/COMPLETING jobs, Slurm-to-instance-ID translation. Primary access is SSM; diagnose slurmd first, fix the root cause, then start/resume the node per § H. Full: § H.
I: Resource Exhaustion
Disk full (HyperPod root volume defaults to 100 GB and is not intended to grow post-creation), OOM, os.fork() memory error, /dev/shm exhaustion, inode exhaustion. Fork-memory fix: export FI_EFA_USE_HUGE_PAGE=0. Redirect bulk data to /opt/sagemaker (secondary EBS) or /opt/dlami/nvme (instance store). Full: § I.
J: Configuration
p5.48xlarge reports 96 vCPU instead of 192 → set ThreadsPerCore=2 via update-cluster. Full: § J.
K: Node Access via SSM
No direct SSH on HyperPod. Target format sagemaker-cluster:<CLUSTER_ID>_<GROUP>-<INSTANCE_ID>. Failures: plugin missing, wrong prefix, IAM, VPC endpoints. Full: § K.
L: Log Collection
Delegate to hyperpod-issue-report for S3-stored bundles. Key CloudWatch streams: LifecycleConfig/<group>/<instance-id>, SagemakerHealthMonitoringAgent/<group>/<instance-id>. Full: § L.
M: Container Runtime
CrashLoopBackOff, OOMKilled, ImagePullBackOff, RunContainerError on EKS. kubectl describe pod + on-node crictl ps -a, journalctl -u containerd. Full: § M.
N: Kernel & System
Kernel panic, watchdog timeout, soft lockup, unexpected reboots not explained by HyperPod health monitoring. dmesg | grep -iE 'panic|watchdog|hung_task|NMI' + journalctl -b -1. nvrm-related signatures point at NVIDIA driver crashes. Full: § N.
O: CNI / Pod Networking
VPC CNI (aws-node) failures, IPAMD errors, gRPC 127.0.0.1:50051 refused, pods stuck Pending with FailedCreatePodSandBox. Script auto-checks aws-node, kube-proxy, CoreDNS. Full: § O.
Prerequisites
awsCLI v2, recent enough to support the HyperPod cluster commands (describe-cluster,list-cluster-nodes,batch-reboot-cluster-nodes,batch-replace-cluster-nodes)python3,bash4+ (associative arrays are required by the scripts)kubectlauthenticated to the EKS cluster (K8s checks skipped if absent)session-manager-pluginfor on-node hardware checksunbuffer(from theexpectpackage) — optional; if missing, SSM on-node probes are skipped while the rest of the triage still runs. Install viayum install expect/apt install expect.
Defaults
Region — required: pass
--regionor set$AWS_DEFAULT_REGION.Target scope — all nodes;
--node <ID>focuses one.Event window — up to 500 most recent events (5 × 100, paginated).
Node list cap — up to 20,000 nodes (200 × 100); warns on cap.
SSM probes — 180 s per node with retry-on-throttle.
Colors — auto-disabled on non-TTY;
--no-colorto force off.
Error handling
| Failure | Script | Tell the customer |
|---|---|---|
aws sts get-caller-identity fails | Exit 1 | "Fix AWS credentials and rerun." |
describe-cluster fails | Exit 1 after listing region's clusters | "Confirm cluster name and region." |
sagemaker:* / ec2:* / logs:* AccessDenied | Warn, add Missing IAM permission for <API>, continue | "Grant the listed IAM action and rerun." |
kubectl absent or unauthenticated | Skip K8s checks | "Install/authenticate kubectl (see § K)." |
session-manager-plugin absent | Skip on-node probes | "Install session-manager-plugin (see § K)." |
SSM start-session fails or times out (180s) | Mark node unreachable with → § K pointer | "Rerun with --node <ID> to isolate; verify SSM agent on the node." |
| Cluster > 20,000 nodes | First 20,000 paginated; warn | "Use --node to target specific nodes." |
Exit codes: 0 triage complete · 1 cluster not found or fatal prerequisite missing.
IAM permissions
Read-only diagnostic — covers triage-cluster.sh, check-efa-sg.sh, check-vpc-config.sh, and check-node-reachability.sh:
{
"Action": [
"sagemaker:DescribeCluster",
"sagemaker:DescribeClusterNode",
"sagemaker:ListClusterNodes",
"sagemaker:ListClusterEvents",
"sagemaker:ListClusters",
"eks:DescribeCluster",
"ec2:DescribeSecurityGroups",
"ec2:DescribeSubnets",
"ec2:DescribeVpcs",
"ec2:DescribeVpcAttribute",
"ec2:DescribeVpcEndpoints",
"ec2:DescribeRouteTables",
"ec2:DescribeNetworkInterfaces",
"ec2:DescribeInstances",
"ec2:DescribeInstanceTypeOfferings",
"ec2:DescribeInstanceTypes",
"logs:DescribeLogGroups",
"logs:DescribeLogStreams",
"logs:FilterLogEvents",
"ssm:StartSession",
"ssm:TerminateSession",
"service-quotas:GetServiceQuota"
]
}sts:GetCallerIdentity is implicit — it requires no IAM action. SSM on HyperPod uses start-session against sagemaker-cluster:<cluster-id>_<group>-<iid> targets — not send-command against bare instance IDs. For remediation commands, grant the matching write permission (e.g. ec2:AuthorizeSecurityGroupIngress / Egress, ec2:RevokeSecurityGroupIngress / Egress, ec2:ModifyVpcAttribute, sagemaker:UpdateCluster, sagemaker:BatchRebootClusterNodes, sagemaker:BatchReplaceClusterNodes). Not needed for the diagnostic itself.
Skill delegation
| Need | Use |
|---|---|
| Cluster creation / deployment failures | hyperpod-cluster-debugger (§ A / B / C / H + --validate) |
| Cluster-wide SSM outage | hyperpod-cluster-debugger § F |
| Single-node SSM failure | stay here — § K |
| Cluster-wide EFA health-check failure at creation time | hyperpod-cluster-debugger § A |
| Single-node EFA failure post-provisioning | stay here — § A |
| NCCL AllReduce / collective-op timeouts (distributed) | hyperpod-nccl |
| Silent GPU NaNs on a specific node (row-remap / DCGM) | stay here — § G.1 (even if discovered by NCCL) |
| Post-deployment cluster-wide management | hyperpod-cluster-debugger |
| Shell / commands on nodes | hyperpod-ssm |
| CUDA / NCCL / EFA version comparison | hyperpod-version-checker |
| Diagnostic bundle for AWS Support | hyperpod-issue-report |
| Training performance / MFU degradation | hyperpod-mfu-debugger |
Escalate to AWS Support
Escalate when:
SG rules correct and reachability passes but EFA still fails.
VPC correct but K8s bootstrap fails — check VPC flow logs for REJECT.
Hardware failure where replacement keeps failing (bad physical host).
Node replacement fails with an insufficient-capacity signal despite a valid ODCR.
Before opening the case
# 1. Cluster identity + affected node status
aws sagemaker describe-cluster --cluster-name <CLUSTER> --region <REGION>
aws sagemaker list-cluster-nodes --cluster-name <CLUSTER> --region <REGION> \
--query "ClusterNodeSummaries[?InstanceId=='<INSTANCE_ID>']"
# 2. Triage bundle (scoped to the affected node where possible)
bash scripts/triage-cluster.sh --cluster <CLUSTER> --region <REGION> --node <INSTANCE_ID> > triage.txt
# 3. Per-node log/config bundle to S3 (delegates to hyperpod-issue-report)
# See skills/hyperpod-issue-report/SKILL.md for the exact invocation.Include in the case
Cluster name + ARN and AWS region
Orchestrator (EKS or Slurm)
Affected instance IDs / node names / instance-group names
Timestamp window (UTC start / end) of the failure
Exact error strings observed (copy verbatim from pod logs, CloudWatch, dmesg, events)
XID numbers / ECC counts / DCGM output where hardware is implicated
triage.txtfrom step 2 aboveS3 URI of the
hyperpod-issue-reportbundle from step 3
Patterns from real customer tickets: node-issue-catalog.md.
Files
- ATTRIBUTION.mdAdded by AutoGineer928 B
- LICENSELicence file added by AutoGineer9.9 KiB
- NOTICELicence file added by AutoGineer89 B
- SKILL.md20.4 KiB
- references/node-diagnostics-detail.md69.0 KiB
- references/node-issue-catalog.md5.6 KiB
- scripts/check-efa-sg.shScript13.2 KiB
- scripts/check-node-reachability.shScript17.0 KiB
- scripts/check-vpc-config.shScript20.5 KiB
- scripts/triage-cluster.shScript57.6 KiB
scripts/check-node-reachability.sh
#!/usr/bin/env bash
# check-node-reachability.sh
#
# Diagnose EFA reachability and inter-node communication health on a single
# HyperPod node. Run this on each node via the hyperpod-ssm skill.
#
# Usage (via ssm-exec.sh):
# ssm-exec.sh --target <TARGET> --upload scripts/check-node-reachability.sh /tmp/check-node-reachability.sh
# ssm-exec.sh --target <TARGET> 'bash /tmp/check-node-reachability.sh'
#
# Usage (direct on node):
# bash check-node-reachability.sh [--json] [--no-color]
#
# Exit codes:
# 0 — all critical checks passed
# 1 — one or more critical checks failed
set -euo pipefail
# Note: this script runs ON the node (via SSM), so aws CLI may not be present.
# Only python3 is checked here; other tools are checked individually per section.
JSON_MODE=false
USE_COLOR=true
usage() {
cat <<EOF
Usage: bash check-node-reachability.sh [--json] [--no-color]
Read-only on-node diagnostic for EFA reachability and inter-node communication
health. Must be executed on a HyperPod compute node (typically via the
hyperpod-ssm skill). Checks EFA interfaces, /dev/infiniband devices, GPU
count and Neuron device count against the expected counts for the node's
instance type.
Options:
--json Emit findings as JSON instead of human-readable output.
--no-color Disable ANSI colors.
-h, --help Show this message.
Exit codes:
0 All critical checks passed.
1 One or more critical checks failed.
EOF
}
while [[ $# -gt 0 ]]; do
case "$1" in
--json) JSON_MODE=true; shift ;;
--no-color) USE_COLOR=false; shift ;;
-h|--help) usage; exit 0 ;;
*) echo "Unknown argument: $1" >&2; usage >&2; exit 1 ;;
esac
done
# Colors — auto-disable when stdout isn't a TTY.
if ! [ -t 1 ] || [ "${TERM:-}" = "dumb" ]; then
USE_COLOR=false
fi
if "$USE_COLOR"; then
RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'
BOLD='\033[1m'; NC='\033[0m'
else
RED=''; GREEN=''; YELLOW=''; BOLD=''; NC=''
fi
HOSTNAME=$(hostname 2>/dev/null || echo "unknown")
TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
CRITICAL_FAILURES=0
declare -A RESULTS # associative array: check_name → pass|fail|warn|skip
pass() { RESULTS["$1"]="pass"; [[ "$JSON_MODE" == false ]] && echo -e " ${GREEN}[PASS]${NC} $1${2:+ — $2}"; }
fail() { RESULTS["$1"]="fail"; CRITICAL_FAILURES=$((CRITICAL_FAILURES+1)); \
[[ "$JSON_MODE" == false ]] && echo -e " ${RED}[FAIL]${NC} $1${2:+ — $2}"; }
warn() { RESULTS["$1"]="warn"; [[ "$JSON_MODE" == false ]] && echo -e " ${YELLOW}[WARN]${NC} $1${2:+ — $2}"; }
skip() { RESULTS["$1"]="skip"; [[ "$JSON_MODE" == false ]] && echo -e " [SKIP] $1${2:+ — $2}"; }
info() { [[ "$JSON_MODE" == false ]] && echo -e " $1"; }
if [[ "$JSON_MODE" == false ]]; then
echo ""
echo -e "${BOLD}=== HyperPod Node EFA Reachability Check ===${NC}"
echo -e "Host: ${BOLD}${HOSTNAME}${NC}"
echo -e "Timestamp: ${TIMESTAMP}"
echo ""
fi
if [[ "$JSON_MODE" == false ]]; then echo -e "${BOLD}--- EFA Kernel Module ---${NC}"; fi
EFA_MODULE=$(lsmod 2>/dev/null | grep -E '^efa\b' | awk '{print $1}' || true)
if [[ -n "$EFA_MODULE" ]]; then
EFA_MODULE_VER=$(modinfo efa 2>/dev/null | grep -E '^version:' | awk '{print $2}' || echo "unknown")
pass "efa_kernel_module" "loaded (version: ${EFA_MODULE_VER})"
else
# Read-only invariant: detect only, never `sudo modprobe efa` — loading kernel
# modules mutates node state, which the hyperpod-ssm skill's approval flow owns.
fail "efa_kernel_module" "not loaded — see references/node-diagnostics-detail.md § A (EFA / Security Group)"
fi
if [[ "$JSON_MODE" == false ]]; then echo ""; echo -e "${BOLD}--- EFA Devices ---${NC}"; fi
# shellcheck disable=SC2010 # /dev/ entries are kernel-named, safe to ls|grep
EFA_DEVICES=$(ls /dev/infiniband/ 2>/dev/null | grep -E 'rdma_cm|uverbs|efa' || true)
if [[ -n "$EFA_DEVICES" ]]; then
pass "efa_devices_present" "found in /dev/infiniband/: $(echo "$EFA_DEVICES" | tr '\n' ' ')"
else
fail "efa_devices_present" "/dev/infiniband/ is empty or missing — EFA hardware not detected"
fi
if [[ "$JSON_MODE" == false ]]; then echo ""; echo -e "${BOLD}--- libfabric EFA Provider ---${NC}"; fi
if command -v fi_info &>/dev/null; then
# If the previous section found no EFA hardware, fi_info failing is expected —
# don't emit [FAIL] on top of the hardware [FAIL], which would double-count and
# conflate "libfabric can't see EFA" with "node has no EFA at all".
if [[ -z "$EFA_DEVICES" ]]; then
skip "fi_info_efa_provider" "no EFA devices detected upstream — see efa_devices_present"
else
FI_EXIT=0
FI_OUTPUT=$(fi_info -p efa 2>&1) || FI_EXIT=$?
if echo "$FI_OUTPUT" | grep -q "provider: efa"; then
EFA_PROVIDER_COUNT=$(echo "$FI_OUTPUT" | { grep -c "provider: efa" 2>/dev/null; true; })
pass "fi_info_efa_provider" "EFA provider found (${EFA_PROVIDER_COUNT} endpoint(s))"
info "$(echo "$FI_OUTPUT" | grep -E 'provider:|fabric:|domain:|version:' | head -8 | sed 's/^/ /')"
else
fail "fi_info_efa_provider" "fi_info -p efa returned no EFA provider (exit code ${FI_EXIT}) — libfabric cannot enumerate EFA devices. See references/node-diagnostics-detail.md § A (EFA / Security Group)"
info "fi_info output: ${FI_OUTPUT:0:200}"
fi
fi
else
warn "fi_info_efa_provider" "fi_info not found — install libfabric to run this check (fi_info comes with EFA installer)"
fi
if [[ "$JSON_MODE" == false ]]; then echo ""; echo -e "${BOLD}--- EFA Network Interfaces ---${NC}"; fi
# EFA interfaces typically appear as eth0/ens* for primary + rdmaX or efa* for EFA devices
# EFA ifaces on p5/p5en use regular kernel names (ens*) — filter by driver via ethtool
# rather than by name pattern (the old 'rdma|efa' name grep misses ens* on p5).
EFA_IFACES=""
if command -v ethtool &>/dev/null; then
while IFS= read -r iface; do
[[ -z "$iface" ]] && continue
DRIVER=$(ethtool -i "$iface" 2>/dev/null | awk -F': ' '/^driver:/{print $2}')
if [[ "$DRIVER" == "efa" ]]; then
EFA_IFACES+="${iface}"$'\n'
fi
done < <(ip -o link show 2>/dev/null | awk -F': ' '{print $2}' | awk -F'@' '{print $1}' | grep -v '^lo$')
fi
# Fallback to name-based detection for older kernels / containers without ethtool
if [[ -z "$EFA_IFACES" ]]; then
EFA_IFACES=$(ip link show 2>/dev/null | grep -E 'rdma|efa' | awk -F': ' '{print $2}' | tr -d '@' || true)
fi
REGULAR_IFACES=$(ip link show 2>/dev/null | grep -E 'state UP' | awk -F': ' '{print $2}' | tr -d '@' || true)
if [[ -n "$EFA_IFACES" ]]; then
pass "efa_interfaces_up" "EFA interfaces found: $(echo "$EFA_IFACES" | tr '\n' ' ')"
while IFS= read -r iface; do
[[ -z "$iface" ]] && continue
IP=$(ip addr show "$iface" 2>/dev/null | grep 'inet ' | awk '{print $2}' || true)
if [[ -n "$IP" ]]; then
info " $iface → $IP"
else
warn "efa_interface_ip_${iface}" "interface $iface has no IP address — check DHCP/subnet config"
fi
done <<< "$EFA_IFACES"
else
info "No EFA interfaces detected (by driver or name)"
if [[ -n "$REGULAR_IFACES" ]]; then
skip "efa_interfaces_up" "no separate EFA interface — primary interfaces: $(echo "$REGULAR_IFACES" | tr '\n' ' ' | head -c 80)"
else
warn "efa_interfaces_up" "no UP network interfaces found"
fi
fi
if [[ "$JSON_MODE" == false ]]; then echo ""; echo -e "${BOLD}--- EFA Installation ---${NC}"; fi
EFA_VER_FILE="/opt/amazon/efa_installed_packages"
if [[ -f "$EFA_VER_FILE" ]]; then
# Format is "EFA installer version: 1.30.0" — grab only the version token.
EFA_VER=$(grep -iE '^EFA installer version' "$EFA_VER_FILE" 2>/dev/null \
| head -1 \
| grep -oE '[0-9]+\.[0-9]+(\.[0-9]+)?' \
| head -1 || echo "")
if [[ -z "$EFA_VER" ]]; then
warn "efa_installer_present" "EFA installer file present but version line not parsed"
else
pass "efa_installer_present" "EFA installer version: ${EFA_VER}"
fi
else
warn "efa_installer_present" "EFA installer marker not found at ${EFA_VER_FILE} — EFA may not be installed via standard method"
fi
if [[ "$JSON_MODE" == false ]]; then echo ""; echo -e "${BOLD}--- NCCL / OFI Configuration ---${NC}"; fi
NCCL_VARS=("FI_PROVIDER" "FI_EFA_USE_DEVICE_RDMA" "NCCL_SOCKET_IFNAME" "NCCL_ALGO" "LD_LIBRARY_PATH")
ANY_NCCL_SET=false
for var in "${NCCL_VARS[@]}"; do
val="${!var:-}"
if [[ -n "$val" ]]; then
info " ${var}=${val}"
ANY_NCCL_SET=true
fi
done
if "$ANY_NCCL_SET"; then
FI_PROVIDER_VAL="${FI_PROVIDER:-}"
if [[ -n "$FI_PROVIDER_VAL" && "$FI_PROVIDER_VAL" != "efa" ]]; then
warn "nccl_fi_provider" "FI_PROVIDER=${FI_PROVIDER_VAL} — for EFA workloads this should be 'efa'"
elif [[ "$FI_PROVIDER_VAL" == "efa" ]]; then
pass "nccl_fi_provider" "FI_PROVIDER=efa"
fi
else
skip "nccl_env_vars" "no NCCL/OFI env vars set in current shell — may be set in job launcher environment"
fi
if [[ "$JSON_MODE" == false ]]; then echo ""; echo -e "${BOLD}--- AWS OFI NCCL Plugin ---${NC}"; fi
OFI_LIB=$(find /opt/amazon/efa /opt/aws-ofi-nccl /usr/local/lib /usr/lib \
-name "libnccl-net.so*" -o -name "aws-ofi-nccl.so*" 2>/dev/null | head -1 || true)
if [[ -n "$OFI_LIB" ]]; then
pass "aws_ofi_nccl_plugin" "found: ${OFI_LIB}"
else
if [[ -f "$EFA_VER_FILE" ]] && grep -q "ofi\|OFI" "$EFA_VER_FILE" 2>/dev/null; then
pass "aws_ofi_nccl_plugin" "referenced in ${EFA_VER_FILE}"
else
warn "aws_ofi_nccl_plugin" "libnccl-net.so not found — required for EFA-accelerated NCCL (distributed training)"
fi
fi
if [[ "$JSON_MODE" == false ]]; then echo ""; echo -e "${BOLD}--- Instance Metadata Reachability ---${NC}"; fi
IMDS_TOKEN=$(curl -s -X PUT "http://169.254.169.254/latest/api/token" \
-H "X-aws-ec2-metadata-token-ttl-seconds: 60" --connect-timeout 3 -m 5 2>/dev/null || true)
if [[ -n "$IMDS_TOKEN" ]]; then
INSTANCE_TYPE=$(curl -s -H "X-aws-ec2-metadata-token: $IMDS_TOKEN" \
http://169.254.169.254/latest/meta-data/instance-type --connect-timeout 3 -m 5 2>/dev/null || echo "unknown")
LOCAL_IP=$(curl -s -H "X-aws-ec2-metadata-token: $IMDS_TOKEN" \
http://169.254.169.254/latest/meta-data/local-ipv4 --connect-timeout 3 -m 5 2>/dev/null || echo "unknown")
pass "imds_reachable" "instance-type=${INSTANCE_TYPE}, local-ipv4=${LOCAL_IP}"
# Static list of EFA-capable families; unknown types fall through to the
# EC2 API check. aws CLI may not be present on-node, so the static path
# covers the common case.
case "$INSTANCE_TYPE" in
p4de*|p4d*|p5en*|p5e*|p5*|p6*|trn1*|trn2*|inf2*|g5.48xlarge|g6e.48xlarge|g6.48xlarge|hpc6a*|hpc6id*|hpc7a*|hpc7g*|dl1*|dl2q*)
pass "efa_capable_instance" "${INSTANCE_TYPE} supports EFA" ;;
*)
if command -v aws &>/dev/null; then
EFA_CHECK=$(aws ec2 describe-instance-types \
--instance-types "${INSTANCE_TYPE}" \
--query 'InstanceTypes[0].NetworkInfo.EfaSupported' \
--output text 2>/dev/null || echo "unknown")
if [[ "$EFA_CHECK" == "True" ]]; then
pass "efa_capable_instance" "${INSTANCE_TYPE} supports EFA (verified via API)"
elif [[ "$EFA_CHECK" == "False" ]]; then
warn "efa_capable_instance" "${INSTANCE_TYPE} does NOT support EFA"
else
warn "efa_capable_instance" "${INSTANCE_TYPE} — could not verify EFA support"
fi
else
warn "efa_capable_instance" "${INSTANCE_TYPE} — not in known EFA list; verify with: aws ec2 describe-instance-types --instance-types ${INSTANCE_TYPE} --query 'InstanceTypes[0].NetworkInfo.EfaSupported'"
fi
;;
esac
# Multi-EFA validation — counts per EC2 instance-type documentation.
# NOTE: EFA counts vary between instance families (p5en has fewer than p5/p5e).
EXPECTED_EFA=0
case "$INSTANCE_TYPE" in
p5.48xlarge|p5e.48xlarge) EXPECTED_EFA=32 ;;
p5en.48xlarge) EXPECTED_EFA=16 ;;
p4d.24xlarge|p4de.24xlarge) EXPECTED_EFA=4 ;;
trn1.32xlarge) EXPECTED_EFA=8 ;;
trn2.48xlarge) EXPECTED_EFA=16 ;;
# p6 family and newer: don't hardcode counts; discover via ethtool to avoid false FAILs.
esac
if [[ "$EXPECTED_EFA" -gt 0 ]]; then
# Count actual EFA devices — avoid grep -c pattern that returns "0\n0" fallthrough.
ACTUAL_EFA=$(find /dev/infiniband -maxdepth 1 -name 'uverbs*' 2>/dev/null | wc -l)
[[ -z "$ACTUAL_EFA" ]] && ACTUAL_EFA=0
if [[ "$ACTUAL_EFA" -ge "$EXPECTED_EFA" ]]; then
pass "multi_efa_interfaces" "${ACTUAL_EFA}/${EXPECTED_EFA} EFA interfaces present for ${INSTANCE_TYPE}"
elif [[ "$ACTUAL_EFA" -gt 0 ]]; then
warn "multi_efa_interfaces" "only ${ACTUAL_EFA}/${EXPECTED_EFA} EFA interfaces — some may not be attached or driver issue"
else
fail "multi_efa_interfaces" "0/${EXPECTED_EFA} EFA interfaces on ${INSTANCE_TYPE} — EFA driver or attachment issue"
fi
fi
else
warn "imds_reachable" "IMDS not reachable. If running inside a container: check IMDSv2 HttpPutResponseHopLimit on the instance (default 1 is often too low for container networking — set to 2 or higher). Otherwise: verify the instance metadata service is enabled (HttpEndpoint != disabled) and that no local iptables / nftables rules block 169.254.169.254. Note: SGs do not filter link-local addresses."
fi
if [[ "$JSON_MODE" == false ]]; then echo ""; echo -e "${BOLD}--- Network Interface Statistics ---${NC}"; fi
if command -v ip &>/dev/null; then
IFACE_ERRORS=$(ip -s link show 2>/dev/null | awk '
BEGIN { rx_err=0; tx_err=0; iface="" }
/^[0-9]+:/ {
if (iface != "" && (rx_err > 0 || tx_err > 0))
print " " iface ": RX errors=" rx_err " TX errors=" tx_err
iface=$2; gsub(/:$/, "", iface)
rx_err=0; tx_err=0
}
/RX:/ { getline; rx_err=$3+0 }
/TX:/ { getline; tx_err=$3+0 }
END {
if (iface != "" && (rx_err > 0 || tx_err > 0))
print " " iface ": RX errors=" rx_err " TX errors=" tx_err
}
' || true)
if [[ -n "$IFACE_ERRORS" ]]; then
warn "network_interface_errors" "interfaces with errors detected:"
info "$IFACE_ERRORS"
else
pass "network_interface_errors" "no RX/TX errors on active interfaces"
fi
else
skip "network_interface_errors" "ip command not available"
fi
if [[ "$JSON_MODE" == false ]]; then echo ""; echo -e "${BOLD}--- Neuron Devices (Trainium/Inferentia) ---${NC}"; fi
if command -v neuron-ls &>/dev/null; then
NEURON_OUTPUT=$(neuron-ls 2>&1 || true)
NEURON_DEVICE_COUNT=$(echo "$NEURON_OUTPUT" | { grep -c "neuron_device" 2>/dev/null; true; })
if [[ "$NEURON_DEVICE_COUNT" -gt 0 ]]; then
pass "neuron_devices" "${NEURON_DEVICE_COUNT} Neuron device(s) detected"
info "$(echo "$NEURON_OUTPUT" | head -10 | sed 's/^/ /')"
else
NEURON_MOD=$(lsmod 2>/dev/null | grep -E '^neuron' || true)
if [[ -n "$NEURON_MOD" ]]; then
warn "neuron_devices" "Neuron driver loaded but neuron-ls shows 0 devices → references/node-diagnostics-detail.md § G.2 (Trainium/Inferentia)"
else
fail "neuron_devices" "Neuron driver not loaded → references/node-diagnostics-detail.md § G.2 (Trainium/Inferentia)"
fi
fi
elif ls /dev/neuron* &>/dev/null 2>&1; then
NEURON_DEV_COUNT=$(find /dev -maxdepth 1 -name 'neuron*' 2>/dev/null | wc -l)
NEURON_DEV_COUNT=${NEURON_DEV_COUNT:-0}
warn "neuron_devices" "${NEURON_DEV_COUNT} /dev/neuron* device(s) found but neuron-ls not installed → references/node-diagnostics-detail.md § G.2 (Trainium/Inferentia)"
else
skip "neuron_devices" "not a Trainium/Inferentia instance (no Neuron devices)"
fi
if [[ "$JSON_MODE" == false ]]; then
echo ""
echo -e "${BOLD}--- Summary ---${NC}"
TOTAL=${#RESULTS[@]}
PASSED=$(printf '%s\n' "${RESULTS[@]}" | { grep -c "^pass$" 2>/dev/null; true; })
WARNED=$(printf '%s\n' "${RESULTS[@]}" | { grep -c "^warn$" 2>/dev/null; true; })
FAILED=$(printf '%s\n' "${RESULTS[@]}" | { grep -c "^fail$" 2>/dev/null; true; })
SKIPPED=$(printf '%s\n' "${RESULTS[@]}" | { grep -c "^skip$" 2>/dev/null; true; })
echo -e " Host: ${HOSTNAME}"
echo -e " Checks: ${TOTAL} total | ${GREEN}${PASSED} passed${NC} | ${YELLOW}${WARNED} warnings${NC} | ${RED}${FAILED} failed${NC} | ${SKIPPED} skipped"
if [[ $CRITICAL_FAILURES -eq 0 ]]; then
echo -e "\n ${GREEN}${BOLD}Node EFA reachability checks PASSED.${NC}"
echo " If inter-node communication still fails, verify security group rules with check-efa-sg.sh"
echo " and compare EFA versions across nodes with the hyperpod-version-checker skill."
else
echo -e "\n ${RED}${BOLD}Node EFA reachability checks FAILED (${CRITICAL_FAILURES} critical issue(s)).${NC}"
echo " See [FAIL] items above. Each finding ends with a pointer of the form"
echo " '→ references/node-diagnostics-detail.md § <section>' — open that section"
echo " for root cause and remediation. Remediation lives in references, not in scripts."
fi
echo ""
else
CHECKS_JSON=""
for key in "${!RESULTS[@]}"; do
val="${RESULTS[$key]}"
CHECKS_JSON+="\"${key}\": \"${val}\","
done
CHECKS_JSON="${CHECKS_JSON%,}" # remove trailing comma
cat <<EOF
{
"hostname": "${HOSTNAME}",
"timestamp": "${TIMESTAMP}",
"critical_failures": ${CRITICAL_FAILURES},
"overall_pass": $([ $CRITICAL_FAILURES -eq 0 ] && echo true || echo false),
"checks": { ${CHECKS_JSON} }
}
EOF
fi
exit "$([[ $CRITICAL_FAILURES -eq 0 ]] && echo 0 || echo 1)"
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs a command-line tool, Needs Python, Needs Node.js
Security
What our scanner noticed· Low risk
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- AWS Labs
- Publisher
- AWS Labs (Official)
- Source
- awslabs/agent-plugins · plugins/sagemaker-ai/skills/hyperpod-node-debugger · commit fbefb37
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- NOTICE (added by AutoGineer from NOTICE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by AWS Labs.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download hyperpod-node-debugger.zip