cuda

Diagnose CUDA kernel bugs and bottlenecks with Nsight profiling and binary inspection.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/dotruru/claudemd --skill cuda-dotruru
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cuda
Source: https://github.com/dotruru/claudemd/tree/main/skills/ptx-isa
Command: npx skills add https://github.com/dotruru/claudemd --skill cuda-dotruru

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

CUDA developers often struggle to systematically develop, debug, profile, and optimize GPU kernels; this Skill provides a structured guide with workflows and practical guidance to streamline those tasks.

Core Features & Use Cases

  • Debugging workflow: leverage printf in device code, compute-sanitizer (memcheck, racecheck, initcheck, synccheck), and cuda-gdb batch usage to identify and reproduce issues.
  • Profiling & optimization: perform non-interactive profiling with Nsight Systems (nsys) and Nsight Compute (ncu) to locate hotspots and bottlenecks, then validate improvements with profiling results.
  • Binary inspection: use cuobjdump to inspect PTX/SASS and verify kernel composition and resources.
  • Contextual reference materials: consult debugging-tools, nsys-guide, ncu-guide, nvtx patterns, and related references to inform workflows.

Quick Start

Start with a minimal CUDA kernel, run compute-sanitizer to surface a bug, profile with nsys/ncu to identify hotspots, and iteratively apply printf-based traces to confirm fixes.

Frequently Asked Questions about cuda

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

FAQPage Schema
How do I debug a CUDA kernel to find memory leaks and race conditions?

Profile CUDA kernel performance with Nsight Systems (nsys) for non-interactive profiling to locate hotspots, then use Nsight Compute (ncu) to identify specific bottlenecks. Validate optimization improvements by comparing profiling results before and after code changes.

Can I inspect PTX and SASS code for a compiled CUDA kernel?

Yes, you can inspect PTX and SASS code using cuobjdump. This binary inspection tool verifies kernel composition and resource usage, allowing you to analyze the compiled assembly and understand how your CUDA kernel maps to the GPU hardware.

What is the best workflow for developing and optimizing CUDA kernels?

The best workflow starts with a minimal CUDA kernel, runs compute-sanitizer to surface bugs, profiles with nsys and ncu to identify hotspots, and iteratively applies traces to confirm fixes. This structured approach streamlines debugging and performance optimization across real-world workloads.

Why does my CUDA kernel crash and how can I reproduce the issue?

CUDA kernel crashes often stem from memory errors or thread synchronization issues. Reproduce the issue by running compute-sanitizer to surface bugs, using cuda-gdb batch execution to isolate the fault, and applying printf-based device code traces to confirm the exact failure point.

Do I need Nsight profiling tools to optimize GPU kernels?

Yes, Nsight profiling tools like nsys and ncu are essential for locating hotspots and bottlenecks in GPU kernels. They provide non-interactive profiling capabilities that validate optimization improvements by quantifying performance changes across real-world CUDA workloads.