debug-cuda-crash

Diagnose CUDA crashes in SGLang with kernel API logging.

Updated Apr 7, 2026
One-click install
npx skills add https://github.com/Nabilhassan12345/voice-ai-workspace --skill debug-cuda-crash-nabilhassan12345
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: debug-cuda-crash
Source: https://github.com/Nabilhassan12345/voice-ai-workspace/tree/main/sglang/.claude/skills/debug-cuda-crash
Command: npx skills add https://github.com/Nabilhassan12345/voice-ai-workspace --skill debug-cuda-crash-nabilhassan12345

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This tutorial helps developers diagnose CUDA crashes in SGLang by leveraging the kernel API logging decorator to capture inputs at the boundary before failures.

Core Features & Use Cases

  • Enable level-based kernel API logging to capture function boundaries, inputs, and outputs around failures.
  • Reproduce and diagnose device-side errors (illegal memory accesses, asserts) with verbose tensor metadata and dumps.
  • Use practical steps to configure log destinations, filter APIs, and reproduce crashes across single or multi-GPU setups.

Quick Start

Enable kernel API logging by setting SGLANG_KERNEL_API_LOGLEVEL and SGLANG_KERNEL_API_LOGDEST, then run your CUDA code path to reproduce the crash and inspect the logged inputs.

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 using kernel API logs?

Debug a CUDA crash in SGLang by enabling kernel API logging to capture function boundaries, inputs, and outputs. Set SGLANG_KERNEL_API_LOGLEVEL and SGLANG_KERNEL_API_LOGDEST, run your code path to reproduce the crash, and inspect the logged tensor metadata.

Why does my CUDA kernel execution fail with an illegal memory access in SGLang?

An illegal memory access during CUDA kernel execution in SGLang can be diagnosed by configuring kernel API logging. This captures verbose tensor metadata and dumps at the function boundary before the device-side failure occurs.

Can I configure log levels to capture specific tensor inputs during a CUDA crash?

Yes, you can configure level-based kernel API logging to capture specific tensor inputs and outputs. By adjusting the log level, you filter APIs and control the verbosity of tensor metadata dumps recorded around the failure.

What is the best way to reproduce device-side asserts across multi-GPU setups?

The best way to reproduce device-side asserts across multi-GPU setups is to use kernel boundary tracing. Configure log destinations and apply selective logging to generate reproducible crash repros with detailed tensor metadata.

Does enabling kernel API logging slow down my SGLang inference?

Enabling kernel API logging in SGLang captures inputs and outputs at function boundaries, which introduces overhead. Use level-based logging and API filtering to selectively control dumps and minimize performance impact during crash reproduction.

When do I need to use kernel API logging for crash dumps?

You need kernel API logging for crash dumps when encountering device-side asserts or illegal memory accesses during CUDA kernel execution. It provides actionable tensor input and output logging to trace failures at the kernel boundary.