New to Claude Skills? Learn how to install them โ†’

google on GitHub

TPU OOM Troubleshooting

Free

Diagnose and prevent TPU vbar_control_agent errors.

by google17.6k stars on google/skills
1 views
Updated Aug 10, 2026
Get this skill

Free ยท Opens the source repo

What TPU OOM Troubleshooting does

The TPU OOM Troubleshooting skill is designed for developers and engineers working with Google Kubernetes Engine (GKE) and Tensor Processing Units (TPUs). It specifically targets issues related to the vbar_control_agent, including segmentation faults and out-of-memory (OOM) errors that can occur on TPU v6e nodes. By following a systematic diagnostic workflow, users can identify the root causes of these issues, which are often linked to race conditions during TPU device resets or high-frequency metrics polling. This skill is particularly useful in environments where TPU resources are critical for performance and reliability.

The skill requires certain prerequisites, such as enabling Cloud Logging for the project and having access to the GKE cluster via gcloud or similar tools. Users will begin by gathering context about their GCP project, cluster, and node, allowing for a focused investigation into the problem. The diagnostic process involves checking for specific OOM messages in serial console logs, investigating tpu-device-plugin metrics fetch failures, and inspecting for any custom metrics collection mechanisms that may be contributing to the issue.

Once the diagnostic steps are completed, the skill provides actionable resolutions. Users can temporarily disable custom metrics collection to prevent further crashes and OOM errors while awaiting a future GKE update that promises improved resiliency of the vbar_control_agent. This proactive approach not only helps in troubleshooting current issues but also aids in preventing future occurrences, making it an essential tool for anyone managing TPU workloads in GKE.

When to use it

Use this skill when troubleshooting specific errors on TPU v6e nodes, particularly related to `vbar_control_agent` segfaults or OOM errors.

When not to use it

This skill is not suitable for general OOM troubleshooting outside of TPU environments or for standard GKE node lifecycle operations.

What you can build with it

Diagnosing TPU Crashes

Use this skill to identify the cause of `vbar_control_agent` crashes during TPU device resets.

Preventing Memory Issues

Implement the skill's recommendations to prevent future OOM errors on TPU v6e nodes.

Investigating Metrics Fetch Failures

Utilize the diagnostic steps to investigate and resolve `tpu-device-plugin` metrics fetch failures.

How to install TPU OOM Troubleshooting

View source

1. Install with the skills CLI

npx skills add google/skills/gke-ai-troubleshooting-tpu-vbar-oom --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by google

TPU Connection Failure and VBAR OOM Troubleshooting

Use this skill to systematically diagnose and prevent vbar_control_agent segfaults and Out-Of-Memory (OOM) errors on TPU v6e nodes.

โš ๏ธ Prerequisites

  • Cloud Logging must be enabled for the project.
  • Access to the project and cluster via gcloud or equivalent tool.

๐Ÿ” Diagnostic Workflow

Step 0: Context Acquisition & Time Window Definition

Independently gather required context using available GCP/GKE tools or use the provided {variable} placeholders:

  • {project_id}: The GCP Project ID (e.g., customer-ai-project-123).
  • {cluster_name}: The GKE Cluster Name (e.g., tpu-cluster-prod).
  • {node_name}: The Node Name or Instance ID (e.g., tpu-node-1).
  • {workload_name}: The Workload Name / JobSet Name (e.g., my-training-job-456).
  • {namespace}: The Workload Namespace.
  • {issue_time}: The timestamp of the issue (e.g., 2026-04-14T20:00:00Z).

Time Handling & Execution Rules

  1. Window Calculation: If an issue timestamp {issue_time} is provided, calculate the query time window as [{issue_time} - 30m] to [{issue_time} + 30m].
    • Let {start_time} = {issue_time} - 30m
    • Let {end_time} = {issue_time} + 30m
  2. Informational vs. Live Execution: If the user request is informational or query-formulation (e.g. "How can I check...", "How do I determine..."), or if live GCP project resources are not actively targetable, directly output the calculated time window, log names, and Cloud Logging filter templates without attempting live log execution commands.

Step 1: Check for vbar_control_agent OOMs

Look for specific out of memory messages from vbar_control_agent in serial console logs (serialconsole.googleapis.com%2fserial_port_1_output).

  • Tool to use: query_logs (for live diagnostics)
  • Filter Templates:

Serial Console Logs (OOMs):

logName="projects/{project_id}/logs/serialconsole.googleapis.com%2fserial_port_1_output"
AND labels."compute.googleapis.com/resource_name"="{node_name}"
AND SEARCH(text_payload, "Memory cgroup out of memory: Killed process .* (vbar_control_ag)")
AND timestamp >= "{start_time}"
AND timestamp <= "{end_time}"
  • Logic: Presence of Memory cgroup out of memory messages related to vbar_control_agent. Stack traces pointing to libtpu::tpunetd::VBARControlHelper::MetricsReadFromVBAR are a strong indicator.
  • Automation: Proceed to next step automatically after reporting findings.
  • Reference: See references/failure_signatures.md for example log patterns.

Step 2: Investigate tpu-device-plugin Metrics Fetch Failures [Low Risk]

Check if tpu-device-plugin is reporting metric fetch failures.

  • Tool to use: query_logs
  • Filter Template:
resource.type="k8s_container"
AND resource.labels.project_id="{project_id}"
AND resource.labels.cluster_name="{cluster_name}"
AND resource.labels.container_name="tpu-device-plugin"
AND severity=ERROR
AND textPayload:"metrics fetch failed for .* deviceID and .* device path with error: checksum didn't match with the metrics data. Corrupt data found"
AND timestamp >= "{start_time}"
AND timestamp <= "{end_time}"
  • Logic: Errors indicating "metrics fetch failed" with "checksum didn't match" suggest vBAR memory corruption.
  • Automation: Proceed to next step automatically after reporting findings.

Step 3: Check for Custom Metrics Collection Usage [Low Risk]

Inspect cluster configurations, workloads, or container specs to determine if custom TPU metrics collection mechanisms are deployed.

  • Action: Check if custom scripts or agents (e.g., using libtpu.sdk.tpumonitoring) are deployed that frequently query GetHostMetrics from vBAR Control Agent.

  • Verification Commands:

    • Kubectl Search (Inspect workload env/specs):
    kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}{"/"}{.metadata.name}{"\t"}{.spec.containers[*].image}{"\n"}{end}'
    
    • Log Search Filter (query_logs):
    resource.type="k8s_container"
    AND resource.labels.project_id="{project_id}"
    AND resource.labels.cluster_name="{cluster_name}"
    AND textPayload:"libtpu.sdk.tpumonitoring"
    AND timestamp >= "{start_time}"
    AND timestamp <= "{end_time}"
    
  • Logic: Confirmation of custom metrics collection helps confirm the race condition hypothesis.

๐Ÿ› ๏ธ Resolution Workflow

Resolution 1: Temporarily Disable Custom Metrics Collection [High Risk]

If a custom metrics collection agent is identified, recommend disabling it.

  • Action: Recommend disabling the custom metrics collector.
  • Justification: Prevents reads from vBAR during device resets, stopping crashes and OOMs.

Resolution 2: Await vbar_control_agent Resiliency Update [Low Risk]

Advise that a permanent fix will be available in a future GKE version.

  • Action: Recommend upgrading GKE when the fix is available.
  • Justification: The updated agent will be resilient to memory corruption and gracefully handle reads from unbound vBARs.

๐Ÿ“‹ copypaste checklist

  • Acquire context and compute [{start_time}, {end_time}] window.
  • Check for vbar_control_agent segfaults and OOMs using query_logs.
  • Investigate tpu-device-plugin failures using query_logs.
  • Inspect for custom metrics collection usage.
  • Advise disabling custom metrics collection if applicable.
  • Advise awaiting resiliency update.

Frequently asked questions about TPU OOM Troubleshooting

Similar skills