Skip to main content

Terminal UI for NVIDIA Nsight Systems profiles โ€” timeline viewer, kernel navigator, NVTX hierarchy

Project description

๐Ÿ”ฌ nsys-tui

Terminal UI for NVIDIA Nsight Systems profiles

Navigate GPU kernel timelines, explore NVTX hierarchies, and analyze performance โ€” all from your terminal.

CI PyPI Python 3.10+ License: MIT


โšก Install

pip install nsys-tui

That's it. No system dependencies, no CUDA required. Just Python 3.10+.


๐ŸŽฏ What It Does

nsys-tui reads .sqlite profile exports from NVIDIA Nsight Systems and gives you three ways to explore them:

๐Ÿ–ฅ๏ธ Timeline TUI

Perfetto-style horizontal timeline in your terminal

๐ŸŒฒ Tree TUI

Interactive NVTX hierarchy browser with kernel details

๐ŸŒ HTML Viewer

Exportable interactive visualizations for sharing

S21 โ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–ˆโ–ˆโ–ˆ
S56 โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
S60 โ–‘โ–‘โ–‘โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–ˆโ–ˆ
    |         โ”‚
    39.1s   39.5s
โ–ผ Iteration (324ms)
  โ–ผ forward (180ms)
    โ–ผ Attention (89ms)
      โ–  flash_fwd  26ms
      โ–  flash_bwd  63ms

Interactive HTML exports:
โ€ข NVTX stack viewer
โ€ข SQLite schema explorer
โ€ข Perfetto JSON traces


๐Ÿš€ Quick Start

1. Get a profile

# Profile your PyTorch training
nsys profile -o my_training python train.py
# โ†’ produces my_training.sqlite

2. Explore it

# Quick overview
nsys-tui info my_training.sqlite

# Interactive timeline (the main attraction)
nsys-tui timeline my_training.sqlite --gpu 0 --trim 39 42

# Interactive tree browser
nsys-tui tui my_training.sqlite --gpu 0 --trim 39 42

# GPU kernel summary
nsys-tui summary my_training.sqlite --gpu 0

3. Export & share

# Perfetto JSON (open in ui.perfetto.dev)
nsys-tui export my_training.sqlite -o traces/

# Interactive HTML viewer
nsys-tui viewer my_training.sqlite --gpu 0 --trim 39 42 -o report.html

# Flat CSV/JSON for scripting
nsys-tui export-csv my_training.sqlite --gpu 0 --trim 39 42 -o kernels.csv

โŒจ๏ธ Timeline TUI

The timeline is a Perfetto-style horizontal viewer with per-stream kernel visualization, NVTX hierarchy bars, and a time-cursor navigation model.

Navigation

Key Action
โ† โ†’ Pan through time
Shift+โ†/โ†’ Page pan (1/4 viewport)
โ†‘ โ†“ Select stream
Tab Snap to next kernel
+ - Zoom in / out
a Toggle absolute โ†” relative time

Analysis

Key Action
/ Filter kernels by name
m Set minimum duration threshold
d Toggle demangled kernel names
C Open config panel
h Full help overlay

Bookmarks

Key Action
B Save bookmark (with kernel + NVTX context)
' Bookmark list โ€” press 1-9 to jump
, . Cycle through bookmarks
` Jump back to previous position
[ ] Set range start / end

Config Panel (C)

Tweak settings live with โ†‘/โ†“ to select and โ†/โ†’ to adjust:

  • Selected stream rows (1-6)
  • Other stream rows (1-4)
  • Time tick density (2-20)
  • NVTX depth levels (0-8)
  • Min kernel duration filter

๐Ÿ“š Documentation

The docs/ directory includes comprehensive guides for Nsight Systems profiling:

Guide Topic
CLI Reference Full nsys command reference
SQLite Schema Database tables & relationships
NVTX Annotations Adding markers to your code
CUDA Trace GPU kernel tracing
NCCL Tracing Multi-GPU collective analysis
Python/PyTorch Profiling PyTorch workloads
Containers Profiling inside Docker/Slurm
Focused Profiling Targeted profiling strategies

๐Ÿ” Interactive SQLite Schema Explorer

The docs/sqlite-explorer/ contains an interactive HTML tool for exploring the Nsight SQLite schema โ€” tables, foreign keys, example queries, and key concepts. Open docs/sqlite-explorer/index.html in a browser:

  • Browse all Nsight SQLite tables with column types
  • See foreign key relationships visualized
  • Copy-paste ready SQL query examples
  • Cross-highlighted concept explanations

๐Ÿ› ๏ธ All Commands

Command Description
info Profile metadata & GPU hardware
summary Top kernels, stream breakdown, auto-commentary
overlap Compute / NCCL overlap analysis
nccl NCCL collective breakdown by type
iters Auto-detect training iterations
tree NVTX hierarchy as text
tui Interactive tree TUI
timeline Interactive timeline TUI
search Search kernels / NVTX by name
export Perfetto JSON traces
export-csv Flat CSV for spreadsheets
export-json Flat JSON for scripting
viewer Interactive HTML report
markdown NVTX hierarchy as markdown

๐Ÿค– AI Analysis (Optional)

nsys-tui includes an optional AI module that can analyze your profiles:

pip install nsys-tui[ai]
  • Auto-commentary on kernel distributions and performance patterns
  • NVTX annotation suggestions for un-annotated code regions
  • Performance bottleneck detection with actionable recommendations

๐Ÿง‘โ€๐Ÿ’ป Development

git clone https://github.com/GindaChen/nsys-tui.git
cd nsys-tui
pip install -e '.[dev]'
pytest tests/ -v

๐Ÿ“„ License

MIT โ€” see LICENSE.

Built for GPU performance engineers who live in the terminal.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nsys_ai-0.2.0.tar.gz (68.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nsys_ai-0.2.0-py3-none-any.whl (75.2 kB view details)

Uploaded Python 3

File details

Details for the file nsys_ai-0.2.0.tar.gz.

File metadata

  • Download URL: nsys_ai-0.2.0.tar.gz
  • Upload date:
  • Size: 68.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nsys_ai-0.2.0.tar.gz
Algorithm Hash digest
SHA256 36d718173d48be119510594908b91334e61dc95d742ef0320452dfc8605e5c87
MD5 d27e95a84c71f5e68f02edd7af261a62
BLAKE2b-256 e8adbded6218c9bbacdd543d17b827c6792653512f20e97dbf5be1b2bc11f8dc

See more details on using hashes here.

File details

Details for the file nsys_ai-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: nsys_ai-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 75.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nsys_ai-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 682b7d3b23503f8cee20bbd7e7f9f72b1851591de0a6e69a19be2239b2b36b34
MD5 a62146e45a446368e41493e5dce01e36
BLAKE2b-256 00b8d911731d6c395b37cc3d79d62ae9c3d5ea6dc10a7f0c6d5aa8e3e86189e0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page