debug-cuda-crash

Diagnose CUDA crashes in SGLang by exposing kernel API call traces and tensor metadata.

Updated May 30, 2026
One-click install
npx skills add https://github.com/QingHuan-6/SglangGen --skill debug-cuda-crash-qinghuan-6
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: debug-cuda-crash
Source: https://github.com/QingHuan-6/SglangGen/tree/main/.claude/skills/debug-cuda-crash
Command: npx skills add https://github.com/QingHuan-6/SglangGen --skill debug-cuda-crash-qinghuan-6

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps developers diagnose CUDA crashes in SGLang by exposing kernel boundary calls and tensor metadata through a configurable logging system, enabling quick root-cause analysis without invasive instrumentation.

Core Features & Use Cases

  • Enable kernel API logging at multiple levels to capture function names, input tensors, and outputs around the crash.
  • Support level-based detail: level 1 for function names, level 3 for inputs/outputs, level 5 for statistics, level 10 for crash-safe dumps.
  • Provide guidance for reproducing CUDA crashes in both single and multi-GPU setups, including per-process log destinations and dump filtering.
  • Use-case: debugging illegal memory access, device-side asserts, and NaN/Inf issues by inspecting boundary tensors.

Quick Start

Enable kernel API logging at level 3 and run your CUDA script to reproduce the crash, then inspect the log for tensor inputs and the failing boundary.

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 function boundary calls and tensor metadata. This exposes inputs, outputs, and crash dumps for quick root-cause analysis without requiring invasive instrumentation.

What is the best way to diagnose illegal memory access in CUDA kernels?

Diagnosing illegal memory access involves inspecting boundary tensors using kernel API logging at level 3. This captures input and output tensors around the crash, allowing you to identify the failing boundary and the cause of the device-side assert.

Can I trace CUDA kernel API calls for multi-GPU SGLang runs?

Yes, you can trace CUDA kernel API calls in multi-GPU SGLang setups by configuring per-process log destinations. Use environment controls like SGLANG_KERNEL_API_LOGDEST to separate logs and filter crash dumps for each process.

What log level should I use to capture tensor inputs and outputs during a CUDA crash?

Use kernel API logging level 3 to capture tensor inputs and outputs during a CUDA crash. Level 1 captures function names, level 5 provides statistics, and level 10 generates crash-safe dumps for deeper analysis.

What environment variables are needed to enable kernel API logging for SGLang CUDA debugging?

You need to set SGLANG_KERNEL_API_LOGLEVEL and SGLANG_KERNEL_API_LOGDEST to enable kernel API logging for CUDA debugging in SGLang. Optionally, use SGLANG_KERNEL_API_DUMP_DIR to specify a directory for crash dumps.