debug-cuda-crash

Capture CUDA API call traces and inputs to debug crashes.

Updated Feb 10, 2026
One-click install
npx skills add https://github.com/jwu1980-test/flashinfer --skill debug-cuda-crash-jwu1980-test
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: debug-cuda-crash
Source: https://github.com/jwu1980-test/flashinfer/tree/main/.claude/skills/debug-cuda-crash
Command: npx skills add https://github.com/jwu1980-test/flashinfer --skill debug-cuda-crash-jwu1980-test

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This tutorial explains how to diagnose CUDA crashes and errors by leveraging API logging to capture inputs and trace API calls, enabling post-mortem analysis and faster fixes.

Core Features & Use Cases

  • API logging: log function calls, tensors, and metadata before crashes to identify root causes.
  • Environment visibility: records system information (GPU, CUDA, PyTorch versions) to reproduce issues.
  • Guided debugging workflow: step-by-step instructions to reproduce, collect logs, and locate faulty inputs.

Quick Start

Enable API logging, run your script, and review the generated logs to identify faulty inputs and steps leading to 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 from an illegal memory access in my Python workflow?

To debug a CUDA crash like an illegal memory access, you can use API logging to capture tensors and trace function calls before the failure. This enables post-mortem analysis of faulty inputs to identify the root cause.

What causes NaN or Inf values during CUDA execution and how can API logging help?

NaN or Inf values during CUDA execution often stem from invalid input tensors or mathematical operations. API logging helps by recording these tensors and metadata before the crash, allowing you to isolate the specific inputs that triggered the error.

How do I trace CUDA API calls to find out-of-bounds errors in GPU-accelerated Python?

You can trace CUDA API calls to find out-of-bounds errors by enabling API logging in your Python scripts. This records the sequence of function calls and system information, providing a guided workflow to locate faulty inputs.

Do I need specific environment variables to capture API logs for CUDA crash analysis?

Yes, capturing API logs for CUDA crash analysis requires setting FLASHINFER_LOGLEVEL and FLASHINFER_LOGDEST environment variables. You must also use the @flashinfer_api decorator to log inputs, metadata, and system information during execution.

Can I reproduce CUDA crashes using logged system information and metadata?

Yes, you can reproduce CUDA crashes using logged system information. The API logging feature records GPU, CUDA, and PyTorch versions alongside execution metadata, which provides the environment visibility needed to replicate issues.