debug-cuda-crash

Diagnose CUDA crashes in SGLang by capturing kernel API call context and tensor metadata.

9|Updated Feb 21, 2026
One-click install
npx skills add https://github.com/Fridge003/sglang-dev-tools --skill debug-cuda-crash-fridge003
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: debug-cuda-crash
Source: https://github.com/Fridge003/sglang-dev-tools/tree/main/ai-wheels/.claude/skills/debug-cuda-crash
Command: npx skills add https://github.com/Fridge003/sglang-dev-tools --skill debug-cuda-crash-fridge003

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers identify and diagnose CUDA crashes in SGLang by capturing kernel API call context and tensor metadata around failure points, enabling post-mortem analysis without relying on volatile console output.

Core Features & Use Cases

  • Kernel API logging at multiple levels to capture function names, inputs, and outputs around crashes.
  • Reproduction guidance for device-side errors (illegal memory access, asserts, NaN/Inf) across LLM and diffusion workloads, with level-structured dumps and optional per-run dump directories.
  • Guidance for using CUDA graph capture, compute-sanitizer, and multi-process scenarios to isolate root causes and validate fixes.

Quick Start

Set SGLANG_KERNEL_API_LOGLEVEL to 3 and run your script to start capturing kernel API calls around the failing CUDA operation.

Frequently Asked Questions about debug-cuda-crash

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug CUDA crashes in SGLang without losing console output?

Capture kernel API call context and tensor metadata around failure points to debug CUDA crashes in SGLang, enabling post-mortem analysis through level-structured dumps rather than relying on volatile console output.

What environment variables do I need to set to capture CUDA kernel API logs?

To capture kernel API logs, set SGLANG_KERNEL_API_LOGLEVEL to 3 and configure SGLANG_KERNEL_API_LOGDEST. Optionally set SGLANG_KERNEL_API_DUMP_DIR to enable detailed contextual capture and reproducible crash analysis.

Can I diagnose illegal memory access and NaN errors in LLM and diffusion workloads?

Diagnose device-side errors like illegal memory access, asserts, and NaN/Inf across LLM and diffusion workloads using level-structured dumps and optional per-run dump directories to isolate root causes and validate fixes.

Does this approach work with CUDA graph capture and multi-process scenarios?

It provides guidance for using CUDA graph capture, compute-sanitizer, and multi-process scenarios to isolate root causes and validate fixes for device-side errors occurring during SGLang execution.

What is the best way to isolate root causes of device-side errors in SGLang?

Isolate root causes of device-side errors by capturing kernel API call context and tensor metadata during execution, combined with using CUDA graph capture, compute-sanitizer, and multi-process scenario validation.