debug-cuda-crash

Enable CUDA kernel API logging to capture crash boundaries in SGLang.

4|2|Updated Feb 19, 2026
One-click install
npx skills add https://github.com/drunkcoding/AgentSkillsArxiv --skill debug-cuda-crash-drunkcoding
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: debug-cuda-crash
Source: https://github.com/drunkcoding/AgentSkillsArxiv/tree/main/skills/sglang/debug-cuda-crash
Command: npx skills add https://github.com/drunkcoding/AgentSkillsArxiv --skill debug-cuda-crash-drunkcoding

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Debugging CUDA crashes in SGLang can be non-trivial due to asynchronous GPU execution and limited visibility into kernel boundaries. This skill enables Kernel API logging to capture the last successful API boundary and its inputs, providing actionable context for root cause analysis.

Core Features & Use Cases

  • Capture inputs and tensor metadata at the crash boundary to identify shape/dtype mismatches and memory issues.
  • Observe Level-based logging progression (1,3,5,10) to balance detail and performance across LLM and diffusion workloads.
  • Reproduce and diagnose crashes with crash-safe dumps and reproducible repro scripts.

Quick Start

Enable Level 3 logging and run a crash repro script to observe inputs and logs before the crash.

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 a CUDA crash in SGLang?

To debug a CUDA crash in SGLang, enable Kernel API logging to capture the last successful API boundary and its tensor inputs. This workflow isolates illegal memory accesses and NaN/Inf issues by providing actionable context for root cause analysis.

Why does my CUDA kernel crash with an illegal memory access?

Illegal memory accesses during CUDA kernel execution often stem from shape or dtype mismatches. Enabling Kernel API logging captures tensor metadata at the crash boundary, revealing the exact inputs that triggered the memory failure.

How do I capture tensor inputs before a CUDA crash?

You can capture tensor inputs before a CUDA crash by enabling Kernel API logging in your environment. This records the tensor metadata of the last successful API boundary, allowing you to observe the exact inputs that led to the failure.

What logging level should I use to diagnose CUDA device-side asserts?

To diagnose CUDA device-side asserts, use level-based logging progression such as Level 3 to balance detail and performance. You can adjust levels up or down to capture the necessary API boundaries without overwhelming the system.

Does this CUDA crash debugging workflow apply to diffusion workloads?

Yes, this CUDA crash debugging workflow applies to diffusion workloads. The Kernel API logging mechanism captures tensor metadata and crash boundaries across all CUDA-enabled components, including both LLM and diffusion executions.

What is the best way to reproduce a CUDA crash for root cause analysis?

The best way to reproduce a CUDA crash for root cause analysis is to run a crash repro script with Kernel API logging enabled. This captures the last successful boundary and generates crash-safe dumps to guide your diagnosis.