Kernel-Metriken in Nsight Compute
Durchsatz, Wartezeiten und Roofline-Daten.
Kernel-Metriken in Nsight Compute ist eine kostenlose CUDA Academy-Lektion auf CoddyKit. Dies ist Lektion 2 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des CUDA Academy-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der CUDA Academy-Kurs umfasst insgesamt 4 Lektionen.
Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.
Zoom Into One Kernel
Nsight Compute is the microscope for a single kernel. It collects deep hardware metrics so you can see exactly why it runs slow. 🔬
How to Launch It
You profile a kernel with ncu from the command line. It replays the kernel many times to gather detailed counters.
ncu -o report ./my_cuda_appThroughput Metrics
The first thing to read is throughput: how busy the compute units and memory pipes are, shown as a percent of their peak.
Reading Warp Stalls
A stall is a warp that cannot make progress this cycle. Nsight Compute groups stalls by reason so you know what to fix.
Memory Stalls
If most stalls say memory, your kernel waits on data. The cure is better access patterns or reuse, not more math.
Achieved Occupancy
Achieved occupancy shows how many warps were actually active versus the maximum. Low values often mean too few warps to hide latency.
The Roofline Chart
The roofline plots your kernel against hardware limits. Where the dot lands tells you if compute or memory is the wall.
Guided Analysis
Nsight Compute writes plain-language recommendations. It points at the biggest bottleneck so you do not have to guess first.
Cache Hit Rates
Counters for the L1 and L2 caches show how often reads hit cache. Higher hit rates mean fewer trips to slow global memory.
Comparing Two Versions
You can diff two reports side by side. That makes it obvious whether your latest change truly helped the metrics.
It Replays, So It Is Slow
Because it replays kernels, profiling overhead is high. Use it on one kernel at a time, not as a normal run.
Quick Check
Your kernel report shows mostly memory-related warp stalls.
Recap
Nsight Compute reveals one kernel's metrics: throughput, stalls, occupancy, and roofline. Use it to confirm exactly what to optimize. 👏
Häufig gestellte Fragen
Ist die Lektion „Kernel-Metriken in Nsight Compute“ kostenlos?
Ja — der vollständige Text von „Kernel-Metriken in Nsight Compute“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des CUDA Academy-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der CUDA Academy-Kurs umfasst insgesamt 4 Lektionen.
Was lerne ich in „Kernel-Metriken in Nsight Compute“?
Durchsatz, Wartezeiten und Roofline-Daten. Du übst CUDA Academy mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.
Brauche ich Erfahrung, um CUDA Academy zu starten?
Keine Vorkenntnisse erforderlich. CUDA Academy auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 2 von 4.
Wie lange dauert die Lektion „Kernel-Metriken in Nsight Compute“?
Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.
Kann ich in dieser CUDA Academy-Lektion Code schreiben und ausführen?
Ja. Jede CUDA Academy-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.
Alle Lektionen in diesem Kurs
- Timeline-Ansicht in Nsight Systems
- Kernel-Metriken in Nsight Compute
- Compute-bound vs. Memory-bound
- Code mit NVTX annotieren