Gke ai troubleshooting tpu vbar oom

From google/skills · View interactive version

Gke ai troubleshooting tpu vbar oom is an AI agent skill from the GitHub repository google/skills. Diagnoses and prevents vbar_control_agent segfaults, out-of-memory (OOM) errors, and TPU device initialization failures on TPU v6e nodes in GKE caused by race conditions during TPU device resets or high-frequency metrics polling. Use when troubleshooting vbar_control_agent crashes, memory cgroup OOM

How to use this skill

Skill file

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.

Attribution

MUST READ: Before executing any gcloud, REST API, or MCP command, you

MUST read Usage Attribution. For commands executed

directly in the terminal (never in generated scripts, Terraform, or user code),

prefix gcloud with

CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:gke-ai-troubleshooting-tpu-vbar-oom)"

and append agent-skills/1.0 (skill:gke-ai-troubleshooting-tpu-vbar-oom) to User-Agent headers.

⚠️ Prerequisites

🔍 Diagnostic Workflow

Step 0: Context Acquisition & Time Window Definition

Independently gather required context using available GCP/GKE tools or use the

provided {variable} placeholders:

my-training-job-456).

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].

  1. 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).

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}"

vbar_control_agent. Stack traces pointing to

libtpu::tpunetd::VBARControlHelper::MetricsReadFromVBAR are a strong

indicator.

patterns.

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

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

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}"

match" suggest vBAR memory corruption.

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.

libtpu.sdk.tpumonitoring) are deployed that frequently query

GetHostMetrics from vBAR Control Agent.

```bash

kubectl get pods -A -o jsonpath='{range .items[]}{.metadata.namespace}{"/"}{.metadata.name}{"\t"}{.spec.containers[].image}{"\n"}{end}'

```

```sql

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}"

```

condition hypothesis.

🛠️ Resolution Workflow

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

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

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.

and gracefully handle reads from unbound vBARs.

📋 copypaste checklist

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.