codekingpro commited on
Commit
f9c4700
·
verified ·
1 Parent(s): 2f705f7

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/documentation/Archives/index.html +202 -0
  2. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/documentation/CopyrightAndLicenses/index.html +0 -0
  3. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/documentation/InstallationGuide/index.html +468 -0
  4. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/documentation/ReleaseNotes/index.html +336 -0
  5. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/documentation/UserGuide/index.html +0 -0
  6. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/Plugins/CorePlugin/Manifest.js +743 -0
  7. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/Plugins/QuadDPlugin/Manifest.js +857 -0
  8. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/Plugins/QuadDPlugin/default.layout +33 -0
  9. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/Plugins/TimelinePlugin/Manifest.js +27 -0
  10. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/Plugins/TimelinePlugin/TimelinePlugin.dll +0 -0
  11. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/Plugins/imageformats/qgif.dll +0 -0
  12. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/Plugins/imageformats/qico.dll +0 -0
  13. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/Plugins/imageformats/qsvg.dll +0 -0
  14. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/Plugins/imageformats/qtga.dll +0 -0
  15. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/Plugins/imageformats/qwbmp.dll +0 -0
  16. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/Plugins/tls/qcertonlybackend.dll +0 -0
  17. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/PythonNvtx/annotations.json +37 -0
  18. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/Scripts/Flamegraph/README.md +41 -0
  19. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/Scripts/Flamegraph/stackcollapse_nsys.py +448 -0
  20. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/python/lib/gpustats.py +239 -0
  21. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/python/lib/kernel_helper.py +188 -0
  22. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/python/lib/nsysstats.py +616 -0
  23. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/README.txt +56 -0
  24. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/_sql.py +48 -0
  25. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/_sqlfile.py +57 -0
  26. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/_tbl.py +54 -0
  27. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/_values.py +62 -0
  28. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/apigpusum.py +153 -0
  29. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/cuda_api_gpu_sum.py +191 -0
  30. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/cuda_api_sum.py +94 -0
  31. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/cuda_api_trace.py +76 -0
  32. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/cuda_gpu_kern_gb_sum.py +123 -0
  33. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/cuda_gpu_kern_sum.py +125 -0
  34. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/cuda_gpu_mem_size_sum.py +116 -0
  35. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/cuda_gpu_mem_time_sum.py +127 -0
  36. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/cuda_gpu_sum.py +172 -0
  37. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/cuda_gpu_trace.py +257 -0
  38. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/cuda_kern_exec_sum.py +170 -0
  39. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/cuda_kern_exec_trace.py +132 -0
  40. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/cudaapisum.py +70 -0
  41. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/cudaapitrace.py +58 -0
  42. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/dx11_pix_sum.py +94 -0
  43. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/dx11pixsum.py +74 -0
  44. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/dx12_gpu_marker_sum.py +89 -0
  45. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/dx12_pix_sum.py +94 -0
  46. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/dx12gpumarkersum.py +69 -0
  47. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/dx12pixsum.py +74 -0
  48. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/gpukerngbsum.py +89 -0
  49. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/gpukernsum.py +85 -0
  50. cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/gpumemsizesum.py +98 -0
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/documentation/Archives/index.html ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html class="writer-html5" lang="en" >
3
+ <head>
4
+ <meta charset="utf-8" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
5
+
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Archives &mdash; nsight-systems 2023.4 documentation</title>
8
+ <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
9
+ <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
10
+ <link rel="stylesheet" href="../_static/design-style.b7bb847fb20b106c3d81b95245e65545.min.css" type="text/css" />
11
+ <link rel="stylesheet" href="../_static/omni-style.css" type="text/css" />
12
+ <link rel="stylesheet" href="../_static/api-styles.css" type="text/css" />
13
+ <link rel="shortcut icon" href="../_static/favicon.ico"/>
14
+ <!--[if lt IE 9]>
15
+ <script src="../_static/js/html5shiv.min.js"></script>
16
+ <![endif]-->
17
+
18
+ <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
19
+ <script src="../_static/jquery.js"></script>
20
+ <script src="../_static/underscore.js"></script>
21
+ <script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
22
+ <script src="../_static/doctools.js"></script>
23
+ <script src="../_static/sphinx_highlight.js"></script>
24
+ <script src="../_static/mermaid-init.js"></script>
25
+ <script src="../_static/design-tabs.js"></script>
26
+ <script src="../_static/version.js"></script>
27
+ <script src="../_static/social-media.js"></script>
28
+ <script src="../_static/js/theme.js"></script>
29
+ <link rel="index" title="Index" href="../genindex.html" />
30
+ <link rel="search" title="Search" href="../search.html" />
31
+ <link rel="prev" title="Copyright and Licenses" href="../CopyrightAndLicenses/index.html" />
32
+
33
+
34
+
35
+ </head>
36
+
37
+ <body class="wy-body-for-nav">
38
+ <div class="wy-grid-for-nav">
39
+ <nav data-toggle="wy-nav-shift" class="wy-nav-side">
40
+ <div class="wy-side-scroll">
41
+ <div class="wy-side-nav-search" >
42
+
43
+
44
+ <a href="../index.html">
45
+ <img src="../_static/devzone.png" class="logo" alt="Logo"/>
46
+ </a>
47
+
48
+ <div role="search">
49
+ <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
50
+ <input type="text" name="q" placeholder="Search docs" />
51
+ <input type="hidden" name="check_keywords" value="yes" />
52
+ <input type="hidden" name="area" value="default" />
53
+ </form>
54
+ </div>
55
+ </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
56
+ <ul>
57
+ <li class="toctree-l1"><a class="reference internal" href="../ReleaseNotes/index.html">Release Notes</a></li>
58
+ <li class="toctree-l1"><a class="reference internal" href="../InstallationGuide/index.html">Installation Guide</a></li>
59
+ <li class="toctree-l1"><a class="reference internal" href="../UserGuide/index.html">User Guide</a></li>
60
+ <li class="toctree-l1"><a class="reference internal" href="../CopyrightAndLicenses/index.html">Copyright and Licenses</a></li>
61
+ </ul>
62
+ <p class="caption" role="heading"><span class="caption-text">Archives</span></p>
63
+ <ul class="current">
64
+ <li class="toctree-l1 current"><a class="current reference internal" href="#">Archives</a><ul>
65
+ <li class="toctree-l2"><a class="reference internal" href="#nvidia-nsight-systems-archives">NVIDIA Nsight Systems Archives</a></li>
66
+ </ul>
67
+ </li>
68
+ </ul>
69
+
70
+ </div>
71
+ </div>
72
+ </nav>
73
+
74
+ <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
75
+ <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
76
+ <a href="../index.html">nsight-systems</a>
77
+ </nav>
78
+
79
+ <div class="wy-nav-content">
80
+ <div class="rst-content">
81
+ <div role="navigation" aria-label="Page navigation">
82
+ <ul class="wy-breadcrumbs">
83
+
84
+
85
+ <li><a href="../index.html" class="icon icon-home"></a> &raquo;</li>
86
+ <li>Archives</li>
87
+
88
+ <li class="wy-breadcrumbs-aside">
89
+ </li>
90
+ <li class="wy-breadcrumbs-aside">
91
+
92
+
93
+ <span>v2023.4 |</span>
94
+
95
+
96
+
97
+ <a href="https://developer.nvidia.com/nsight-systems/" class="reference external">Archive</a>
98
+
99
+
100
+ <span>&nbsp;</span>
101
+ </li>
102
+
103
+ </ul>
104
+ <hr/>
105
+ </div>
106
+ <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
107
+ <div itemprop="articleBody">
108
+
109
+ <section id="archives">
110
+ <h1>Archives<a class="headerlink" href="#archives" title="Permalink to this heading"></a></h1>
111
+ <p>Documentation for previous versions of NVIDIA Nsight Systems.</p>
112
+ <section id="nvidia-nsight-systems-archives">
113
+ <h2>NVIDIA Nsight Systems Archives<a class="headerlink" href="#nvidia-nsight-systems-archives" title="Permalink to this heading"></a></h2>
114
+ <p>Below, you can find the current and past release information for NVIDIA Nsight Systems.</p>
115
+ <p><strong>Nsight Systems Unified Documentation</strong></p>
116
+ <ul class="simple">
117
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/index.html">Latest version</a></p></li>
118
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2023.2/index.html">NVIDIA Nsight Systems 2023.2</a></p></li>
119
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2023.1/index.html">NVIDIA Nsight Systems 2023.1</a></p></li>
120
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2022.5/index.html">NVIDIA Nsight Systems 2022.5</a></p></li>
121
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2022.4/index.html">NVIDIA Nsight Systems 2022.4</a></p></li>
122
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2022.3/index.html">NVIDIA Nsight Systems 2022.3</a></p></li>
123
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2022.2/index.html">NVIDIA Nsight Systems 2022.2</a></p></li>
124
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2022.1/index.html">NVIDIA Nsight Systems 2022.1</a></p></li>
125
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2021.5/index.html">NVIDIA Nsight Systems 2021.5</a></p></li>
126
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2021.4/index.html">NVIDIA Nsight Systems 2021.4</a></p></li>
127
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2021.3/index.html">NVIDIA Nsight Systems 2021.3</a></p></li>
128
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2021.2/index.html">NVIDIA Nsight Systems 2021.2</a></p></li>
129
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2021.1/index.html">NVIDIA Nsight Systems 2021.1</a></p></li>
130
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2020.5/index.html">NVIDIA Nsight Systems 2020.5</a></p></li>
131
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2020.4/index.html">NVIDIA Nsight Systems 2020.4</a></p></li>
132
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2020.3/index.html">NVIDIA Nsight Systems 2020.3</a></p></li>
133
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2020.2/index.html">NVIDIA Nsight Systems 2020.2</a></p></li>
134
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2020.1/index.html">NVIDIA Nsight Systems 2020.1</a></p></li>
135
+ </ul>
136
+ <p><strong>Nsight Systems for Workstation</strong></p>
137
+ <ul class="simple">
138
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2019.6/index.html">NVIDIA Nsight Systems 2019.6</a></p></li>
139
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2019.5/index.html">NVIDIA Nsight Systems 2019.5</a></p></li>
140
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2019.4/index.html">NVIDIA Nsight Systems 2019.4</a></p></li>
141
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2019.3.6/index.html">NVIDIA Nsight Systems 2019.3.6</a></p></li>
142
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2019.3/index.html">NVIDIA Nsight Systems 2019.3</a></p></li>
143
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2019.2/index.html">NVIDIA Nsight Systems 2019.2</a></p></li>
144
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2019.1/index.html">NVIDIA Nsight Systems 2019.1</a></p></li>
145
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2018.3/index.html">NVIDIA Nsight Systems 2018.3</a></p></li>
146
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2018.2/index.html">NVIDIA Nsight Systems 2018.2</a></p></li>
147
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2018.1/index.html">NVIDIA Nsight Systems 2018.1</a></p></li>
148
+ <li><p><a class="reference external" href="https://docs.nvidia.com/nsight-systems/2018.0/index.html">NVIDIA Nsight Systems 2018.0</a></p></li>
149
+ </ul>
150
+ <p><strong>NVIDIA Nsight Systems for Embedded</strong></p>
151
+ <ul class="simple">
152
+ <li><p><a class="reference external" href="https://docs.nvidia.com/embedded/nsight-systems/2019.6/index.html">NVIDIA Nsight Systems 2019.6</a></p></li>
153
+ <li><p><a class="reference external" href="https://docs.nvidia.com/embedded/nsight-systems/2019.4/index.html">NVIDIA Nsight Systems 2019.4</a></p></li>
154
+ <li><p><a class="reference external" href="https://docs.nvidia.com/embedded/nsight-systems/2019.3/index.html">NVIDIA Nsight Systems 2019.3</a></p></li>
155
+ <li><p><a class="reference external" href="https://docs.nvidia.com/embedded/nsight-systems/2018.1.3/index.html">NVIDIA Nsight Graphics 2018.1</a></p></li>
156
+ </ul>
157
+ <p><strong>NVIDIA Nsight Systems for DRIVE</strong></p>
158
+ <ul class="simple">
159
+ <li><p><a class="reference external" href="https://docs.nvidia.com/drive/drive-os-5.2.6.0L/nsight-systems/index.html">NVIDIA Nsight Systems for Drive 5.2.6</a></p></li>
160
+ <li><p><a class="reference external" href="https://docs.nvidia.com/drive/drive_os_5.2.3.0L/nsight-systems/index.html">NVIDIA Nsight Systems for Drive 5.2.3</a></p></li>
161
+ <li><p><a class="reference external" href="https://docs.nvidia.com/drive/drive_os_5.2.0.0L/nsight-systems/index.html">NVIDIA Nsight Systems for Drive 5.2.0</a></p></li>
162
+ <li><p><a class="reference external" href="https://docs.nvidia.com/drive/drive_os_5.1.15.0L/nsight-systems/index.html">NVIDIA Nsight Systems for Drive 5.1.15</a></p></li>
163
+ <li><p><a class="reference external" href="https://docs.nvidia.com/drive/drive_os_5.1.12.0L/nsight-systems/index.html">NVIDIA Nsight Systems for Drive 5.1.12</a></p></li>
164
+ <li><p><a class="reference external" href="https://docs.nvidia.com/drive/drive_os_5.1.9.0L/nsight-systems/index.html">NVIDIA Nsight Systems for Drive 5.1.9</a></p></li>
165
+ <li><p><a class="reference external" href="https://docs.nvidia.com/drive/active/5.1.6.0L/nsight_systems/index.html">NVIDIA Nsight Systems for Drive 5.1.6</a></p></li>
166
+ <li><p><a class="reference external" href="https://docs.nvidia.com/drive/active/5.1.3.0L/nsight_systems/index.html">NVIDIA Nsight Systems for Drive 5.1.3</a></p></li>
167
+ <li><p><a class="reference external" href="https://docs.nvidia.com/drive/active/5.0.13.0L/devtools/nsight-systems/2018.1/index.html">NVIDIA Nsight Systems for Drive 5.0.13</a></p></li>
168
+ </ul>
169
+ </section>
170
+ </section>
171
+
172
+
173
+ </div>
174
+ </div>
175
+ <footer>
176
+
177
+ <hr/>
178
+
179
+ <div role="contentinfo">
180
+ <p>&#169; Copyright 2018-2023, NVIDIA Corporation &amp; Affiliates. All rights reserved.
181
+ <span class="lastupdated">Last updated on Dec 20, 2023.
182
+ </span></p>
183
+ </div>
184
+
185
+
186
+
187
+ </footer>
188
+ </div>
189
+ </div>
190
+ </section>
191
+ </div>
192
+ <script>
193
+ jQuery(function () {
194
+ SphinxRtdTheme.Navigation.enable(true);
195
+ });
196
+ </script>
197
+
198
+
199
+
200
+
201
+ </body>
202
+ </html>
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/documentation/CopyrightAndLicenses/index.html ADDED
The diff for this file is too large to render. See raw diff
 
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/documentation/InstallationGuide/index.html ADDED
@@ -0,0 +1,468 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html class="writer-html5" lang="en" >
3
+ <head>
4
+ <meta charset="utf-8" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
5
+
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Installation Guide &mdash; nsight-systems 2023.4 documentation</title>
8
+ <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
9
+ <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
10
+ <link rel="stylesheet" href="../_static/design-style.b7bb847fb20b106c3d81b95245e65545.min.css" type="text/css" />
11
+ <link rel="stylesheet" href="../_static/omni-style.css" type="text/css" />
12
+ <link rel="stylesheet" href="../_static/api-styles.css" type="text/css" />
13
+ <link rel="shortcut icon" href="../_static/favicon.ico"/>
14
+ <!--[if lt IE 9]>
15
+ <script src="../_static/js/html5shiv.min.js"></script>
16
+ <![endif]-->
17
+
18
+ <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
19
+ <script src="../_static/jquery.js"></script>
20
+ <script src="../_static/underscore.js"></script>
21
+ <script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
22
+ <script src="../_static/doctools.js"></script>
23
+ <script src="../_static/sphinx_highlight.js"></script>
24
+ <script src="../_static/mermaid-init.js"></script>
25
+ <script src="../_static/design-tabs.js"></script>
26
+ <script src="../_static/version.js"></script>
27
+ <script src="../_static/social-media.js"></script>
28
+ <script src="../_static/js/theme.js"></script>
29
+ <link rel="index" title="Index" href="../genindex.html" />
30
+ <link rel="search" title="Search" href="../search.html" />
31
+ <link rel="next" title="User Guide" href="../UserGuide/index.html" />
32
+ <link rel="prev" title="Release Notes" href="../ReleaseNotes/index.html" />
33
+
34
+
35
+
36
+ </head>
37
+
38
+ <body class="wy-body-for-nav">
39
+ <div class="wy-grid-for-nav">
40
+ <nav data-toggle="wy-nav-shift" class="wy-nav-side">
41
+ <div class="wy-side-scroll">
42
+ <div class="wy-side-nav-search" >
43
+
44
+
45
+ <a href="../index.html">
46
+ <img src="../_static/devzone.png" class="logo" alt="Logo"/>
47
+ </a>
48
+
49
+ <div role="search">
50
+ <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
51
+ <input type="text" name="q" placeholder="Search docs" />
52
+ <input type="hidden" name="check_keywords" value="yes" />
53
+ <input type="hidden" name="area" value="default" />
54
+ </form>
55
+ </div>
56
+ </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
57
+ <ul class="current">
58
+ <li class="toctree-l1"><a class="reference internal" href="../ReleaseNotes/index.html">Release Notes</a></li>
59
+ <li class="toctree-l1 current"><a class="current reference internal" href="#">Installation Guide</a><ul>
60
+ <li class="toctree-l2"><a class="reference internal" href="#overview">Overview</a></li>
61
+ <li class="toctree-l2"><a class="reference internal" href="#system-requirements">System Requirements</a><ul>
62
+ <li class="toctree-l3"><a class="reference internal" href="#supported-platforms">Supported Platforms</a></li>
63
+ <li class="toctree-l3"><a class="reference internal" href="#cuda-version">CUDA Version</a></li>
64
+ <li class="toctree-l3"><a class="reference internal" href="#requirements-for-x86-64-power-and-arm-sbsa-targets-on-linux">Requirements for x86_64, Power, and Arm SBSA Targets on Linux</a></li>
65
+ <li class="toctree-l3"><a class="reference internal" href="#x86-64-windows-target-device-requirements">x86_64 Windows Target Device Requirements</a></li>
66
+ <li class="toctree-l3"><a class="reference internal" href="#host-application-requirements">Host Application Requirements</a></li>
67
+ </ul>
68
+ </li>
69
+ <li class="toctree-l2"><a class="reference internal" href="#getting-started-guide">Getting Started Guide</a><ul>
70
+ <li class="toctree-l3"><a class="reference internal" href="#finding-the-right-package">Finding the Right Package</a></li>
71
+ <li class="toctree-l3"><a class="reference internal" href="#installing-gui-on-the-host-system">Installing GUI on the Host System</a></li>
72
+ <li class="toctree-l3"><a class="reference internal" href="#optional-setting-up-the-cli">Optional: Setting up the CLI</a></li>
73
+ <li class="toctree-l3"><a class="reference internal" href="#launching-the-gui">Launching the GUI</a></li>
74
+ <li class="toctree-l3"><a class="reference internal" href="#installing-multi-report-analysis-system">Installing Multi Report Analysis System</a></li>
75
+ </ul>
76
+ </li>
77
+ </ul>
78
+ </li>
79
+ <li class="toctree-l1"><a class="reference internal" href="../UserGuide/index.html">User Guide</a></li>
80
+ <li class="toctree-l1"><a class="reference internal" href="../CopyrightAndLicenses/index.html">Copyright and Licenses</a></li>
81
+ </ul>
82
+ <p class="caption" role="heading"><span class="caption-text">Archives</span></p>
83
+ <ul>
84
+ <li class="toctree-l1"><a class="reference internal" href="../Archives/index.html">Archives</a></li>
85
+ </ul>
86
+
87
+ </div>
88
+ </div>
89
+ </nav>
90
+
91
+ <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
92
+ <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
93
+ <a href="../index.html">nsight-systems</a>
94
+ </nav>
95
+
96
+ <div class="wy-nav-content">
97
+ <div class="rst-content">
98
+ <div role="navigation" aria-label="Page navigation">
99
+ <ul class="wy-breadcrumbs">
100
+
101
+
102
+ <li><a href="../index.html" class="icon icon-home"></a> &raquo;</li>
103
+ <li>Installation Guide</li>
104
+
105
+ <li class="wy-breadcrumbs-aside">
106
+ </li>
107
+ <li class="wy-breadcrumbs-aside">
108
+
109
+
110
+ <span>v2023.4 |</span>
111
+
112
+
113
+
114
+ <a href="https://developer.nvidia.com/nsight-systems/" class="reference external">Archive</a>
115
+
116
+
117
+ <span>&nbsp;</span>
118
+ </li>
119
+
120
+ </ul>
121
+ <hr/>
122
+ </div>
123
+ <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
124
+ <div itemprop="articleBody">
125
+
126
+ <section id="installation-guide">
127
+ <h1>Installation Guide<a class="headerlink" href="#installation-guide" title="Permalink to this heading"></a></h1>
128
+ <p>NVIDIA Nsight Systems installation guide.</p>
129
+ <section id="overview">
130
+ <h2>Overview<a class="headerlink" href="#overview" title="Permalink to this heading"></a></h2>
131
+ <p>Nsight Systems is a statistical sampling profiler with tracing features. It is designed to work with devices and devkits based on NVIDIA Tegra SoCs (system-on-chip), Arm SBSA (server based system architecture) systems, IBM Power systems, and systems based on the x86_64 processor architecture that also include NVIDIA GPU(s).</p>
132
+ <p>Throughout this document we will refer to the device on which profiling happens as the <strong>target</strong>, and the computer on which the user works and controls the profiling session as the <strong>host</strong>. Note that for x86_64 based systems these may be on the same device, whereas with Tegra, Arm, or IBM Power based systems they will always be separate.</p>
133
+ <p>Furthermore, three different activities are distinguished as follows:</p>
134
+ <ul class="simple">
135
+ <li><p><strong>Profiling</strong> — The process of collecting any performance data. A profiling session in Nsight Systems typically includes sampling and tracing.</p></li>
136
+ <li><p><strong>Sampling</strong> — The process of periodically stopping the <em>profilee</em> (the application under investigation during the profiling session), typically to collect backtraces (call stacks of active threads), which allows you to understand statistically how much time is spent in each function. Additionally, hardware counters can also be sampled. This process is inherently imprecise when a low number of samples have been collected.</p></li>
137
+ <li><p><strong>Tracing</strong> — The process of collecting precise information about various activities happening in the profilee or in the system. For example, profilee API execution may be traced providing the exact time and duration of a function call.</p></li>
138
+ </ul>
139
+ <p>Nsight Systems supports multiple generations of Tegra SoCs, NVIDIA discrete GPUs, and various CPU architectures, as well as various target and host operating systems. This documentation describes the full set of features available in any version of Nsight Systems. In the event that a feature is not available in all versions, that will be noted in the text. In general, Nsight Systems Embedded Platforms Edition indicates the package that supports Tegra processors for the embedded and automotive market and Nsight Systems Workstation Edition supports x86_64, IBM Power, and Arm server (SBSA) processors for the workstation and cluster market.</p>
140
+ <p>Common features that are supported by Nsight Systems on most platforms include the following:</p>
141
+ <ul class="simple">
142
+ <li><p>Sampling of the profilee and collecting backtraces using multiple algorithms (such as frame pointers or DWARF data). Building top-down, bottom-up, and flat views as appropriate. This information helps identify performance bottlenecks in CPU-intensive code.</p></li>
143
+ <li><p>Sampling or tracing system power behaviors, such as CPU frequency.</p></li>
144
+ <li><p>(Only on Nsight Systems Embedded Platforms Edition)Sampling counters from Arm PMU (Performance Monitoring Unit). Information such as cache misses gets statistically correlated with function execution.</p></li>
145
+ <li><p>Support for multiple windows. Users with multiple monitors can see multiple reports simultaneously, or have multiple views into the same report file.</p></li>
146
+ </ul>
147
+ <p>With Nsight Systems, a user could:</p>
148
+ <ul class="simple">
149
+ <li><p>Identify call paths that monopolize the CPU.</p></li>
150
+ <li><p>Identify individual functions that monopolize the CPU (across different call paths).</p></li>
151
+ <li><p>For Nsight Systems Embedded Platforms Edition, identify functions that have poor cache utilization.</p></li>
152
+ <li><p>If platform supports CUDA, see visual representation of CUDA Runtime and Driver API calls, as well as CUDA GPU workload. Nsight Systems uses the CUDA Profiling Tools Interface (CUPTI), for more information, see: <a class="reference external" href="https://docs.nvidia.com/cuda/cupti/index.html">CUPTI documentation</a>.</p></li>
153
+ <li><p>If the user annotates with NVIDIA Tools Extension (NVTX), see visual representation of NVTX annotations: ranges, markers, and thread names.</p></li>
154
+ <li><p>For Windows targets, see visual representation of D3D12: which API calls are being made on the CPU, graphic frames, stutter analysis, as well as GPU workloads (command lists and debug ranges).</p></li>
155
+ <li><p>For x86_64 targets, see visual representation of Vulkan: which API calls are being made on the CPU, graphic frames, stutter analysis, as well as Vulkan GPU workloads (command buffers and debug ranges).</p></li>
156
+ </ul>
157
+ </section>
158
+ <section id="system-requirements">
159
+ <h2>System Requirements<a class="headerlink" href="#system-requirements" title="Permalink to this heading"></a></h2>
160
+ <p>Nsight Systems supports multiple platforms. For simplicity, think of these as Nsight Systems Embedded Platforms Edition and Nsight Systems Workstation Edition, where Nsight Systems Workstation Edition supports desktops, workstations, and clusters with x86_64, IBM Power, and Arm SBSA CPUs on Linux and Windows OSs, while Nsight Systems Embedded Platforms Edition supports NVIDIA Tegra products for the embedded and gaming space on Linux for Tegra and QNX OSs.</p>
161
+ <section id="supported-platforms">
162
+ <h3>Supported Platforms<a class="headerlink" href="#supported-platforms" title="Permalink to this heading"></a></h3>
163
+ <p>Depending on your OS, different GPUs are supported</p>
164
+ <p>L4T (Linux for Tegra)</p>
165
+ <ul class="simple">
166
+ <li><p>Jetson AGX Xavier</p></li>
167
+ <li><p>Jetson TX2</p></li>
168
+ <li><p>Jetson TX2i</p></li>
169
+ <li><p>Jetson TX</p></li>
170
+ <li><p>Jetson Nano</p></li>
171
+ <li><p>Jetson Xavier NX</p></li>
172
+ </ul>
173
+ <p>x86_64, IBM Power (from Power 9), or Arm SBSA</p>
174
+ <ul class="simple">
175
+ <li><p>NVIDIA GPU architectures starting with Pascal</p></li>
176
+ <li><p>OS (64 bit only)</p>
177
+ <ul>
178
+ <li><p>Ubuntu 18.04, 20.04, and 22.04</p></li>
179
+ <li><p>CentOS and RedHat Enterprise Linux 7.4+ with kernel version 3.10.0-693 or later.</p></li>
180
+ <li><p>Windows 10, 11, and Win Server 2022</p></li>
181
+ </ul>
182
+ </li>
183
+ </ul>
184
+ </section>
185
+ <section id="cuda-version">
186
+ <h3>CUDA Version<a class="headerlink" href="#cuda-version" title="Permalink to this heading"></a></h3>
187
+ <ul class="simple">
188
+ <li><p>Nsight Systems supports CUDA 10.0, 10.1, 10.2, and 11.X for most platforms</p></li>
189
+ <li><p>Nsight Systems on Arm SBSA supports 10.2 and 11.X</p></li>
190
+ </ul>
191
+ <p>Note that CUDA version and driver version must be compatible.</p>
192
+ <table class="table-no-stripes docutils align-default">
193
+ <thead>
194
+ <tr class="row-odd"><th class="head"><p>CUDA Version</p></th>
195
+ <th class="head"><p>Driver minimum version</p></th>
196
+ </tr>
197
+ </thead>
198
+ <tbody>
199
+ <tr class="row-even"><td><p>11.0</p></td>
200
+ <td><p>450</p></td>
201
+ </tr>
202
+ <tr class="row-odd"><td><p>10.2</p></td>
203
+ <td><p>440.30</p></td>
204
+ </tr>
205
+ <tr class="row-even"><td><p>10.1</p></td>
206
+ <td><p>418.39</p></td>
207
+ </tr>
208
+ <tr class="row-odd"><td><p>10.0</p></td>
209
+ <td><p>410.48</p></td>
210
+ </tr>
211
+ </tbody>
212
+ </table>
213
+ <p>From CUDA 11.X on, any driver from 450 on will be supported, although new features introduced in more recent drivers will not be available.</p>
214
+ <p>For information about which drivers were specifically released with each toolkit, see <a class="reference external" href="https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html#cuda-major-component-versions">CUDA Toolkit Release Notes - Major Component Versions</a></p>
215
+ </section>
216
+ <section id="requirements-for-x86-64-power-and-arm-sbsa-targets-on-linux">
217
+ <h3>Requirements for x86_64, Power, and Arm SBSA Targets on Linux<a class="headerlink" href="#requirements-for-x86-64-power-and-arm-sbsa-targets-on-linux" title="Permalink to this heading"></a></h3>
218
+ <p>When attaching to x86_64, Power, or Arm SBSA Linux-based target from the GUI on the host, the connection is established through SSH.</p>
219
+ <p><strong>Use of Linux Perf</strong>: To collect thread scheduling data and IP (instruction pointer) samples, the Linux operating system’s perf_event_paranoid level must be 2 or less. Use the following command to check:</p>
220
+ <blockquote>
221
+ <div><div class="highlight-text notranslate"><div class="highlight"><pre><span></span>cat /proc/sys/kernel/perf_event_paranoid
222
+ </pre></div>
223
+ </div>
224
+ </div></blockquote>
225
+ <p>If the output is &gt;2, then do the following to temporarily adjust the paranoid level (note that this has to be done after each reboot):</p>
226
+ <blockquote>
227
+ <div><div class="highlight-text notranslate"><div class="highlight"><pre><span></span>sudo sh -c &#39;echo 2 &gt;/proc/sys/kernel/perf_event_paranoid&#39;
228
+ </pre></div>
229
+ </div>
230
+ </div></blockquote>
231
+ <p>To make the change permanent, use the following command:</p>
232
+ <blockquote>
233
+ <div><div class="highlight-text notranslate"><div class="highlight"><pre><span></span>sudo sh -c &#39;echo kernel.perf_event_paranoid=2 &gt; /etc/sysctl.d/local.conf&#39;
234
+ </pre></div>
235
+ </div>
236
+ </div></blockquote>
237
+ <p><strong>Kernel version</strong>: To collect thread scheduling data and IP (instruction pointer) samples and backtraces, the kernel version must be:</p>
238
+ <ul class="simple">
239
+ <li><p>3.10.0-693 or later for CentOS and RedHat Enterprise Linux 7.4+</p></li>
240
+ <li><p>4.3 or greater for all other distros including Ubuntu</p></li>
241
+ </ul>
242
+ <p>To check the version number of the kernel on a target device, run the following command on the device:</p>
243
+ <blockquote>
244
+ <div><div class="highlight-text notranslate"><div class="highlight"><pre><span></span>uname -a
245
+ </pre></div>
246
+ </div>
247
+ </div></blockquote>
248
+ <p>Note that only CentOS, RedHat, and Ubuntu distros are tested/confirmed to work correctly.</p>
249
+ <p><strong>glibc version</strong>: To check the glibc version on a target device, run the following command:</p>
250
+ <blockquote>
251
+ <div><div class="highlight-text notranslate"><div class="highlight"><pre><span></span>ldd --version
252
+ </pre></div>
253
+ </div>
254
+ </div></blockquote>
255
+ <p>Nsight Systems requires glibc 2.17 or more recent.</p>
256
+ <p><strong>CUDA</strong>: See above for supported CUDA versions in this release. Use the deviceQuery command to determine the CUDA driver and runtime versions on the system. the deviceQuery command is available in the CUDA SDK. It is normally installed at:</p>
257
+ <blockquote>
258
+ <div><div class="highlight-text notranslate"><div class="highlight"><pre><span></span>/usr/local/cuda/samples/1_Utilities/deviceQuery
259
+ </pre></div>
260
+ </div>
261
+ </div></blockquote>
262
+ <p>Only pure 64-bit environments are supported. In other words, 32-bit systems or 32-bit processes running within a 64-bit environment are not supported.</p>
263
+ <p>Nsight Systems requires write permission to the <code class="docutils literal notranslate"><span class="pre">/var/lock</span></code> directory on the target system.</p>
264
+ <p><strong>Docker</strong>: See Collecting Data within a Docker section of the User Guide for more information.</p>
265
+ </section>
266
+ <section id="x86-64-windows-target-device-requirements">
267
+ <h3>x86_64 Windows Target Device Requirements<a class="headerlink" href="#x86-64-windows-target-device-requirements" title="Permalink to this heading"></a></h3>
268
+ <p><strong>DX12 Requires</strong>:</p>
269
+ <ul class="simple">
270
+ <li><p>Windows 10 with NVIDIA Driver 411.63 or higher for DX12 trace</p></li>
271
+ <li><p>Windows 10 April 2018 Update (version 1803, AKA Redstone 4) with NVIDIA Driver 411.63 or higher for DirectX Ray Tracing, and tracing DX12 Copy command queues.</p></li>
272
+ </ul>
273
+ </section>
274
+ <section id="host-application-requirements">
275
+ <h3>Host Application Requirements<a class="headerlink" href="#host-application-requirements" title="Permalink to this heading"></a></h3>
276
+ <p>The Nsight Systems host application runs on the following host platforms:</p>
277
+ <ul class="simple">
278
+ <li><p>Windows 10, Windows Server 2019. Only 64-bit versions are supported.</p></li>
279
+ <li><p>Linux Ubuntu 14.04 and higher are known to work, running on other modern distributions should be possible as well. Only 64-bit versions are supported.</p></li>
280
+ <li><p>OS X 10.10 “Yosemite” and higher.</p></li>
281
+ </ul>
282
+ </section>
283
+ </section>
284
+ <section id="getting-started-guide">
285
+ <h2>Getting Started Guide<a class="headerlink" href="#getting-started-guide" title="Permalink to this heading"></a></h2>
286
+ <section id="finding-the-right-package">
287
+ <h3>Finding the Right Package<a class="headerlink" href="#finding-the-right-package" title="Permalink to this heading"></a></h3>
288
+ <p>Nsight Systems is available for multiple targets and multiple host OSs. To choose the right package, first consider the target system to be analyzed.</p>
289
+ <ul class="simple">
290
+ <li><p>For Tegra target systems, select Nsight Systems Embedded Platforms Edition available as part of <a class="reference external" href="https://developer.nvidia.com/embedded/jetpack">NVIDIA JetPack SDK</a>.</p></li>
291
+ <li><p>For x86_64, IBM Power target systems, or Arm SBSA select from the target packages from Nsight Systems Workstation Edition, available from <a class="reference external" href="https://developer.nvidia.com/nsight-systems">https://developer.nvidia.com/nsight-systems</a>. This web release will always contain the latest and greatest Nsight Systems features.</p></li>
292
+ <li><p>The x86_64, IBM Power, and Arm SBSA target versions of Nsight Systems are also available in the <a class="reference external" href="https://developer.nvidia.com/cuda-downloads">CUDA Toolkit.</a></p></li>
293
+ </ul>
294
+ <p>Each package is limited to one architecture. For example, Tegra packages do not contain support for profiling x86 targets, and x86 packages do not contain support for profiling Tegra targets.</p>
295
+ <p>After choosing an appropriate target version, select the package corresponding to the host OS, the OS on the system where results will be viewed. These packages are in the form of common installer types: .msi for Windows; .run, .rpm, and .deb for x86 Linux; .deb and .rpm for Linux on IBM Power; and .dmg for the macOS installer.</p>
296
+ <p>Note: the IBM Power and Arm SBSA packages do not have a GUI for visualization of the result. If you wish to visualize your result, please download and install the GUI available for macOS, x86_64 Linux, or Windows systems.</p>
297
+ <p><strong>Tegra packages</strong></p>
298
+ <ul class="simple">
299
+ <li><p>Windows host - Install .msi on Windows machine. Enables remote access to Tegra device for profiling.</p></li>
300
+ <li><p>Linux host - Install .run on Linux system. Enables remote access to Tegra device for profiling.</p></li>
301
+ <li><p>macOS host - Install .dmg on macOS machine. Enables remote access to Tegra device for profiling.</p></li>
302
+ </ul>
303
+ <p><strong>x86_64 packages</strong></p>
304
+ <ul class="simple">
305
+ <li><p>Windows host - Install .msi on Windows machine. Enables remote access to Linux x86_64 or Windows devices for profiling as well as running on local system.</p></li>
306
+ <li><p>Linux host - Install .run, .rpm, or .deb on Linux system. Enables remote access to Linux x86_64 or Windows devices for profiling or running collection on localhost.</p></li>
307
+ <li><p>Linux CLI only - The Linux CLI is shipped in all x86 packages, but if you just want the CLI, we have a package for that. Install .deb on Linux system. Enables only CLI collection, report can be imported or opened in x86_64 host.</p></li>
308
+ <li><p>macOS host - Install .dmg on macOS machine. Enables remote access to Linux x86_64 device for profiling.</p></li>
309
+ </ul>
310
+ <p><strong>IBM Power packages</strong></p>
311
+ <ul class="simple">
312
+ <li><p>Power CLI only - The IBM Power support does not include a host GUI. Install .deb or .rpm on your Power system. Enables only CLI collection, report can be imported or opened in GUI on any supported host platform.</p></li>
313
+ </ul>
314
+ <p><strong>Arm SBSA packages</strong></p>
315
+ <ul class="simple">
316
+ <li><p>Arm SBSA CLI only - Arm SBSA support does not include a host GUI. Install .deb or .rpm on your Arm SBSA system. Enables only CLI collection, report can be imported or opened in GUI on any supported host platform.</p></li>
317
+ </ul>
318
+ </section>
319
+ <section id="installing-gui-on-the-host-system">
320
+ <h3>Installing GUI on the Host System<a class="headerlink" href="#installing-gui-on-the-host-system" title="Permalink to this heading"></a></h3>
321
+ <p>Copy the appropriate file to your host system in a directory where you have write and execute permissions. Run the install file, accept the EULA, and Nsight Systems will install on your system.</p>
322
+ <p>On Linux, there are special options to enable automated installation. Running the installer with the <code class="docutils literal notranslate"><span class="pre">--accept</span></code> flag will automatically accept the EULA, running with the <code class="docutils literal notranslate"><span class="pre">--accept</span></code> flag and the <code class="docutils literal notranslate"><span class="pre">--quiet</span></code> flag will automatically accept the EULA without printing to stdout. Running with <code class="docutils literal notranslate"><span class="pre">--quiet</span></code> without <code class="docutils literal notranslate"><span class="pre">--accept</span></code> will display an error.</p>
323
+ <p>The installation will create a Host directory for this host and a Target directory for each target this Nsight Systems package supports.</p>
324
+ <p>All binaries needed to collect data on a target device will be installed on the target by the host on first connection to the device. There is no need to install the package on the target device.</p>
325
+ <p>If installing from the CUDA Toolkit, see the <a class="reference external" href="https://docs.nvidia.com/cuda/">CUDA Toolkit documentation</a>.</p>
326
+ </section>
327
+ <section id="optional-setting-up-the-cli">
328
+ <h3>Optional: Setting up the CLI<a class="headerlink" href="#optional-setting-up-the-cli" title="Permalink to this heading"></a></h3>
329
+ <p>All Nsight Systems targets can be profiled using the CLI. IBM Power and Arm SBSA targets can only be profiled using the CLI. The CLI is especially helpful when scripts are used to run unattended collections or when access to the target system via ssh is not possible. In particular, this can be used to enable collection in a Docker container.</p>
330
+ <p>The CLI can be found in the Target directory of the Nsight Systems installation. Users who want to install the CLI as a standalone tool can do so by copying the files within the Target directory to the location of their choice.</p>
331
+ <p>If you wish to run the CLI without root (recommended mode) you will want to install in a directory where you have full access.</p>
332
+ <p>Once you have the CLI set up, you can use the <code class="docutils literal notranslate"><span class="pre">nsys</span> <span class="pre">status</span> <span class="pre">-e</span></code> command to check your environment.</p>
333
+ <div class="highlight-c++ notranslate"><div class="highlight"><pre><span></span><span class="o">~</span><span class="n">$</span><span class="w"> </span><span class="n">nsys</span><span class="w"> </span><span class="n">status</span><span class="w"> </span><span class="o">-</span><span class="n">e</span><span class="w"></span>
334
+
335
+ <span class="n">Sampling</span><span class="w"> </span><span class="n">Environment</span><span class="w"> </span><span class="n">Check</span><span class="w"></span>
336
+ <span class="n">Linux</span><span class="w"> </span><span class="n">Kernel</span><span class="w"> </span><span class="n">Paranoid</span><span class="w"> </span><span class="n">Level</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mi">1</span><span class="o">:</span><span class="w"> </span><span class="n">OK</span><span class="w"></span>
337
+ <span class="n">Linux</span><span class="w"> </span><span class="n">Distribution</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Ubuntu</span><span class="w"></span>
338
+ <span class="n">Linux</span><span class="w"> </span><span class="n">Kernel</span><span class="w"> </span><span class="n">Version</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">4.15.0</span><span class="mi">-109</span><span class="o">-</span><span class="n">generic</span><span class="o">:</span><span class="w"> </span><span class="n">OK</span><span class="w"></span>
339
+ <span class="n">Linux</span><span class="w"> </span><span class="n">perf_event_open</span><span class="w"> </span><span class="n">syscall</span><span class="w"> </span><span class="n">available</span><span class="o">:</span><span class="w"> </span><span class="n">OK</span><span class="w"></span>
340
+ <span class="n">Sampling</span><span class="w"> </span><span class="n">trigger</span><span class="w"> </span><span class="n">event</span><span class="w"> </span><span class="n">available</span><span class="o">:</span><span class="w"> </span><span class="n">OK</span><span class="w"></span>
341
+ <span class="n">Intel</span><span class="p">(</span><span class="n">c</span><span class="p">)</span><span class="w"> </span><span class="n">Last</span><span class="w"> </span><span class="n">Branch</span><span class="w"> </span><span class="n">Record</span><span class="w"> </span><span class="n">support</span><span class="o">:</span><span class="w"> </span><span class="n">Available</span><span class="w"></span>
342
+ <span class="n">Sampling</span><span class="w"> </span><span class="n">Environment</span><span class="o">:</span><span class="w"> </span><span class="n">OK</span><span class="w"></span>
343
+ </pre></div>
344
+ </div>
345
+ <p>This status check allows you to ensure that the system requirements for CPU sampling using Nsight Systems are met in your local environment. If the Sampling Environment is not OK, you will still be able to run various trace operations.</p>
346
+ <p>Intel(c) Last Branch Record allows tools, including Nsight Systems to use hardware to quickly get limited stack information. Nsight Systems will use this method for stack resolution by default if available.</p>
347
+ <p>For information about changing these environment settings, see System Requirements section in the Installation Guide. For information about changing the backtrace method, see Profiling from the CLI in the User Guide.</p>
348
+ <p>To get started using the CLI, run <code class="docutils literal notranslate"><span class="pre">nsys</span> <span class="pre">--help</span></code> for a list of options or see Profiling Applications from the CLI in the User Guide for full documentation.</p>
349
+ </section>
350
+ <section id="launching-the-gui">
351
+ <h3>Launching the GUI<a class="headerlink" href="#launching-the-gui" title="Permalink to this heading"></a></h3>
352
+ <p>Depending on your OS, Nsight Systems will have installed an icon on your host desktop that you can use to launch the GUI. To launch the GUI directly, run the <code class="docutils literal notranslate"><span class="pre">nsys-ui</span></code> executable in the Host sub-directory of your installation.</p>
353
+ </section>
354
+ <section id="installing-multi-report-analysis-system">
355
+ <h3>Installing Multi Report Analysis System<a class="headerlink" href="#installing-multi-report-analysis-system" title="Permalink to this heading"></a></h3>
356
+ <p><strong>PREVIEW FEATURE</strong></p>
357
+ <p>The Nsight Systems multi-report analysis system can be located in the <code class="docutils literal notranslate"><span class="pre">&lt;install-dir&gt;/target-linux-x64/python/packages</span></code> directory. For this initial preview release, multi-node analysis is only available to run recipes on Linux targets, and only available to visualize on Linux or Windows hosts.</p>
358
+ <p><strong>Recipe Dependencies</strong></p>
359
+ <p>The system is written in Python and depends on a set of Python packages. The prerequisites are Python 3.6 or newer with pip and venv. If you don’t have Python, you can install it from python.org or your Linux package manager.</p>
360
+ <p><strong>Pip/venv on Ubuntu</strong></p>
361
+ <p>If pip/venv were not installed with Python, run:</p>
362
+ <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>$ sudo apt-get install python3-pip
363
+ $ sudo apt-get install python3-venv
364
+ </pre></div>
365
+ </div>
366
+ <p>On a fresh Ubuntu install, we will need to run the following before the above commands:</p>
367
+ <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>$ sudo apt-get update
368
+ </pre></div>
369
+ </div>
370
+ <p>The dependent packages can either be installed automatically by an automated script or manually.</p>
371
+ <p><strong>Automated script</strong></p>
372
+ <p>The <code class="docutils literal notranslate"><span class="pre">&lt;install-dir&gt;/target-linux-x64/python/packages/nsys_recipe/install.py</span></code> script automates the installation of the recipe dependencies. You must select either the <code class="docutils literal notranslate"><span class="pre">--current</span></code> or <code class="docutils literal notranslate"><span class="pre">--venv</span> <span class="pre">PATH</span></code> option when you run the script.</p>
373
+ <p>Options:</p>
374
+ <ul class="simple">
375
+ <li><p><code class="docutils literal notranslate"><span class="pre">-h</span></code>: Display help</p></li>
376
+ <li><p><code class="docutils literal notranslate"><span class="pre">--current</span></code>: Install packages in the current environment. If a venv is active, packages will be installed there. Otherwise, packages will be installed in the system site-packages directory. It enables usage of <code class="docutils literal notranslate"><span class="pre">nsys</span> <span class="pre">recipe</span></code> without having to source a virtual environment. However, new packages risk colliding with existing ones if different versions are required.</p></li>
377
+ <li><p><code class="docutils literal notranslate"><span class="pre">--venv</span> <span class="pre">PATH</span></code>: Install packages in a virtual environment. If it doesn’t already exist, it is created. It prevents risk of package collision in the current environment but requires the virtual environment to be activated before running <code class="docutils literal notranslate"><span class="pre">nsys</span> <span class="pre">recipe</span></code>.</p></li>
378
+ <li><p><code class="docutils literal notranslate"><span class="pre">--tar</span></code>: download wheel packages online and tar them</p></li>
379
+ <li><p><code class="docutils literal notranslate"><span class="pre">--untar</span></code>: untar the wheel packages and install</p></li>
380
+ <li><p><code class="docutils literal notranslate"><span class="pre">--python</span></code>: change the python executable (default is python3)</p></li>
381
+ <li><p><code class="docutils literal notranslate"><span class="pre">--no-jupyter</span></code>: do not install requirements for the jupyter notebook</p></li>
382
+ <li><p><code class="docutils literal notranslate"><span class="pre">--no-dask</span></code>: do not install requirements for Dask</p></li>
383
+ </ul>
384
+ <p>If <code class="docutils literal notranslate"><span class="pre">--tar</span></code> or <code class="docutils literal notranslate"><span class="pre">--untar</span></code> option wasn’t specified, the script will directly download the pip packages from the internet.</p>
385
+ <p><strong>Manual steps</strong></p>
386
+ <p>If you would rather install the dependencies manually, please follow the following steps:</p>
387
+ <ul>
388
+ <li><p>Create a virtual environment</p>
389
+ <p>We recommend creating a virtual environment to avoid installing packages directly into your system Python. The commands create the virtual environment in the current working directory.</p>
390
+ <p>See <a class="reference external" href="https://docs.python.org/3/library/venv.html">venv - python doc</a></p>
391
+ <p>To create a venv named recipe_env:</p>
392
+ <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>$ python3 -m venv recipe_env
393
+ $ source recipe_env/bin/activate
394
+ </pre></div>
395
+ </div>
396
+ </li>
397
+ <li><p>List of dependencies</p>
398
+ <p>We have three files located in <code class="docutils literal notranslate"><span class="pre">&lt;install-dir&gt;/target-linux-x64/python/packages/nsys_recipe/requirements</span></code> for the dependencies:</p>
399
+ <ul class="simple">
400
+ <li><p>Common.txt (required): dependencies needed by all recipes</p></li>
401
+ <li><p>Dask.txt (optional): dependencies needed by the Dask mode</p></li>
402
+ <li><p>Jupyter.txt (optional): dependencies needed to open the Jupyter notebook</p></li>
403
+ </ul>
404
+ </li>
405
+ </ul>
406
+ <p><strong>One-step installation</strong></p>
407
+ <p>The following command will install all dependencies for CLI and GUI. Please note that you will want to activate your venv first as described above, otherwise the modules will not be available in the venv.</p>
408
+ <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>$ python3 -m pip install -r nsys_recipe/requirements/dask.txt -r nsys_recipe/requirements/common.txt -r nsys_recipe/requirements/jupyter.txt
409
+ </pre></div>
410
+ </div>
411
+ <p><strong>Two-step installation (for machines without internet)</strong></p>
412
+ <p>If you wish to download the dependencies on a machine without internet, you can download the wheel packages on a machine with internet, transfer them to the target machine and install the packages there.</p>
413
+ <p>On the machine with internet:</p>
414
+ <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>$ python3 -m pip download -r nsys_recipe/requirements/dask.txt -r nsys_recipe/requirements/common.txt -r nsys_recipe/requirements/jupyter.txt -d “recipe-deps”
415
+ $ tar -cvfz recipe-deps.tar.gz recipe-deps
416
+ </pre></div>
417
+ </div>
418
+ <p>On the machine with no internet:</p>
419
+ <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>$ tar -xvfz recipe-deps.tar.gz
420
+ $ python3 -m pip install recipe-deps/* --no-index
421
+ </pre></div>
422
+ </div>
423
+ <p><strong>Jupyter Notebook</strong></p>
424
+ <p>The Nsight Systems UI has the ability to internally load a Jupyter notebook. It uses the Jupyter notebook installation associated with the Python on your $PATH, which is expected to be the Python installed into the virtual environment created in the earlier steps of this guide.</p>
425
+ <p>If Jupyter is installed in a different location, you can add a third variable to the config.ini file that will override the default path to Jupyter:</p>
426
+ <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>JupyterPythonExe=“/path/to/recipe_env/bin/python”
427
+ </pre></div>
428
+ </div>
429
+ <p>This config.ini file should be placed in <code class="docutils literal notranslate"><span class="pre">&lt;install_dir&gt;/host-linux-x64</span></code></p>
430
+ <p>Note that on Windows, the path should use Windows slashes and they must be double slashes:</p>
431
+ <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>JupyterPythonExe=“c:\\path\\to\\recipe_env\\bin\\python.exe”
432
+ </pre></div>
433
+ </div>
434
+ </section>
435
+ </section>
436
+ </section>
437
+
438
+
439
+ </div>
440
+ </div>
441
+ <footer>
442
+
443
+ <hr/>
444
+
445
+ <div role="contentinfo">
446
+ <p>&#169; Copyright 2018-2023, NVIDIA Corporation &amp; Affiliates. All rights reserved.
447
+ <span class="lastupdated">Last updated on Dec 20, 2023.
448
+ </span></p>
449
+ </div>
450
+
451
+
452
+
453
+ </footer>
454
+ </div>
455
+ </div>
456
+ </section>
457
+ </div>
458
+ <script>
459
+ jQuery(function () {
460
+ SphinxRtdTheme.Navigation.enable(true);
461
+ });
462
+ </script>
463
+
464
+
465
+
466
+
467
+ </body>
468
+ </html>
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/documentation/ReleaseNotes/index.html ADDED
@@ -0,0 +1,336 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html class="writer-html5" lang="en" >
3
+ <head>
4
+ <meta charset="utf-8" /><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
5
+
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>Release Notes &mdash; nsight-systems 2023.4 documentation</title>
8
+ <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
9
+ <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
10
+ <link rel="stylesheet" href="../_static/design-style.b7bb847fb20b106c3d81b95245e65545.min.css" type="text/css" />
11
+ <link rel="stylesheet" href="../_static/omni-style.css" type="text/css" />
12
+ <link rel="stylesheet" href="../_static/api-styles.css" type="text/css" />
13
+ <link rel="shortcut icon" href="../_static/favicon.ico"/>
14
+ <!--[if lt IE 9]>
15
+ <script src="../_static/js/html5shiv.min.js"></script>
16
+ <![endif]-->
17
+
18
+ <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
19
+ <script src="../_static/jquery.js"></script>
20
+ <script src="../_static/underscore.js"></script>
21
+ <script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
22
+ <script src="../_static/doctools.js"></script>
23
+ <script src="../_static/sphinx_highlight.js"></script>
24
+ <script src="../_static/mermaid-init.js"></script>
25
+ <script src="../_static/design-tabs.js"></script>
26
+ <script src="../_static/version.js"></script>
27
+ <script src="../_static/social-media.js"></script>
28
+ <script src="../_static/js/theme.js"></script>
29
+ <link rel="index" title="Index" href="../genindex.html" />
30
+ <link rel="search" title="Search" href="../search.html" />
31
+ <link rel="next" title="Installation Guide" href="../InstallationGuide/index.html" />
32
+ <link rel="prev" title="Nsight Systems" href="../index.html" />
33
+
34
+
35
+
36
+ </head>
37
+
38
+ <body class="wy-body-for-nav">
39
+ <div class="wy-grid-for-nav">
40
+ <nav data-toggle="wy-nav-shift" class="wy-nav-side">
41
+ <div class="wy-side-scroll">
42
+ <div class="wy-side-nav-search" >
43
+
44
+
45
+ <a href="../index.html">
46
+ <img src="../_static/devzone.png" class="logo" alt="Logo"/>
47
+ </a>
48
+
49
+ <div role="search">
50
+ <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
51
+ <input type="text" name="q" placeholder="Search docs" />
52
+ <input type="hidden" name="check_keywords" value="yes" />
53
+ <input type="hidden" name="area" value="default" />
54
+ </form>
55
+ </div>
56
+ </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
57
+ <ul class="current">
58
+ <li class="toctree-l1 current"><a class="current reference internal" href="#">Release Notes</a><ul>
59
+ <li class="toctree-l2"><a class="reference internal" href="#what-s-new">What’s New</a></li>
60
+ <li class="toctree-l2"><a class="reference internal" href="#known-issues">Known Issues</a><ul>
61
+ <li class="toctree-l3"><a class="reference internal" href="#general-issues">General Issues</a></li>
62
+ <li class="toctree-l3"><a class="reference internal" href="#vgpu-issues">vGPU Issues</a></li>
63
+ <li class="toctree-l3"><a class="reference internal" href="#docker-issues">Docker Issues</a></li>
64
+ <li class="toctree-l3"><a class="reference internal" href="#cuda-trace-issues">CUDA Trace Issues</a></li>
65
+ <li class="toctree-l3"><a class="reference internal" href="#multi-report-analysis-issues">Multi Report Analysis Issues</a></li>
66
+ </ul>
67
+ </li>
68
+ </ul>
69
+ </li>
70
+ <li class="toctree-l1"><a class="reference internal" href="../InstallationGuide/index.html">Installation Guide</a></li>
71
+ <li class="toctree-l1"><a class="reference internal" href="../UserGuide/index.html">User Guide</a></li>
72
+ <li class="toctree-l1"><a class="reference internal" href="../CopyrightAndLicenses/index.html">Copyright and Licenses</a></li>
73
+ </ul>
74
+ <p class="caption" role="heading"><span class="caption-text">Archives</span></p>
75
+ <ul>
76
+ <li class="toctree-l1"><a class="reference internal" href="../Archives/index.html">Archives</a></li>
77
+ </ul>
78
+
79
+ </div>
80
+ </div>
81
+ </nav>
82
+
83
+ <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
84
+ <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
85
+ <a href="../index.html">nsight-systems</a>
86
+ </nav>
87
+
88
+ <div class="wy-nav-content">
89
+ <div class="rst-content">
90
+ <div role="navigation" aria-label="Page navigation">
91
+ <ul class="wy-breadcrumbs">
92
+
93
+
94
+ <li><a href="../index.html" class="icon icon-home"></a> &raquo;</li>
95
+ <li>Release Notes</li>
96
+
97
+ <li class="wy-breadcrumbs-aside">
98
+ </li>
99
+ <li class="wy-breadcrumbs-aside">
100
+
101
+
102
+ <span>v2023.4 |</span>
103
+
104
+
105
+
106
+ <a href="https://developer.nvidia.com/nsight-systems/" class="reference external">Archive</a>
107
+
108
+
109
+ <span>&nbsp;</span>
110
+ </li>
111
+
112
+ </ul>
113
+ <hr/>
114
+ </div>
115
+ <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
116
+ <div itemprop="articleBody">
117
+
118
+ <section id="release-notes">
119
+ <h1>Release Notes<a class="headerlink" href="#release-notes" title="Permalink to this heading"></a></h1>
120
+ <p>Release notes and known issues.</p>
121
+ <section id="what-s-new">
122
+ <h2>What’s New<a class="headerlink" href="#what-s-new" title="Permalink to this heading"></a></h2>
123
+ <ul class="simple">
124
+ <li><p>Additional MPI communicator creation APIs</p></li>
125
+ <li><p>Option to trace the Python Global Interpretter Lock (GIL)</p></li>
126
+ <li><p>Unified Memory CPU and GPU page fault information now available for Arm</p></li>
127
+ <li><p>BETA: NVIDIA Infiniband switch congestion events (requires Quantum2 and
128
+ firmware version 31.2012.1068 or higher)</p></li>
129
+ <li><p>Multi-node analysis now supports Mac, Windows x64, Linux Arm Servers</p></li>
130
+ <li><p>Recipe enhancements for NCCL, heatmaps, differencing</p></li>
131
+ <li><p>CLI improvements - Add option <code class="docutils literal notranslate"><span class="pre">-n</span></code> to <code class="docutils literal notranslate"><span class="pre">nsys</span> <span class="pre">status</span></code> command to provide
132
+ information about availability of network counters in the users environment.</p></li>
133
+ <li><p>NVIDIA Grace PMU uncore counter sampling</p></li>
134
+ <li><p>Windows GPU resource trace enhancements for allocations, migrations,
135
+ Direct3D, &amp; Vulkan</p></li>
136
+ <li><p>UX and performance improvements</p></li>
137
+ </ul>
138
+ </section>
139
+ <section id="known-issues">
140
+ <h2>Known Issues<a class="headerlink" href="#known-issues" title="Permalink to this heading"></a></h2>
141
+ <section id="general-issues">
142
+ <h3>General Issues<a class="headerlink" href="#general-issues" title="Permalink to this heading"></a></h3>
143
+ <ul>
144
+ <li><p>The current release of Nsight Systems CLI doesn’t support naming a session
145
+ with a name longer than 127 characters. Profiling an executable with a name
146
+ exceeding 111 characters is also unsupported by the <code class="docutils literal notranslate"><span class="pre">nsys</span> <span class="pre">profile</span></code> command.
147
+ Those limitations will be removed in a future version of the CLI.</p></li>
148
+ <li><p>Nsight Systems 2020.4 introduces collection of thread scheduling information
149
+ without full sampling. While this allows system information at a lower cost,
150
+ it does add overhead. To turn off thread schedule information collection, add
151
+ <code class="docutils literal notranslate"><span class="pre">--cpuctxsw=none</span></code> to your command line or turn off in the GUI.</p></li>
152
+ <li><p>Profiling greater than 5 minutes is not officially supported at this time.
153
+ Profiling high activity applications, on high performance machines, over a
154
+ long analysis time can create large result files that may take a very long
155
+ time to load, run out of memory, or lock up the system. If you have a complex
156
+ application, we recommend starting with a short profiling session duration of
157
+ no more than 5 minutes for your initial profile. If your application has a
158
+ natural repeating pattern, often referred to as a frame, you may typically
159
+ only need a few of these. This suggested limit will increase in future
160
+ releases.</p></li>
161
+ <li><p>Attaching or re-attaching to a process from the GUI is not supported with the
162
+ x86_64 Linux or IBM Power target. Equivalent results can be obtained by using
163
+ the interactive CLI to launch the process and then starting and stopping
164
+ analysis at multiple points.</p></li>
165
+ <li><p>To reduce overhead, Nsight Systems traces a subset of API calls likely to
166
+ impact performance when tracing APIs rather than all possible calls. There
167
+ is currently no way to change the subset being traced when using the CLI.
168
+ See respective library portion of this documentation for a list of calls
169
+ traced by default. The CLI limitation will be removed in a future version of
170
+ the product.</p></li>
171
+ <li><p>There is an upper bound on the default size used by the tool to record trace
172
+ events during the collection. If you see the following diagnostic error, then
173
+ Nsight Systems hit the upper limit.</p>
174
+ <div class="highlight-c++ notranslate"><div class="highlight"><pre><span></span><span class="n">Reached</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="n">size</span><span class="w"> </span><span class="n">limit</span><span class="w"> </span><span class="n">on</span><span class="w"> </span><span class="n">recording</span><span class="w"> </span><span class="n">trace</span><span class="w"> </span><span class="n">events</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="k">this</span><span class="w"> </span><span class="n">process</span><span class="p">.</span><span class="w"></span>
175
+ <span class="w"> </span><span class="n">Try</span><span class="w"> </span><span class="n">reducing</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="n">profiling</span><span class="w"> </span><span class="n">duration</span><span class="w"> </span><span class="n">or</span><span class="w"> </span><span class="n">reduce</span><span class="w"> </span><span class="n">the</span><span class="w"> </span><span class="n">number</span><span class="w"> </span><span class="n">of</span><span class="w"> </span><span class="n">features</span><span class="w"></span>
176
+ <span class="w"> </span><span class="n">traced</span><span class="p">.</span><span class="w"></span>
177
+ </pre></div>
178
+ </div>
179
+ </li>
180
+ <li><p>When profiling a framework or application that uses CUPTI, like some versions
181
+ of TensorFlow(tm), Nsight Systems will not be able to trace CUDA usage due to
182
+ limitations in CUPTI. These limitations will be corrected in a future version
183
+ of CUPTI. Consider turning off the application’s use of CUPTI if CUDA tracing
184
+ is required.</p></li>
185
+ <li><p>Tracing an application that uses a memory allocator that is not thread-safe
186
+ is not supported.</p></li>
187
+ <li><p>Tracing OS Runtime libraries in an application that preloads glibc symbols is
188
+ unsupported and can lead to undefined behavior.</p></li>
189
+ <li><p>Nsight Systems cannot profile applications launched through a virtual window
190
+ manager like GNU Screen.</p></li>
191
+ <li><p>Using Nsight Systems MPI trace functionality with the Darshan runtime module
192
+ can lead to segfaults. To resolve the issue, unload the module.</p></li>
193
+ </ul>
194
+ <div class="highlight-c++ notranslate"><div class="highlight"><pre><span></span><span class="k">module</span><span class="w"> </span><span class="n">unload</span><span class="w"> </span><span class="n">darshan</span><span class="o">-</span><span class="n">runtime</span><span class="w"></span>
195
+ </pre></div>
196
+ </div>
197
+ <ul class="simple">
198
+ <li><p>Profiling MPI Fortran APIs with MPI_Status as an argument, e.g. MPI_Recv,
199
+ MPI_Test[all], MPI_Wait[all], can potentially cause memory corruption for
200
+ MPICH versions 3.0.x. The reason is that the MPI_Status structure in MPICH
201
+ 3.0.x has a different memory layout than in other MPICH versions
202
+ (2.1.x and &gt;=3.1.x have been tested) and the version (3.3.2) we used to
203
+ compile the Nsight Systems MPI interception library.</p></li>
204
+ <li><p>Using <code class="docutils literal notranslate"><span class="pre">nsys</span> <span class="pre">export</span></code> to export to an SQLite database will fail if the
205
+ destination filesystem doesn’t support file locking. The error message will
206
+ mention:</p></li>
207
+ </ul>
208
+ <div class="highlight-c++ notranslate"><div class="highlight"><pre><span></span><span class="n">std</span><span class="o">::</span><span class="n">exception</span><span class="o">::</span><span class="n">what</span><span class="o">:</span><span class="w"> </span><span class="n">database</span><span class="w"> </span><span class="n">is</span><span class="w"> </span><span class="n">locked</span><span class="w"></span>
209
+ </pre></div>
210
+ </div>
211
+ <ul>
212
+ <li><p>On some Linux systems when VNC is used, some widgets can be rendered
213
+ incorrectly, or Nsight Systems can crash when opening Analysis Summary or
214
+ Diagnostics Summary pages. In this case, try forcing a specific software
215
+ renderer: <code class="docutils literal notranslate"><span class="pre">GALLIUM_DRIVER=llvmpipe</span> <span class="pre">nsys-ui</span></code></p></li>
216
+ <li><p>Due to <a class="reference external" href="https://github.com/open-mpi/ompi/issues/6648">a known bug in Open MPI 4.0.1</a>, target application may
217
+ crash at the end of execution when being profiled by Nsight Systems. To avoid
218
+ the issue, use a different Open MPI version, or add <code class="docutils literal notranslate"><span class="pre">--mca</span> <span class="pre">btl</span> <span class="pre">^vader</span></code>
219
+ option to <code class="docutils literal notranslate"><span class="pre">mpirun</span></code> command line.</p></li>
220
+ <li><p>The multiprocessing module in Python is commonly used by customers to create
221
+ new processes. On Linux, the module defaults to using the “fork” mode where
222
+ it forks new processes, but does not call exec. According to the POSIX
223
+ standard, fork without exec leads to undefined behavior and tools like
224
+ Nsight Systems that rely on injection are only allowed to make
225
+ async-signal-safe calls in such a process. This makes it very hard for tools
226
+ like Nsight Systems to collect profiling information. See
227
+ <a class="reference external" href="https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods">https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods</a></p>
228
+ <p>Use the set_start_method in the multiprocessing module to change the start
229
+ method to “spawn” which is much safer and allows tools like Nsight Systems to
230
+ collect data. See the code example given in the link above.</p>
231
+ <p>The user needs to ensure that processes exit gracefully (by using close and
232
+ join methods, for example, in the multiprocessing module’s objects).
233
+ Otherwise, Nsight Systems cannot flush buffers properly and you might end up
234
+ with missing traces.</p>
235
+ </li>
236
+ <li><p>When the CLI sequence launch, start, stop is used to profile a process-tree,
237
+ LinuxPerf does a depth first search (DFS) to find all of the threads launched
238
+ by the process-tree before programming the OS to collect the data. If, during
239
+ the DFS, one or more threads are created by the process tree, it is possible
240
+ those threads won’t be found and LinuxPerf would not collect data for them.</p>
241
+ <p>Note that once a thread is programmed via perf_event_open, any subsequent
242
+ children processes or threads generated by that thread will be tracked since
243
+ the perf_event_open inherit bit is set.</p>
244
+ <p>No other CLI command sequence suffers from this possible issue. Also, if a
245
+ systemwide mode is used, the issue does not exist.</p>
246
+ </li>
247
+ </ul>
248
+ </section>
249
+ <section id="vgpu-issues">
250
+ <span id="id1"></span><h3>vGPU Issues<a class="headerlink" href="#vgpu-issues" title="Permalink to this heading"></a></h3>
251
+ <ul class="simple">
252
+ <li><p>When running Nsight Systems on vGPU you should always use the profiler grant. See <a class="reference external" href="https://docs.nvidia.com/grid/latest/grid-vgpu-user-guide/index.html#enabling-cuda-toolkit-profilers-vgpu">Virtual GPU Software Documentation</a> for details on enabling NVIDIA CUDA Toolkit profilers for NVIDIA vGPUs. Without the grant, unexpected migrations may crash a running session, report an error and abort. It may also silently produce a corrupted report which may be unloadable or show inaccurate data with no warning.</p></li>
253
+ <li><p>Starting with vGPU 13.0, device level metrics collection is exposed to end users even on vGPU. Device level metrics will give info about all the work being executed on the GPU. The work might be in the same VM or some other VM running on the same physical GPU.</p></li>
254
+ <li><p>As of CUDA 11.4 and R470 TRD1 driver release, Nsight Systems is supported in a vGPU environment which requires a vGPU license. If the license is not obtained after 20 minutes, the tool will still work but the reported GPU performance metrics data will be inaccurate. This is because of a feature in vGPU environment which reduces performance but retains functionality as specified in <a class="reference external" href="https://docs.nvidia.com/grid/latest/grid-licensing-user-guide/index.html#software-enforcement-grid-licensing">Grid Licensing User Guide</a>.</p></li>
255
+ </ul>
256
+ </section>
257
+ <section id="docker-issues">
258
+ <h3>Docker Issues<a class="headerlink" href="#docker-issues" title="Permalink to this heading"></a></h3>
259
+ <ul class="simple">
260
+ <li><p>In a Docker, when a system’s host utilizes a kernel older than v4.3, it is not possible for Nsight Systems to collect sampling data unless both the host and Docker are running a RHEL or CentOS operating system utilizing kernel version 3.10.1-693 or newer. A user override for this will be made available in a future version.</p></li>
261
+ <li><p>When <code class="docutils literal notranslate"><span class="pre">docker</span> <span class="pre">exec</span></code> is called on a running container and stdout is kept open from a command invoked inside that shell, the exec shell hangs until the command exits. You can avoid this issue by running with <code class="docutils literal notranslate"><span class="pre">docker</span> <span class="pre">exec</span> <span class="pre">--tty</span></code>. See the bug reports at:</p></li>
262
+ <li><p><a class="reference external" href="https://github.com/moby/moby/issues/33039">https://github.com/moby/moby/issues/33039</a></p></li>
263
+ <li><p><a class="reference external" href="https://github.com/drud/ddev/issues/732">https://github.com/drud/ddev/issues/732</a></p></li>
264
+ </ul>
265
+ </section>
266
+ <section id="cuda-trace-issues">
267
+ <h3>CUDA Trace Issues<a class="headerlink" href="#cuda-trace-issues" title="Permalink to this heading"></a></h3>
268
+ <ul>
269
+ <li><p>When using CUDA Toolkit 10.X, tracing of DtoD memory copy operations may result in a crash. To avoid this issue, update CUDA Toolkit to 11.X or the latest version.</p></li>
270
+ <li><p>Nsight Systems will not trace kernels when a CDP (CUDA Dynamic Parallelism) kernel is found in a target application on Volta devices or later.</p></li>
271
+ <li><p>On Tegra platforms, CUDA trace requires root privileges. Use the <strong>Launch as root</strong> checkbox in project settings to make the profiled application run as root.</p></li>
272
+ <li><p>If the target application uses multiple streams from multiple threads, CUDA event buffers may not be released properly. In this case, you will see the following diagnostic error:</p>
273
+ <div class="highlight-text notranslate"><div class="highlight"><pre><span></span>Couldn&#39;t allocate CUPTI bufer x times. Some CUPTI events may
274
+ be missing.
275
+ </pre></div>
276
+ </div>
277
+ <p>Please contact the Nsight Systems team.</p>
278
+ </li>
279
+ <li><p>In this version of Nsight Systems, if you are starting and stopping profiling inside your application using the interactive CLI, the CUDA memory allocation graph generation is only guaranteed to be correct in the first profiling range. This limitation will be removed in a future version of the product.</p></li>
280
+ <li><p>CUDA GPU trace collection requires a fraction of GPU memory. If your application utilizes all available GPU memory, CUDA trace might not work or can break your application. As an example cuDNN application can crash with <code class="docutils literal notranslate"><span class="pre">CUDNN_STATUS_INTERNAL_ERROR</span></code> error if GPU memory allocation fails.</p></li>
281
+ <li><p>For older Linux kernels, prior to 4.4, when profiling very short-lived applications (~1 second) that exit in the middle of the profiling session, it is possible that Nsight Systems will not show the CUDA events on the timeline.</p></li>
282
+ <li><p>When more than 64k serialized CUDA kernels and memory copies are executed in the application, you may encounter the following exception during profiling:</p>
283
+ <div class="highlight-c++ notranslate"><div class="highlight"><pre><span></span><span class="nl">InvalidArgumentException</span><span class="p">:</span><span class="w"> </span><span class="s">&quot;Wrong event order detected&quot;</span><span class="w"></span>
284
+ </pre></div>
285
+ </div>
286
+ <p>Please upgrade to the CUDA 9.2 driver at minimum to avoid this problem. If you cannot upgrade, you can get a partial analysis, missing potentially a large fraction of CUDA events, by using the CLI.</p>
287
+ </li>
288
+ <li><p>On Vibrante, when running a profiling session with multiple targets that are guest VMs in a CCC configuration behind a NAT, you may encounter an error with the following text during profiling:</p>
289
+ <div class="highlight-c++ notranslate"><div class="highlight"><pre><span></span><span class="n">Failed</span><span class="w"> </span><span class="n">to</span><span class="w"> </span><span class="n">sync</span><span class="w"> </span><span class="n">time</span><span class="w"> </span><span class="n">on</span><span class="w"> </span><span class="n">device</span><span class="p">.</span><span class="w"></span>
290
+ </pre></div>
291
+ </div>
292
+ <p>Please edit the group connection settings, select <strong>Targets on the same SoC</strong> checkbox there and try again.</p>
293
+ </li>
294
+ <li><p>When using the 455 driver, as shipped with CUDA Tool Kit 11.1, and tracing CUDA with Nsight Systems you many encounter a crash when the application exits. To avoid this issue, end your profiling session before the application exits or update your driver.</p></li>
295
+ </ul>
296
+ </section>
297
+ <section id="multi-report-analysis-issues">
298
+ <h3>Multi Report Analysis Issues<a class="headerlink" href="#multi-report-analysis-issues" title="Permalink to this heading"></a></h3>
299
+ <ul class="simple">
300
+ <li><p>Be aware that setting up Dask analysis on your workstation requires some additional work on the system. For small data inputs, running the recipes without Dask may be faster.</p></li>
301
+ </ul>
302
+ </section>
303
+ </section>
304
+ </section>
305
+
306
+
307
+ </div>
308
+ </div>
309
+ <footer>
310
+
311
+ <hr/>
312
+
313
+ <div role="contentinfo">
314
+ <p>&#169; Copyright 2018-2023, NVIDIA Corporation &amp; Affiliates. All rights reserved.
315
+ <span class="lastupdated">Last updated on Dec 20, 2023.
316
+ </span></p>
317
+ </div>
318
+
319
+
320
+
321
+ </footer>
322
+ </div>
323
+ </div>
324
+ </section>
325
+ </div>
326
+ <script>
327
+ jQuery(function () {
328
+ SphinxRtdTheme.Navigation.enable(true);
329
+ });
330
+ </script>
331
+
332
+
333
+
334
+
335
+ </body>
336
+ </html>
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/documentation/UserGuide/index.html ADDED
The diff for this file is too large to render. See raw diff
 
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/Plugins/CorePlugin/Manifest.js ADDED
@@ -0,0 +1,743 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // CorePlugin: Provides most of the common Agora UI elements.
2
+ // Prefer adding shared UI code to this plugin instead of the AppLib static library.
3
+ AppLib.logInfo("Loading CorePlugin");
4
+
5
+ // ----------------------------------------------------------------------------
6
+ // Important: These states need to match the ones defined in CoreStates.h.
7
+ // ----------------------------------------------------------------------------
8
+ var states = {
9
+ IsConnected: "$$.IsConnected",
10
+ IsDebugBuild: "$$.IsDebugBuild",
11
+ IsExportLevelInternal: "$$.IsExportLevelInternal",
12
+ IsExportLevelNDA: "$$.IsExportLevelNDA",
13
+ InActivity: "$$.InActivity",
14
+ IsLayoutManagementAvailable: "$$.IsLayoutManagementAvailable",
15
+ IsLayoutManagementSupported: "$$.IsLayoutManagementSupported",
16
+ IsOpenRemoteFileSupported: "$$.IsOpenRemoteFileSupported",
17
+ HasMixedDPIScalingHandling: "$$.HasMixedDPIScalingHandling",
18
+ HasOpenWindows: "$$.HasOpenWindows",
19
+ HasSamples: "$$.HasSamples",
20
+ };
21
+
22
+ addPlugin({
23
+ pluginDependencies: [],
24
+ pluginLibrary: "CorePlugin", // Library suffix (.so, .dll) appended automatically
25
+ pluginAvailableInCli: true,
26
+
27
+ hostApplication: {
28
+ defaultTheme: "Light",
29
+ },
30
+
31
+ commandLineOptions: {
32
+ "$$.SharedInstance": {
33
+ name: "shared-instance",
34
+ valueName: "shared-instance",
35
+ description: "Use a shared instance of the application. If a shared instance does not already exist, it will be created. Supported values are 1|0, true|false, on|off, yes|no.",
36
+ },
37
+ "$$.SharedInstanceKey": {
38
+ name: "shared-instance-key",
39
+ valueName: "shared-instance-key",
40
+ description: "When using a shared instance, this parameter provides a key for which shared instance to use.",
41
+ },
42
+ "$$.NoSplash": {
43
+ name: "no-splash",
44
+ description: "Suppresses the splash screen on startup",
45
+ },
46
+ "$$.Automated": {
47
+ name: "automated",
48
+ description: "Run in automated mode; either for tested or target initiated runs",
49
+ hiddenFromHelp: true,
50
+ },
51
+ "$$.SecondaryInstanceWorkingDirectory": {
52
+ name: "secondary-instance-working-directory",
53
+ valueName: "secondary-instance-working-directory",
54
+ description: "The current directory from which a secondary instance of application started.",
55
+ hiddenFromHelp: true,
56
+ },
57
+ },
58
+
59
+ toolWindows: {
60
+ "$$.LogWindow": {
61
+ text: qsTr("Output Messages"),
62
+ layout: "dockSouth",
63
+ persistable: true,
64
+ commandBars: {
65
+ "$$.LogWindowToolbar": { order: 1000 }
66
+ },
67
+ properties: {
68
+ columns: {
69
+ "ID": { visible: true },
70
+ "Type": { visible: true },
71
+ "Origin": { visible: true },
72
+ "Source": { visible: true },
73
+ "Message": { visible: true },
74
+ },
75
+ },
76
+ },
77
+
78
+ "$$.ProjectExplorer": {
79
+ text: qsTr("Project Explorer"),
80
+ layout: "dockWest",
81
+ persistable: true,
82
+ defaultWidth: 10,
83
+ },
84
+
85
+ "$$.DocumentsWindow": {
86
+ text: qsTr("Documents"),
87
+ sizeMode: "percent",
88
+ defaultHeight: 50,
89
+ defaultWidth: 50,
90
+ isFixed: true,
91
+ preservesContents: true,
92
+ persistable: true,
93
+ layout: "dockEast",
94
+ },
95
+
96
+ "$$.SecondaryDocumentsWindow": {
97
+ text: qsTr("Documents"),
98
+ sizeMode: "percent",
99
+ defaultHeight: 50,
100
+ defaultWidth: 50,
101
+ isFixed: true,
102
+ preservesContents: true,
103
+ persistable: true,
104
+ layout: "floating",
105
+ },
106
+ },
107
+
108
+ documents: {
109
+ fileTypes: {
110
+ "welcome": {
111
+ icon: "",
112
+ factoryName: "WelcomeDocumentFactory",
113
+ viewFactories: [
114
+ { factoryName: "WelcomeDocumentViewFactory", priority: 50 }
115
+ ]
116
+ },
117
+ }
118
+ },
119
+
120
+ documentWells: {
121
+ main: {
122
+ closeWhenEmpty: false
123
+ },
124
+
125
+ secondary: {
126
+ // Not needed for now, but if needed later config could go here.
127
+ },
128
+ },
129
+
130
+ commands: {
131
+
132
+ // Project commands
133
+ "$$.NewProject": {
134
+ visibleWithFlags: ["CorePlugin.HasProjectService"],
135
+ text: qsTr("New Project..."),
136
+ importance: "high",
137
+ },
138
+ "$$.OpenProject": {
139
+ visibleWithFlags: ["CorePlugin.HasProjectService"],
140
+ text: qsTr("Open Project..."),
141
+ imageFontIcon: "fa-folder-open",
142
+ importance: "high",
143
+ },
144
+ "$$.SaveProject": {
145
+ visibleWithFlags: ["CorePlugin.HasProjectService"],
146
+ text: qsTr("Save Project"),
147
+ imageFontIcon: "fa-save",
148
+ importance: "high",
149
+ },
150
+ "$$.SaveProjectAs": {
151
+ visibleWithFlags: ["CorePlugin.HasProjectService"],
152
+ text: qsTr("Save Project As..."),
153
+ importance: "high",
154
+ },
155
+ "$$.CloseProject": {
156
+ visibleWithFlags: ["CorePlugin.HasProjectService"],
157
+ text: qsTr("Close Project"),
158
+ importance: "high",
159
+ },
160
+ "$$.RecentProjects": {
161
+ visibleWithFlags: ["CorePlugin.HasProjectService", "CorePlugin.HasRecentFileService"],
162
+ requiresFlags: [not(states.InActivity)],
163
+ text: qsTr("Recent Projects"),
164
+ },
165
+
166
+ // Document commands
167
+ "$$.NewFile": {
168
+ text: qsTr("&New File..."),
169
+ shortcut: codeTr("Ctrl+N"),
170
+ importance: "high"
171
+ },
172
+ "$$.OpenFile": {
173
+ text: qsTr("&Open File..."),
174
+ imageFontIcon: "fa-folder-open",
175
+ shortcut: codeTr("Ctrl+O"),
176
+ importance: "high"
177
+ },
178
+ "$$.OpenRemoteFile": {
179
+ text: qsTr("Open &Remote File..."),
180
+ shortcut: codeTr("Ctrl+Shift+O"),
181
+ visibleWithFlags: [states.IsOpenRemoteFileSupported],
182
+ importance: "high"
183
+ },
184
+ "$$.SaveFile": {
185
+ text: qsTr("&Save File"),
186
+ imageFontIcon: "fa-save",
187
+ shortcut: codeTr("Ctrl+S"),
188
+ importance: "high"
189
+ },
190
+ "$$.SaveFileAs": {
191
+ text: qsTr("Save File &As..."),
192
+ importance: "high"
193
+ },
194
+ "$$.SaveAllFiles": {
195
+ text: qsTr("Save A&ll Files"),
196
+ shortcut: codeTr("Ctrl+Shift+S"),
197
+ importance: "high"
198
+ },
199
+ "$$.CloseFile": {
200
+ text: qsTr("&Close File"),
201
+ shortcut: codeTr("Ctrl+W"),
202
+ importance: "high"
203
+ },
204
+ "$$.CloseAllFiles": {
205
+ text: qsTr("Close All Files"),
206
+ importance: "high"
207
+ },
208
+ "$$.RecentFiles": {
209
+ visibleWithFlags: ["CorePlugin.HasRecentFileService"],
210
+ text: qsTr("Recent Files"),
211
+ },
212
+
213
+ // General file commands
214
+ "$$.ExitCommand": {
215
+ text: qsTr("E&xit"),
216
+ imageFontIcon: "fa-times-circle",
217
+ shortcut: codeTr("Ctrl+Q"),
218
+ },
219
+
220
+ // Window commands
221
+ "$$.SaveWindowLayout": {
222
+ text: qsTr("Save Window Layout..."),
223
+ requiresFlags: [states.IsLayoutManagementSupported],
224
+ visibleWithFlags: [states.IsLayoutManagementAvailable],
225
+ },
226
+ "$$.ApplyWindowLayout": {
227
+ text: qsTr("Apply Window Layout"),
228
+ requiresFlags: [states.IsLayoutManagementSupported],
229
+ visibleWithFlags: [states.IsLayoutManagementAvailable],
230
+ },
231
+ "$$.ManageWindowLayouts": {
232
+ text: qsTr("Manage Window Layouts..."),
233
+ requiresFlags: [states.IsLayoutManagementSupported],
234
+ visibleWithFlags: [states.IsLayoutManagementAvailable],
235
+ },
236
+ "$$.RestoreDefaultLayout": {
237
+ text: qsTr("Restore Default Layout"),
238
+ },
239
+ "$$.ChooseWindow": {
240
+ text: qsTr("Windows..."),
241
+ shortcut: codeTr("Ctrl+Shift+W"),
242
+ requiresFlags: [states.HasOpenWindows],
243
+ },
244
+
245
+ // Connection commands
246
+ // DEPRECATED: Prefer TPSConnectionPlugin
247
+ "$$.ConnectCommand": {
248
+ text: qsTr("&Connect..."),
249
+ imageFontIcon: "fa-sign-in-alt",
250
+ importance: "high",
251
+ requiresFlags: [not(states.IsConnected)],
252
+ shortcut: codeTr("Ctrl+Shift+C"),
253
+ },
254
+ "$$.DisconnectCommand": {
255
+ text: qsTr("&Disconnect"),
256
+ imageFontIcon: "fa-sign-out-alt",
257
+ importance: "high",
258
+ requiresFlags: [states.IsConnected],
259
+ shortcut: codeTr("Ctrl+Shift+D"),
260
+ },
261
+
262
+ "$$.SettingsCommand": {
263
+ text: qsTr("&Options..."),
264
+ shortcut: codeTr("F7"),
265
+ },
266
+ "$$.ShowLogsCommand": {
267
+ text: qsTr("Output &Messages"),
268
+ },
269
+ "$$.ShowDocumentWell": {
270
+ text: qsTr("[Debug] Documents Well"),
271
+ visibleWithFlags: [states.IsDebugBuild],
272
+ },
273
+ "$$.ExportLogsCommand": {
274
+ text: qsTr("Export to CSV"),
275
+ imageFontIcon: "fa-save",
276
+ },
277
+ "$$.ClearLogsCommand": {
278
+ text: qsTr("Clear"),
279
+ imageFontIcon: "fa-trash",
280
+ importance: "high"
281
+ },
282
+ "$$.ShowInfoLogLevelCommand": {
283
+ text: qsTr("Show &Info Messages"),
284
+ image: codeTr(":/NV_UI/info.ico"),
285
+ checked: true
286
+ },
287
+ "$$.ShowWarningLogLevelCommand": {
288
+ text: qsTr("Show &Warning Messages"),
289
+ image: codeTr(":/NV_UI/warning.ico"),
290
+ checked: true
291
+ },
292
+ "$$.ShowErrorLogLevelCommand": {
293
+ text: qsTr("Show &Error Messages"),
294
+ image: codeTr(":/NV_UI/error.ico"),
295
+ checked: true
296
+ },
297
+ "$$.ShowFatalLogLevelCommand": {
298
+ text: qsTr("Show &Fatal Messages"),
299
+ image: codeTr(":/NV_UI/fatal.ico"),
300
+ checked: true
301
+ },
302
+ "$$.FilterLogSourceCommand": {
303
+ text: qsTr("Filter &Sources:"),
304
+ editable: true,
305
+ type: "list",
306
+ width: 30
307
+ },
308
+ "$$.SamplesCommand": {
309
+ visibleWithFlags: ["CorePlugin.HasProjectService", states.HasSamples],
310
+ requiresFlags: [not(states.InActivity)],
311
+ text: qsTr("Samples"),
312
+ },
313
+ "$$.CheckForUpdatesCommand": {
314
+ text: qsTr("&Check For Updates..."),
315
+ visibleWithFlags: ["CorePlugin.HasVersionUpdateService"],
316
+ },
317
+ "$$.AboutCommand": {
318
+ text: qsTr("&About..."),
319
+ menuRole: "about",
320
+ },
321
+ "$$.DocumentationCommand": {
322
+ text: qsTr("&Documentation..."),
323
+ },
324
+ "$$.FeedbackCommand": {
325
+ text: qsTr("Send Feedbac&k..."),
326
+ imageFontIcon: "fa-comment-alt",
327
+ },
328
+ "$$.SelectPreviousCommand": {
329
+ text: qsTr("Select &Previous"),
330
+ shortcut: codeTr("Ctrl+Left"),
331
+ },
332
+ "$$.SelectNextCommand": {
333
+ text: qsTr("Select &Next"),
334
+ shortcut: codeTr("Ctrl+Right"),
335
+ },
336
+ "$$.SelectFirstCommand": {
337
+ text: qsTr("Select &First"),
338
+ shortcut: codeTr("Ctrl+Home"),
339
+ },
340
+ "$$.SelectLastCommand": {
341
+ text: qsTr("Select &Last"),
342
+ shortcut: codeTr("Ctrl+End"),
343
+ },
344
+ "$$.ShowProjectExplorerCommand": {
345
+ visibleWithFlags: ["CorePlugin.HasProjectService"],
346
+ text: qsTr("Project Explorer"),
347
+ },
348
+ "$$.ResetAppDataCommand": {
349
+ text: qsTr("Reset Application Data..."),
350
+ },
351
+ "$$.ShowWelcomePage": {
352
+ text: qsTr("Show Welcome Page"),
353
+ visibleWithFlags: ["CorePlugin.HasProjectService"],
354
+ },
355
+ "$$.ConsoleLaunch": {
356
+ // Internal command, used when CorePlugin is ready in
357
+ // a console host.
358
+ },
359
+ },
360
+
361
+ commandGroups: {
362
+
363
+ // NOTE: Not a default group in the FileMenu
364
+ "$$.ProjectGroup": {
365
+ "$$.NewProject": { order: 100 },
366
+ "$$.OpenProject": { order: 110 },
367
+ "$$.RecentProjects": { order: 120 },
368
+ "$$.SaveProject": { order: 130 },
369
+ "$$.SaveProjectAs": { order: 140 },
370
+ "$$.CloseProject": { order: 150 },
371
+ },
372
+
373
+ // NOTE: Not a default group in the FileMenu
374
+ "$$.FileGroup": {
375
+ "$$.NewFile": { order: 100 },
376
+ "$$.OpenFile": { order: 110 },
377
+ "$$.OpenRemoteFile": { order: 120 },
378
+ "$$.SaveFile": { order: 130 },
379
+ "$$.SaveFileAs": { order: 140 },
380
+ "$$.SaveAllFiles": { order: 150 },
381
+ "$$.CloseFile": { order: 160 },
382
+ "$$.CloseAllFiles": { order: 170 },
383
+ "$$.RecentFiles": { order: 180 },
384
+ },
385
+
386
+ // NOTE: Battle & Rebel have their own product specific layout group (but should really use this)
387
+ "$$.LayoutGroup": {
388
+ "$$.SaveWindowLayout": { order: 100 },
389
+ "$$.ApplyWindowLayout": { order: 101 },
390
+ "$$.ManageWindowLayouts": { order: 102 },
391
+ "$$.RestoreDefaultLayout": { order: 103 },
392
+ "$$.ChooseWindow": { order: 104 },
393
+ },
394
+
395
+ "$$.WelcomeGroup": {
396
+ "$$.ShowWelcomePage": { order: 100 },
397
+ },
398
+
399
+ "$$.ExitGroup": {
400
+ "$$.ExitCommand": { order: 100 }
401
+ },
402
+ "$$.SettingsGroup": {
403
+ "$$.SettingsCommand": { order: 100 },
404
+ },
405
+ "$$.FileCloseGroup": {
406
+ "$$.CloseDocumentCommand": { order: 100 }
407
+ },
408
+ "$$.ConnectionGroup": {
409
+ "$$.ConnectCommand": { order: 100 },
410
+ "$$.DisconnectCommand": { order: 110 },
411
+ },
412
+ "$$.LogViewGroup": {
413
+ "$$.ShowLogsCommand": { order: 100 },
414
+ "$$.ShowDocumentWell": { order: 110 },
415
+ },
416
+ "$$.LogClearGroup": {
417
+ "$$.ExportLogsCommand": { order: 100 },
418
+ "$$.ClearLogsCommand": { order: 110 },
419
+ },
420
+ "$$.LogFilterGroup": {
421
+ "$$.ShowInfoLogLevelCommand": { order: 100 },
422
+ "$$.ShowWarningLogLevelCommand": { order: 110 },
423
+ "$$.ShowErrorLogLevelCommand": { order: 120 },
424
+ "$$.ShowFatalLogLevelCommand": { order: 130 },
425
+ },
426
+ "$$.LogSourceFilterGroup": {
427
+ "$$.FilterLogSourceCommand": { order: 100 }
428
+ },
429
+ "$$.DocumentationGroup": {
430
+ "$$.DocumentationCommand": { order: 100 },
431
+ "$$.SamplesCommand": { order: 110 },
432
+ "$$.CheckForUpdatesCommand": { order: 200 },
433
+ },
434
+ "$$.FeedbackGroup": {
435
+ "$$.FeedbackCommand": { order: 100 },
436
+ },
437
+ "$$.AboutGroup": {
438
+ "$$.AboutCommand": { order: 100 },
439
+ },
440
+ "$$.ProjectExplorerViewGroup": {
441
+ "$$.ShowProjectExplorerCommand": { order: 100 }
442
+ },
443
+ "$$.ResetAppDataGroup": {
444
+ "$$.ResetAppDataCommand": { order: 100 },
445
+ },
446
+ },
447
+
448
+ commandBars: {
449
+ "$$.FileMenu": {
450
+ type: "menu",
451
+ text: qsTr("&File"),
452
+ commandGroups: {
453
+ "$$.ExitGroup": { order: 100 },
454
+ },
455
+ },
456
+ "$$.ConnectionMenu": {
457
+ type: "menu",
458
+ text: qsTr("&Connection"),
459
+ commandGroups: {
460
+ "$$.ConnectionGroup": { order: 100 },
461
+ },
462
+ },
463
+ "$$.ToolsMenu": {
464
+ type: "menu",
465
+ text: qsTr("&Tools"),
466
+ commandGroups: {
467
+ "$$.LogViewGroup": { order: 100 },
468
+ "$$.ProjectExplorerViewGroup": { order: 110 },
469
+ "$$.SettingsGroup": { order: 120 },
470
+ },
471
+ },
472
+
473
+ // NOTE: Battle & Rebel have their own product specific window menu (but should really use this)
474
+ "$$.WindowMenu": {
475
+ type: "menu",
476
+ text: qsTr("&Window"),
477
+ commandGroups: {
478
+ "$$.LayoutGroup": { order: 100 },
479
+ "$$.WelcomeGroup": { order: 110 },
480
+ },
481
+ },
482
+
483
+ "$$.HelpMenu": {
484
+ type: "menu",
485
+ text: qsTr("&Help"),
486
+ commandGroups: {
487
+ "$$.DocumentationGroup": { order: 100 },
488
+ "$$.ResetAppDataGroup": { order: 110 },
489
+ "$$.FeedbackGroup": { order: 120 },
490
+ "$$.AboutGroup": { order: 130 },
491
+ },
492
+ },
493
+ "$$.ConnectionToolbar": {
494
+ type: "toolbar",
495
+ text: qsTr("Connection"),
496
+ commandGroups: {
497
+ "$$.ConnectionGroup": { order: 100 },
498
+ },
499
+ },
500
+ "$$.LogWindowToolbar": {
501
+ type: "toolbar",
502
+ text: qsTr("Main"),
503
+ commandGroups: {
504
+ "$$.LogClearGroup": { order: 100 },
505
+ "$$.LogFilterGroup": { order: 110 },
506
+ "$$.LogSourceFilterGroup": { order: 120 },
507
+ }
508
+ },
509
+ "$$.FeedbackToolbar": {
510
+ type: "rightJustifedToolbar",
511
+ text: qsTr("Feedback"),
512
+ commandGroups: {
513
+ "$$.FeedbackGroup": { order: 100 },
514
+ },
515
+ },
516
+ },
517
+
518
+ settings: {
519
+ "$$.Environment": {
520
+ order: 50,
521
+ text: qsTr("Environment"),
522
+ properties: {
523
+ "$$.ColorTheme": {
524
+ order: 100,
525
+ type: "installedThemes",
526
+ category: qsTr("Visual Experience"),
527
+ text: qsTr("Color Theme"),
528
+ detailsText: qsTr("The currently selected application color theme."),
529
+ changeRequiresAppRestart: true,
530
+ },
531
+ "$$.GeneralFont": {
532
+ order: 101,
533
+ type: "font",
534
+ fontType: "general",
535
+ category: qsTr("Visual Experience"),
536
+ text: qsTr("General Font"),
537
+ detailsText: qsTr("General font used for all non-code UI elements."),
538
+ changeRequiresAppRestart: true,
539
+ },
540
+ "$$.CodeFont2": {
541
+ order: 102,
542
+ type: "font",
543
+ fontType: "code",
544
+ category: qsTr("Visual Experience"),
545
+ text: qsTr("Code Font"),
546
+ detailsText: qsTr("Font used for source code and code-like UI elements."),
547
+ changeRequiresAppRestart: true,
548
+ },
549
+ "$$.DefaultColorMap": {
550
+ order: 109,
551
+ type: "defaultColorMap",
552
+ defaultValue: "Flammenmeer",
553
+ category: qsTr("Visual Experience"),
554
+ text: qsTr("Default Color Scale"),
555
+ detailsText: qsTr("Default color map used to represent a qualitiative scale of values."),
556
+ },
557
+ "$$.DefaultDocumentsFolder": {
558
+ requiresFlags: ["CorePlugin.HasProjectService"],
559
+ order: 110,
560
+ type: "directoryPath",
561
+ category: qsTr("Documents Folder"),
562
+ detailsText: qsTr("The folder where projects and documents will be saved."),
563
+ },
564
+ "$$.StartupBehavior": {
565
+ requiresFlags: ["CorePlugin.HasProjectService"],
566
+ order: 120,
567
+ type: "enum",
568
+ category: qsTr("Startup Behavior"),
569
+ text: qsTr("At Startup"),
570
+ detailsText: qsTr("What to do when the host is launched"),
571
+ defaultValue: "welcomePage",
572
+ enumValues: {
573
+ "welcomePage": {
574
+ order: 100,
575
+ text: qsTr("Show Welcome Page"),
576
+ },
577
+ "quickLaunch": {
578
+ order: 200,
579
+ text: qsTr("Show Quick Launch Dialog"),
580
+ },
581
+ "lastProject": {
582
+ order: 300,
583
+ text: qsTr("Load Last Project"),
584
+ },
585
+ "empty": {
586
+ order: 400,
587
+ text: qsTr("Show Empty Environment"),
588
+ },
589
+ },
590
+ },
591
+ "$$.ShowVersionUpdateNotifications": {
592
+ requiresFlags: ["CorePlugin.HasVersionUpdateService"],
593
+ order: 130,
594
+ type: "bool",
595
+ category: qsTr("Updates"),
596
+ text: qsTr("Show version update notifications"),
597
+ detailsText: qsTr("Show notifications when a new version of this product is available."),
598
+ defaultValue: true
599
+ },
600
+ },
601
+ },
602
+
603
+ "$$.Privacy": {
604
+ requiresFlags: ["CorePlugin.HasPrivacyDialog"],
605
+ order: 9999,
606
+ text: qsTr("Send Feedback..."),
607
+ properties: {
608
+ "$$.AllowAnalytics": {
609
+ order: 100,
610
+ type: "bool",
611
+ category: qsTr("Help Improve NVIDIA Software"),
612
+ text: qsTr("Collect Usage and Platform Data"),
613
+ detailsText: qsTr("NVIDIA software packages collect usage and platform data via Google Analytics. \nThis data is not associated with any account information registered with NVIDIA \nand is used under the legitimate interest standard for the sole purpose of \nimproving NVIDIA software. For inquiries, please contact privacy@nvidia.com."),
614
+ },
615
+ },
616
+ },
617
+
618
+ },
619
+ });
620
+
621
+ // Rename some commands for increased Mac integration
622
+ if (AppLib.environment.darwin) {
623
+ addPlugin({
624
+ commands: {
625
+ "CorePlugin.ExitCommand": {
626
+ shortcut: codeTr("Ctrl+Q"),
627
+ menuRole: "quit",
628
+ },
629
+ "CorePlugin.SettingsCommand": {
630
+ text: qsTr("Preferences..."),
631
+ shortcut: codeTr("Ctrl+,"),
632
+ menuRole: "preferences",
633
+ },
634
+ },
635
+ });
636
+ }
637
+
638
+ if (AppLib.environment.windows) {
639
+ addPlugin({
640
+ settings: {
641
+ "$$.Environment": {
642
+ properties: {
643
+ "$$.MixedDPIScalingHandling": {
644
+ requiresFlags: ["CorePlugin.HasMixedDPIScalingHandling"],
645
+ order: 105,
646
+ type: "enum",
647
+ defaultValue: "auto",
648
+ category: qsTr("Visual Experience"),
649
+ text: qsTr("Mixed DPI Scaling"),
650
+ detailsText: qsTr("Requires app restart. Disable Mixed DPI Scaling if unwanted artifacts are detected when using monitors with different DPIs."),
651
+ changeRequiresAppRestart: true,
652
+ enumValues: {
653
+ "auto": {
654
+ order: 100,
655
+ text: qsTr("Auto"),
656
+ },
657
+ "integerRoundUp": {
658
+ order: 200,
659
+ text: qsTr("Integer (round up)")
660
+ },
661
+ "integerRoundDown": {
662
+ order: 300,
663
+ text: qsTr("Integer (round down)")
664
+ },
665
+ "integerRoundAdjust": {
666
+ order: 400,
667
+ text: qsTr("Round and adjust the DPI")
668
+ },
669
+ "off": {
670
+ order: 500,
671
+ text: qsTr("Off"),
672
+ },
673
+ },
674
+ },
675
+ },
676
+ },
677
+ },
678
+ });
679
+ }
680
+
681
+ if (AppLib.environment.has_enhanced_windowing_experience_option) {
682
+ addPlugin({
683
+ settings: {
684
+ "$$.Environment": {
685
+ properties: {
686
+ "$$.UseEnhancedWindowingExperience": {
687
+ order: 106,
688
+ type: "bool",
689
+ defaultValue: true,
690
+ category: qsTr("Visual Experience"),
691
+ text: qsTr("Use Enhanced Windowing Experience"),
692
+ detailsText: qsTr("Enable an enhanced windowing experience. Requires app restart."),
693
+ changeRequiresAppRestart: true,
694
+ },
695
+ },
696
+ },
697
+ },
698
+ });
699
+ }
700
+
701
+ if (AppLib.environment.has_enhanced_windowing_experience) {
702
+ addPlugin({
703
+ settings: {
704
+ "$$.Environment": {
705
+ properties: {
706
+ "$$.FloatingWindowsAlwaysOnTop": {
707
+ order: 107,
708
+ type: "bool",
709
+ defaultValue: false,
710
+ category: qsTr("Windowing"),
711
+ text: qsTr("Floating Windows Always on Top"),
712
+ detailsText: qsTr("Configure floating tool windows to always stay on top of the main window. Requires app restart."),
713
+ changeRequiresAppRestart: true,
714
+ },
715
+
716
+ // XXX: This needs some style changes to support; the borders are currently drawn
717
+ // incorrectly.
718
+ //
719
+ // "$$.TabBarPosition": {
720
+ // order: 108,
721
+ // type: "bool",
722
+ // type: "enum",
723
+ // category: qsTr("Windowing"),
724
+ // text: qsTr("Tab Bar Position"),
725
+ // detailsText: qsTr("Set the position of tabs on the tab bar for multi-tabbed tool windows. Requires app restart."),
726
+ // defaultValue: "south",
727
+ // enumValues: {
728
+ // "north": {
729
+ // order: 100,
730
+ // text: qsTr("North"),
731
+ // },
732
+ // "south": {
733
+ // order: 200,
734
+ // text: qsTr("South"),
735
+ // },
736
+ // },
737
+ // changeRequiresAppRestart: true,
738
+ // },
739
+ },
740
+ },
741
+ },
742
+ });
743
+ }
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/Plugins/QuadDPlugin/Manifest.js ADDED
@@ -0,0 +1,857 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // DO NOT MODIFY.
2
+ // This file was created automatically by CMake.
3
+
4
+ // QuadDPlugin is the primary UI library for the product.
5
+ AppLib.logInfo("Loading QuadDPlugin");
6
+
7
+ var states = {
8
+ ShowProjectExplorer: "$$.ShowProjectExplorer",
9
+ };
10
+
11
+ addPlugin({
12
+ pluginDependencies: ["CorePlugin", "TimelinePlugin"],
13
+ pluginLibrary: "QuadDPlugin",
14
+
15
+ hostApplication: {
16
+ multiTargetEnabled: "true",
17
+ usbTargetsEnabled: "true",
18
+ queryEnabled: "true",
19
+ isStandalone: (AppLib.environment.quadd_standalone == true),
20
+ },
21
+
22
+ documents:
23
+ {
24
+ fileTypes:
25
+ {
26
+ "qdrep":
27
+ {
28
+ icon: "",
29
+ factoryName: "ReportFactory",
30
+ viewFactories:
31
+ [
32
+ { factoryName: "ReportWindowFactory", priority: 50 }
33
+ ]
34
+ },
35
+ "nsys-rep":
36
+ {
37
+ icon: "",
38
+ factoryName: "ReportFactory",
39
+ viewFactories:
40
+ [
41
+ { factoryName: "ReportWindowFactory", priority: 50 }
42
+ ]
43
+ },
44
+ "nsys-view":
45
+ {
46
+ icon: "",
47
+ factoryName: "ReportViewFactory",
48
+ viewFactories:
49
+ [
50
+ { factoryName: "ReportWindowFactory", priority: 50 }
51
+ ]
52
+ },
53
+ "qdstrm":
54
+ {
55
+ icon: "",
56
+ factoryName: "ImportStreamFactory",
57
+ viewFactories:
58
+ [
59
+ { factoryName: "ImportStreamWindowFactory", priority: 50 }
60
+ ]
61
+ },
62
+ "ipynb":
63
+ {
64
+ icon: "",
65
+ factoryName: "JupyterFactory",
66
+ viewFactories:
67
+ [
68
+ { factoryName: "JupyterWindowFactory", priority: 50 }
69
+ ]
70
+ },
71
+ "nsys-analysis":
72
+ {
73
+ icon: "",
74
+ factoryName: "RecipeReportFactory",
75
+ viewFactories:
76
+ [
77
+ { factoryName: "RecipeReportWindowFactory", priority: 50 }
78
+ ]
79
+ },
80
+ "csv":
81
+ {
82
+ icon: "",
83
+ factoryName: "RecipeTableFactory",
84
+ viewFactories:
85
+ [
86
+ { factoryName: "RecipeTableWindowFactory", priority: 50 }
87
+ ]
88
+ },
89
+ "parquet":
90
+ {
91
+ icon: "",
92
+ factoryName: "RecipeTableFactory",
93
+ viewFactories:
94
+ [
95
+ { factoryName: "RecipeTableWindowFactory", priority: 50 }
96
+ ]
97
+ },
98
+ "etl":
99
+ {
100
+ icon: "",
101
+ factoryName: "ReportFactory",
102
+ viewFactories:
103
+ [
104
+ { factoryName: "ReportWindowFactory", priority: 50 }
105
+ ]
106
+ },
107
+ "qdresolve":
108
+ {
109
+ icon: "",
110
+ factoryName: "ReportFactory",
111
+ viewFactories:
112
+ [
113
+ { factoryName: "ReportWindowFactory", priority: 50 }
114
+ ]
115
+ },
116
+ "qdproj":
117
+ {
118
+ icon: "",
119
+ factoryName: "ProjectFactory",
120
+ viewFactories:
121
+ [
122
+ { factoryName: "ProjectWindowFactory", priority: 50 }
123
+ ]
124
+ },
125
+ "qdlaunch":
126
+ {
127
+ icon: "",
128
+ factoryName: "ProjectFactory",
129
+ viewFactories:
130
+ [
131
+ { factoryName: "ProjectWindowFactory", priority: 50 }
132
+ ]
133
+ },
134
+ "qdprogress":
135
+ {
136
+ icon: "",
137
+ factoryName: "ProfilingProgressFactory",
138
+ viewFactories:
139
+ [
140
+ { factoryName: "ProfilingProgressWindowFactory", priority: 50 }
141
+ ]
142
+ },
143
+ },
144
+
145
+ fileFilters: {
146
+ "Nsight Systems Multi-report views":
147
+ {
148
+ extensions:
149
+ [
150
+ "nsys-view",
151
+ ],
152
+ sortPriority: 40
153
+ },
154
+ "Nsight Systems Reports":
155
+ {
156
+ extensions:
157
+ [
158
+ "qdrep",
159
+ "nsys-rep"
160
+ ],
161
+ sortPriority: 50
162
+ }
163
+ }
164
+ },
165
+
166
+ settings: {
167
+ "$$.SystemTrace": {
168
+ order: 90,
169
+ text: qsTr("System Trace"),
170
+ detailsText: qsTr("Settings for the System Trace activity"),
171
+ visible: (AppLib.environment.quadd_standalone != true),
172
+ },
173
+
174
+ "$$.Behavior": {
175
+ order: 99,
176
+ text: qsTr("Behavior"),
177
+ parent: (AppLib.environment.quadd_standalone == true ? "" : qsTr("System Trace")),
178
+ properties: {
179
+ "QuadDPlugin.MultipleReportsOpenMode": {
180
+ order: 105,
181
+ type: "enum",
182
+ enumValues: {
183
+ "askMode": {
184
+ order: 100,
185
+ text: qsTr("Ask"),
186
+ },
187
+ "separateReportsMode": {
188
+ order: 101,
189
+ text: qsTr("Open separate reports"),
190
+ },
191
+ "createMultiReportViewMode": {
192
+ order: 102,
193
+ text: qsTr("Create a multi-report view"),
194
+ },
195
+ },
196
+ text: qsTr("On multiple report open"),
197
+ detailsText: qsTr("Whether we need to automatically create a " +
198
+ "multi-report view on simultaneous opening of multiple reports"),
199
+ defaultValue: "askMode",
200
+ },
201
+
202
+ "QuadDPlugin.SymbolsSearchLocations": {
203
+ order: 200,
204
+ type: "directoryPathList",
205
+ category: qsTr("Symbols search locations"),
206
+ text: qsTr("Search directories/servers"),
207
+ detailsText: qsTr("List of locations (directories and servers) to search " +
208
+ "for symbol files"),
209
+ defaultValue: qsTr("")
210
+ },
211
+ "QuadDPlugin.SymbolsCacheDirectory": {
212
+ order: 201,
213
+ type: "directoryPath",
214
+ category: qsTr("Symbols search locations"),
215
+ text: qsTr("Cache directory"),
216
+ detailsText: qsTr("The symbol cache is the location on your local " +
217
+ "machine that Nsight Systems places a copy of the symbols it finds " +
218
+ "on remote locations for future use"),
219
+ defaultValue: qsTr("")
220
+ },
221
+ },
222
+ },
223
+
224
+ "$$.ReportBehavior": {
225
+ order: 100,
226
+ text: qsTr("Report"),
227
+ detailsText: qsTr("You need to reopen report(s) in order for the change of this " +
228
+ "settings to take effect"),
229
+ parent: qsTr("Behavior"),
230
+ properties: {
231
+ "QuadDPlugin.UseCudaNvtxGroups": {
232
+ order: 105,
233
+ type: "bool",
234
+ category: qsTr("Report Behaviour"),
235
+ text: qsTr("Rename CUDA Kernels by NVTX"),
236
+ detailsText: qsTr("Rename CUDA Kernels by NVTX ranges."),
237
+ defaultValue: false
238
+ },
239
+ "QuadDPlugin.UseCudaKernelColors": {
240
+ order: 106,
241
+ type: "bool",
242
+ category: qsTr("Report Behaviour"),
243
+ text: qsTr("Color CUDA Kernels"),
244
+ detailsText: qsTr("Apply different color to CUDA kernels."),
245
+ defaultValue: false
246
+ },
247
+ "QuadDPlugin.TimelineMode": {
248
+ order: 107,
249
+ type: "enum",
250
+ enumValues: {
251
+ "defaultMode": {
252
+ order: 100,
253
+ text: qsTr("CPU rows on top"),
254
+ },
255
+ "gpuOnTopMode": {
256
+ order: 101,
257
+ text: qsTr("GPU rows on top"),
258
+ },
259
+ },
260
+ category: qsTr("Report Behaviour"),
261
+ text: qsTr("Timeline mode"),
262
+ detailsText: qsTr("Switch timeline mode."),
263
+ defaultValue: "gpuOnTopMode"
264
+ },
265
+ "QuadDPlugin.SymbolSearchVerboseLog": {
266
+ order: 108,
267
+ type: "bool",
268
+ category: qsTr("Report Behaviour"),
269
+ text: qsTr("Symbol Search verbose log (Windows only)"),
270
+ detailsText: qsTr("Display the intermediate steps of the symbol search in" +
271
+ " the report's Symbol Resolution Log."),
272
+ defaultValue: false
273
+ },
274
+ "QuadDPlugin.CollapseUnresolvedCallstackFrames": {
275
+ order: 109,
276
+ type: "bool",
277
+ category: qsTr("Report Behaviour"),
278
+ text: qsTr("Collapse unresolved callstack frames"),
279
+ detailsText: qsTr("Display a single line \"modulename[N frames]\" instead" +
280
+ " of consecutive callstack frames of same module with unresolved symbols."),
281
+ defaultValue: true
282
+ },
283
+
284
+ "$$.VerticalScrolling": {
285
+ order: 200,
286
+ type: "bool",
287
+ category: qsTr("Vertical scrolling behaviour"),
288
+ text: qsTr("Scroll vertically when time filter is changed"),
289
+ detailsText: qsTr("Try to preserve visual context when time filter is applied"),
290
+ defaultValue: false
291
+ },
292
+ },
293
+ },
294
+
295
+ "$$.ProfileBehavior": {
296
+ order: 101,
297
+ text: qsTr("Profile"),
298
+ detailsText: qsTr("You need to rerun trace(s) in order for the change of this " +
299
+ "settings to take effect"),
300
+ parent: qsTr("Behavior"),
301
+ properties: {
302
+ "QuadDPlugin.RetainETWLogFile": {
303
+ order: 100,
304
+ type: "bool",
305
+ visible: true,
306
+ text: qsTr("Save ETW log files in project folder (Windows only)"),
307
+ detailsText: qsTr("Keep ETL file. trace rerun required."),
308
+ defaultValue: true
309
+ },
310
+ "QuadDPlugin.AutomaticallyGenerateReportFileNames": {
311
+ order: 101,
312
+ type: "bool",
313
+ text: qsTr("Derive report file name from collected data (Windows only)"),
314
+ detailsText: qsTr("Use details of profiled graphics application. Format: " +
315
+ "[Process Name][GPU Name][Window Resolution][Graphics API] Timestamp.nsys-rep"),
316
+ defaultValue: false
317
+ },
318
+
319
+ "QuadDPlugin.ResolveSymbolsOnReportCreation": {
320
+ order: 200,
321
+ type: "bool",
322
+ text: qsTr("Resolve symbols when creating a report"),
323
+ detailsText: qsTr("Search for symbol files and attempt to resolve symbols" +
324
+ " of backtraces when creating a new report."),
325
+ },
326
+ }
327
+ },
328
+
329
+ "$$.Notifications": {
330
+ text: qsTr("Notifications"),
331
+ order: 140,
332
+ parent: (AppLib.environment.quadd_standalone == true ? "" : qsTr("System Trace")),
333
+ properties: {
334
+ "QuadDPlugin.ResetNotifications": {
335
+ category: qsTr("Reset All Notifications"),
336
+ type: "button",
337
+ detailsText: qsTr("Click to reset all notifications to the default state"),
338
+ text: qsTr("Reset notifications"),
339
+ consecutiveClick: false
340
+ }
341
+ }
342
+ },
343
+
344
+ "$$.TimelineHierarchySettings": {
345
+ text: qsTr("Hierarchy"),
346
+ visible: true,
347
+ order: 901,
348
+ parent: qsTr("Timeline"),
349
+
350
+ properties: {
351
+ "QuadDPlugin.ShowCpuOccupancy": {
352
+ type: "bool",
353
+ category: qsTr("Visibility"),
354
+ text: qsTr("Show CPU occupancy chart"),
355
+ detailsText: qsTr("Show the chart indicating the CPU on which code was running"),
356
+ defaultValue: true,
357
+ }
358
+ }
359
+ },
360
+ },
361
+
362
+ timelineHelp: {
363
+ title: "Timeline Actions and Gestures",
364
+ description: "When navigating the Timeline you can use keyboard shortcuts and mouse gestures. " +
365
+ "If your machine is equipped with a touchpad, you can also use touchpad gestures to " +
366
+ "pan, zoom and scroll vertically.\n\n" +
367
+ "The tables below show a description of common actions with their gesture bindings.",
368
+
369
+ shortcutGroups: [{
370
+ title: "Show This Dialog",
371
+ description: "Press the '?' key when Timeline is in focus."
372
+ },
373
+ {
374
+ title: "Navigation with Keyboard and Mouse",
375
+ description: "Here are combinations to use keyboard and mouse to scroll through the Timeline and the tree.",
376
+ shortcuts: [{
377
+ id: "Navigation.PanLeft",
378
+ name: "Pan Left",
379
+ combinations: {
380
+ common: ["LeftArrow"]
381
+ }
382
+ },
383
+ {
384
+ id: "Navigation.PanRight",
385
+ name: "Pan Right",
386
+ combinations: {
387
+ common: ["RightArrow"]
388
+ }
389
+ },
390
+ {
391
+ id: "Navigation.ZoomInX",
392
+ name: "Zoom in X-axis",
393
+ combinations: {
394
+ common: ["Keyboard +", "Keyboard ="],
395
+ windows: ["CTRL + MouseWheel up"],
396
+ linux: ["CTRL + MouseWheel up"],
397
+ macos: ["Cmd + MouseWheel up"]
398
+ }
399
+ },
400
+ {
401
+ id: "Navigation.ZoomOutX",
402
+ name: "Zoom out X-axis",
403
+ combinations: {
404
+ common: ["Keyboard -"],
405
+ windows: ["CTRL + MouseWheel down"],
406
+ linux: ["CTRL + MouseWheel down"],
407
+ macos: ["Cmd + MouseWheel down"],
408
+ }
409
+ },
410
+ {
411
+ id: "Navigaton.NextRow",
412
+ name: "Next Row",
413
+ combinations: {
414
+ common: ["ArrowDown"]
415
+ }
416
+ },
417
+ {
418
+ id: "Navigaton.PrevRow",
419
+ name: "Previous Row",
420
+ combinations: {
421
+ common: ["ArrowUp"]
422
+ }
423
+ },
424
+ {
425
+ id: "Navigation.Undo",
426
+ name: "Undo a Navigation Step",
427
+ combinations: {
428
+ common: ["Backspace"]
429
+ }
430
+ }]
431
+ },
432
+ {
433
+ title: "Navigation with Touchpad",
434
+ description: "Navigating through the Timeline and the tree with touchpad.",
435
+ shortcuts: [{
436
+ id: "Navigation.PanLeft",
437
+ name: "Pan Left",
438
+ combinations: {
439
+ common: ["Swipe right with two fingers"]
440
+ }
441
+ },
442
+ {
443
+ id: "Navigation.PanRight",
444
+ name: "Pan Right",
445
+ combinations: {
446
+ common: ["Swipe left with two fingers"]
447
+ }
448
+ },
449
+ {
450
+ id: "Navigation.ZoomInX",
451
+ name: "Zoom in X-axis",
452
+ combinations: {
453
+ common: ["Pinch in with touchpad"]
454
+ }
455
+ },
456
+ {
457
+ id: "Navigation.ZoomOutX",
458
+ name: "Zoom out X-axis",
459
+ combinations: {
460
+ common: ["Pinch out with touchpad"]
461
+ }
462
+ },
463
+ {
464
+ id: "Navigaton.ScrollUp",
465
+ name: "Scroll Tree Up",
466
+ combinations: {
467
+ common: ["Swipe down with two fingers"]
468
+ }
469
+ },
470
+ {
471
+ id: "Navigaton.ScrollDown",
472
+ name: "Scroll Tree Down",
473
+ combinations: {
474
+ common: ["Swipe up with two fingers"]
475
+ }
476
+ }]
477
+ },
478
+ {
479
+ title: "Selection of Items",
480
+ description: "You can select an item on the Timeline. " +
481
+ "Selecting items with double-click synchronizes the Timeline and the Events View",
482
+
483
+ shortcuts: [{
484
+ id: "Selection.SelectItem",
485
+ name: "Select an Item in the Timeline",
486
+ combinations: {
487
+ common: ["MouseLeftClick on an item"]
488
+ }
489
+ },
490
+ {
491
+ id: "Selection.SelectItemInEventsView",
492
+ name: "Select an Item in the current Events View",
493
+ combinations: {
494
+ common: ["MouseLeftDoubleClick on an item"]
495
+ }
496
+ },
497
+ {
498
+ id: "Selection.OpenEventsViewAndSelectItem",
499
+ name: "Open the corresponding Events View and select an Item there",
500
+ combinations: {
501
+ common: ["Shift + MouseLeftDoubleClick on an item"]
502
+ }
503
+ },
504
+ {
505
+ id: "Selection.FitItemToScreen",
506
+ name: "Select and Fit an Item to Screen",
507
+ combinations: {
508
+ windows: ["CTRL + MouseLeftDoubleClick on an item"],
509
+ linux: ["CTRL + MouseLeftDoubleClick on an item"],
510
+ macos: ["Cmd + MouseLeftDoubleClick on an item"]
511
+ }
512
+ }]
513
+ },
514
+ {
515
+ title: "Selection of a Time Range",
516
+ description: "You can select an time range on the Timeline. " +
517
+ "The selected area and its borders can be dragged with left mouse button. " +
518
+ "Also it has several shortcuts modifying zoom level and time filter.",
519
+
520
+ shortcuts: [{
521
+ id: "Selection.SelectTimeRange",
522
+ name: "Select a Time Range",
523
+ combinations: {
524
+ common: ["Press and drag left mouse button"]
525
+ }
526
+ },
527
+ {
528
+ id: "Selection.SelectTimeRange",
529
+ name: "Drag Selection or Its Border",
530
+ combinations: {
531
+ common: ["Press and drag left mouse button on a selection"]
532
+ }
533
+ },
534
+ {
535
+ id: "Selection.Deselect",
536
+ name: "Deselect a Time Range",
537
+ combinations: {
538
+ common: ["Escape", "Click outside a selection"]
539
+ }
540
+ },
541
+ {
542
+ id: "Selection.Zoom",
543
+ name: "Zoom into a Selection",
544
+ combinations: {
545
+ common: ["Z"]
546
+ }
547
+ },
548
+ {
549
+ id: "Selection.ZoomAndDeselect",
550
+ name: "Zoom into a Selection and Deselect",
551
+ combinations: {
552
+ common: ["Shift + Z", "MouseLeftDoubleClick on a selection"]
553
+ }
554
+ },
555
+ {
556
+ id: "Selection.Filter",
557
+ name: "Apply Time Filter",
558
+ combinations: {
559
+ common: ["F"]
560
+ }
561
+ },
562
+ {
563
+ id: "Selection.FilterAndDeselect",
564
+ name: "Apply Time Filter and Deselect",
565
+ combinations: {
566
+ common: ["Shift + F"]
567
+ }
568
+ }]
569
+ }]
570
+ },
571
+ });
572
+
573
+ if (AppLib.environment.quadd_standalone)
574
+ {
575
+ addPlugin({
576
+ pluginDependencies: ["CorePlugin"],
577
+ pluginLibrary: "QuadDPlugin",
578
+
579
+ layouts: {
580
+ "default": "Plugins/$$/default.layout",
581
+ },
582
+
583
+ hostApplication: {
584
+ title: qsTr("NVIDIA Nsight Systems"),
585
+ defaultWidth: 1366,
586
+ defaultHeight: 768,
587
+ icon: ":/icons/Product.ico",
588
+ docs: "http://docs.nvidia.com/nsight-systems/index.html",
589
+ offlineDocs: "documentation/index.html",
590
+ crashReporterHideStack: true,
591
+
592
+ productName: "NVIDIA Nsight Systems",
593
+ organizationName: "NVIDIA Corporation",
594
+
595
+ versionUpdates: {
596
+ enabled: true,
597
+ tableUrl: "https://developer.download.nvidia.com/NsightSystems/VersionUpgrades.json",
598
+ },
599
+
600
+ commandBars: {
601
+ "$$.FileMenu": { order: 100 },
602
+ "$$.ViewMenu": { order: 200 },
603
+ "CorePlugin.ToolsMenu": { order: 300 },
604
+ "$$.HelpMenu": { order: 9999 },
605
+ },
606
+ },
607
+
608
+ commandLineOptions:
609
+ {
610
+ "operation":
611
+ {
612
+ name: "operation",
613
+ description: "Operation performed with the project",
614
+ valueName: "operation",
615
+ },
616
+ "project-uuid":
617
+ {
618
+ name: "project-uuid",
619
+ description: "UUID of the project which should be opened or created",
620
+ valueName: "project-uuid",
621
+ },
622
+ "working-dir":
623
+ {
624
+ name: "working-dir",
625
+ description: "Working directory of the profiled application",
626
+ valueName: "working-dir",
627
+ },
628
+ "target-path":
629
+ {
630
+ name: "target-path",
631
+ description: "Path to the main binary of the profiled application",
632
+ valueName: "target-path",
633
+ },
634
+ "target-environment":
635
+ {
636
+ name: "target-environment",
637
+ description: "Environment to the profiled application",
638
+ valueName: "target-path",
639
+ },
640
+ "start-args":
641
+ {
642
+ name: "start-args",
643
+ description: "Arguments passed to the profiled application",
644
+ valueName: "start-args",
645
+ },
646
+ "solution-path":
647
+ {
648
+ name: "solution-path",
649
+ description: "Path of the profiled application's Visual Studio solution",
650
+ valueName: "solution-path",
651
+ },
652
+ "secondary-instance-working-directory":
653
+ {
654
+ name: "secondary-instance-working-directory",
655
+ description: "The current directory from which a secondary instance of application started.",
656
+ valueName: "secondary-instance-working-directory",
657
+ },
658
+ "screenshot":
659
+ {
660
+ name: "screenshot",
661
+ description: "Take a screenshot of the loaded report and quit",
662
+ },
663
+ "$$.SingleProcess":
664
+ {
665
+ name: "single-process",
666
+ description: "Use single-process mode for QtWebEngine.",
667
+ },
668
+ "fullscreen":
669
+ {
670
+ name: "fullscreen",
671
+ description: "Open the main window in fullscreen mode",
672
+ }
673
+ },
674
+
675
+ documents:
676
+ {
677
+ fileTypes:
678
+ {
679
+ "etl":
680
+ {
681
+ icon: "",
682
+ factoryName: "ImportStreamFactory",
683
+ viewFactories:
684
+ [
685
+ { factoryName: "ImportStreamWindowFactory", priority: 50 }
686
+ ]
687
+ },
688
+ "qdresolve":
689
+ {
690
+ icon: "",
691
+ factoryName: "ResolveSymbolsFactory",
692
+ viewFactories:
693
+ [
694
+ { factoryName: "ResolveSymbolsWindowFactory", priority: 50 }
695
+ ]
696
+ },
697
+ "qdexport":
698
+ {
699
+ icon: "",
700
+ factoryName: "ExportSelectorFactory",
701
+ viewFactories:
702
+ [
703
+ { factoryName: "ExportSelectorWindowFactory", priority: 50 }
704
+ ]
705
+ },
706
+ },
707
+
708
+ fileFilters: {
709
+ "Nsight Systems Projects": { extensions: ["qdproj"], sortPriority: 50 },
710
+ }
711
+ },
712
+
713
+ toolWindows: {
714
+ "$$.ProjectExplorerWindow": {
715
+ text: qsTr("Project Explorer"),
716
+ sizeMode: "percent",
717
+ deleteOnClose: true,
718
+ layout: "dockWest",
719
+ isFixed: false,
720
+ persistable: true,
721
+ defaultWidth: 250,
722
+ commandBars: {
723
+ },
724
+ }
725
+ },
726
+
727
+ commands: {
728
+ "$$.RestoreDefaultLayout": {
729
+ text: qsTr("&Restore Default Layout"),
730
+ },
731
+ "$$.SaveLayout": {
732
+ text: qsTr("Save Layout"),
733
+ shortcut: codeTr("Alt+Shift+S"),
734
+ },
735
+ "$$.NewProject": {
736
+ text: qsTr("&New Project"),
737
+ shortcut: codeTr("Ctrl+N"),
738
+ },
739
+ "$$.NewMultiReportView": {
740
+ text: qsTr("&New multi-report view"),
741
+ },
742
+ "$$.OpenFile": {
743
+ text: qsTr("&Open..."),
744
+ shortcut: codeTr("Ctrl+O"),
745
+ },
746
+ "$$.Import": {
747
+ text: qsTr("&Import..."),
748
+ shortcut: codeTr("Ctrl+I"),
749
+ },
750
+ "$$.Export": {
751
+ text: qsTr("&Export..."),
752
+ shortcut: codeTr("Ctrl+E"),
753
+ },
754
+ "$$.ShowProjectExplorer": {
755
+ text: qsTr("&Show Project Explorer"),
756
+ checkedWithFlags: [states.ShowProjectExplorer],
757
+ },
758
+ "$$.OfflineDocumentationCommand": {
759
+ text: qsTr("Offline Documentation..."),
760
+ },
761
+ "$$.ShowAboutWindow": {
762
+ text: qsTr("&About"),
763
+ },
764
+ "$$.ShowRebelDialog": {
765
+ text: qsTr("&Settings to Analyze CUDA Kernels..."),
766
+ },
767
+ "$$.ShowPreferencesWindow": {
768
+ text: qsTr("&Preferences..."),
769
+ },
770
+ },
771
+
772
+ commandGroups: {
773
+ "$$.ProjectGroup": {
774
+ "$$.NewProject": { order: 100 },
775
+ "$$.NewMultiReportView": { order: 110 },
776
+ "$$.OpenFile": { order: 200 },
777
+ "$$.Import": { order: 300 },
778
+ "$$.Export": { order: 400 },
779
+ },
780
+ "$$.FileGroup": {
781
+ "CorePlugin.SaveFile": { order: 120 },
782
+ "CorePlugin.CloseFile": { order: 150 },
783
+ },
784
+ "$$.ViewToolWindowsGroup": {
785
+ "$$.ShowProjectExplorer": { order: 100 },
786
+ },
787
+ "$$.DocumentationGroup": {
788
+ "CorePlugin.DocumentationCommand": { order: 100 },
789
+ "$$.OfflineDocumentationCommand": { order: 150 },
790
+ "CorePlugin.CheckForUpdatesCommand": {order: 200},
791
+ },
792
+ "$$.AboutGroup": {
793
+ "$$.ShowAboutWindow": { order: 100 },
794
+ },
795
+ "$$.RebelPreferencesGroup": {
796
+ "$$.ShowRebelDialog": { order: 100 },
797
+ },
798
+ "$$.LayoutGroup": {
799
+ "$$.RestoreDefaultLayout": { order: 110 },
800
+ "$$.SaveLayout": { order: 120 },
801
+ "CorePlugin.ApplyWindowLayout": { order: 130 },
802
+ }
803
+ },
804
+
805
+ commandBars: {
806
+ "$$.FileMenu": {
807
+ type: "menu",
808
+ text: qsTr("&File"),
809
+ commandGroups: {
810
+ "$$.ProjectGroup": { order: 100 },
811
+ "$$.FileGroup": { order: 150 },
812
+ "CorePlugin.ExitGroup": { order: 200 },
813
+ },
814
+ },
815
+ "$$.ViewMenu": {
816
+ type: "menu",
817
+ text: qsTr("&View"),
818
+ commandGroups: {
819
+ "$$.ViewToolWindowsGroup": { order: 100 },
820
+ "$$.LayoutGroup": { order: 210 },
821
+ },
822
+ },
823
+ "$$.HelpMenu": {
824
+ type: "menu",
825
+ text: qsTr("&Help"),
826
+ commandGroups: {
827
+ "$$.DocumentationGroup": { order: 100 },
828
+ "CorePlugin.FeedbackGroup": { order: 120 },
829
+ "$$.AboutGroup": { order: 130 },
830
+ },
831
+ },
832
+ "CorePlugin.ToolsMenu": {
833
+ type: "menu",
834
+ text: qsTr("&Tools"),
835
+ commandGroups: {
836
+ "$$.RebelPreferencesGroup": { order: 130 },
837
+ },
838
+ },
839
+
840
+ feedback: {
841
+ mailingAddress: "nsight-systems-feedback@exchange.nvidia.com",
842
+ },
843
+ },
844
+
845
+ settings: {
846
+ // TODO (DTSP-2632): This is a workaround for this problem:
847
+ // http://devtools-ru-s1.nvidia.com/gitlab/agora/quadd/merge_requests/4647#note_90779
848
+ "CorePlugin.Privacy": {
849
+ properties: {
850
+ "CorePlugin.AllowAnalytics": {
851
+ category: qsTr("Help Improve NVIDIA Software "),
852
+ }
853
+ }
854
+ },
855
+ }
856
+ });
857
+ }
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/Plugins/QuadDPlugin/default.layout ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "floating": [
3
+ ],
4
+ "id": "NvidiaDockingLayout",
5
+ "root": {
6
+ "left": {
7
+ "contents": {
8
+ "docklocation": 5,
9
+ "lastfloatingheight": -1,
10
+ "lastfloatingwidth": -1,
11
+ "persistable": true,
12
+ "uuid": "{4a8e3fd9-6d0a-47f0-8254-d3fff5ba2ec9}",
13
+ "windowtype": "QuadDPlugin.ProjectExplorerWindow"
14
+ },
15
+ "type": "dock"
16
+ },
17
+ "orientation": "horizontal",
18
+ "right": {
19
+ "contents": {
20
+ "docklocation": 4,
21
+ "lastfloatingheight": -1,
22
+ "lastfloatingwidth": -1,
23
+ "persistable": true,
24
+ "uuid": "{c7a94feb-a010-55b2-ab7d-73eb3ab0c077}",
25
+ "windowtype": "CorePlugin.DocumentsWindow"
26
+ },
27
+ "type": "dock"
28
+ },
29
+ "split_sizes": "309 1052",
30
+ "type": "split"
31
+ },
32
+ "version": 1
33
+ }
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/Plugins/TimelinePlugin/Manifest.js ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ addPlugin({
2
+ pluginDependencies: ["CorePlugin"],
3
+ pluginLibrary: "TimelinePlugin",
4
+
5
+ settings: {
6
+ "$$.TimelineSettings": {
7
+ text: qsTr("Timeline"),
8
+ visible: true,
9
+
10
+ // IMPORTANT: if you want to declare other settings group as a
11
+ // child of this element, the child must have order > 300,
12
+ //otherwise it will not appear in Tools/Options dialog
13
+ order: 300,
14
+
15
+ properties: {
16
+ "$$.ShowCorrelationArrows": {
17
+ order: 130,
18
+ type: "bool",
19
+ category: qsTr("Basic settings"),
20
+ text: qsTr("Show correlation arrows"),
21
+ detailsText: qsTr("Show arrows on correlated items on the Timeline"),
22
+ defaultValue: true
23
+ },
24
+ }
25
+ }
26
+ }
27
+ })
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/Plugins/TimelinePlugin/TimelinePlugin.dll ADDED
Binary file (27.2 kB). View file
 
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/Plugins/imageformats/qgif.dll ADDED
Binary file (48.8 kB). View file
 
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/Plugins/imageformats/qico.dll ADDED
Binary file (47.2 kB). View file
 
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/Plugins/imageformats/qsvg.dll ADDED
Binary file (40.1 kB). View file
 
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/Plugins/imageformats/qtga.dll ADDED
Binary file (39.1 kB). View file
 
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/Plugins/imageformats/qwbmp.dll ADDED
Binary file (37.5 kB). View file
 
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/Plugins/tls/qcertonlybackend.dll ADDED
Binary file (99 kB). View file
 
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/PythonNvtx/annotations.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "_comment": ["Minimal annotations example",
4
+ "Note that module's name must include parent packages"],
5
+
6
+ "module": "torch.nn.functional",
7
+ "functions": ["sigmoid"]
8
+ },
9
+
10
+ {
11
+ "_comment": "Set custom attributes - domain, category, color",
12
+
13
+ "domain": "My Domain",
14
+ "category": "My Category",
15
+ "color": "0x008000",
16
+ "module": "torch.nn.functional",
17
+ "functions": ["sigmoid"]
18
+ },
19
+
20
+ {
21
+ "_comment": [
22
+ "More complex example:",
23
+ "- Attributes can be overridden per function",
24
+ "- Methods can also be annotated (Adadelta.step)"
25
+ ],
26
+
27
+ "module": "torch.nn.functional",
28
+ "domain": "More complex example",
29
+ "category": "functional",
30
+ "color": "0x008000",
31
+ "functions": [
32
+ "sigmoid",
33
+ {"function": "log_softmax", "color": "0xFF0000"},
34
+ {"function": "Adadelta.step", "color": "0x800080", "module": "torch.optim.adadelta", "domain": "optim"}
35
+ ]
36
+ }
37
+ ]
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/Scripts/Flamegraph/README.md ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Nsight Systems flamegraph adapter
2
+
3
+ Script for parsing Nsight Systems report files containing CPU call stacks and producing an output suitable for `flamegraph.pl`.
4
+
5
+ ## Install FlameGraph
6
+
7
+ To visualize with FlameGraph call stack download `flamegraph.pl` from the [flamegraph repository](https://github.com/brendangregg/FlameGraph).
8
+
9
+ ### On Windows
10
+
11
+ To use `flamegraph.pl` on Windows, you will need to [install Perl](https://www.perl.org/get.html).
12
+
13
+ ## Function names
14
+
15
+ By default, script tries to shorten function definitions (eliminating return type, arguments and templates). In some complex cases shortening may fail and return a full function definition. To disable shortening defining `--full_function_names=False` argument can be used.
16
+
17
+ ## Usage
18
+
19
+ Generating flamegraph from Nsight Systems report file:
20
+
21
+ ### Unix
22
+
23
+ ```bash
24
+ python3 stackcollapse_nsys.py report.nsys-rep | ./flamegraph.pl > result_flamegraph.svg
25
+ ```
26
+
27
+ ### Windows
28
+
29
+ ```bash
30
+ PowerShell -Command "python stackcollapse_nsys.py report.nsys-rep | perl flamegraph.pl > result_flamegraph.svg"
31
+ ```
32
+
33
+ ### Parameters
34
+
35
+ The following parameters can be passed to the script:
36
+
37
+ | Parameter | Short | Description | Default value |
38
+ | --------------------- | ----- | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |
39
+ | --nsys | | Path to the NVIDIA Nsight Systems CLI directory (for ex.: `/opt/nvidia/nsight-systems/2022.4.1/target-linux-x64`). | Current NVIDIA Nsight Systems CLI installation location |
40
+ | --out | -o | Path to a result file containing a data suitable for `flamegraph.pl`. | Output is written to stdout |
41
+ | --full_function_names | | Use full function names with return type, arguments and expanded templates, if available. | False |
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/Scripts/Flamegraph/stackcollapse_nsys.py ADDED
@@ -0,0 +1,448 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #! /usr/bin/env python3
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ import argparse
14
+ import os
15
+ import re
16
+ import sqlite3
17
+ import subprocess
18
+ import sys
19
+ import tempfile
20
+ from pathlib import Path
21
+
22
+ NSYS_CLI_BINARY_NAME = "nsys.exe" if os.name == "nt" else "nsys"
23
+
24
+ SELECT_CALLCHAIN_TABLE_EXISTENCE = """
25
+ SELECT
26
+ count(name)
27
+ FROM
28
+ sqlite_master
29
+ WHERE
30
+ type='table' AND name = 'sampling_callchains'
31
+ COLLATE NOCASE
32
+ """
33
+
34
+ SELECT_CALLSTACKS = """
35
+ WITH usage(id, cycles) AS
36
+ (
37
+ SELECT
38
+ sc.id,
39
+ SUM(cpucycles) AS cycles
40
+ FROM
41
+ sampling_callchains sc
42
+ LEFT JOIN
43
+ composite_events se
44
+ ON sc.id == se.id
45
+ WHERE
46
+ sc.stackdepth == 0
47
+ GROUP BY
48
+ sc.symbol,
49
+ sc.module
50
+ )
51
+ SELECT
52
+ GROUP_CONCAT(value, ';') || ' ' || cycles
53
+ FROM
54
+ (
55
+ SELECT
56
+ si.value,
57
+ sc.id,
58
+ u.cycles
59
+ FROM
60
+ usage u
61
+ INNER JOIN
62
+ sampling_callchains sc
63
+ ON sc.id = u.id
64
+ INNER JOIN
65
+ stringids AS si
66
+ ON sc.symbol == si.id
67
+ INNER JOIN
68
+ stringids AS sm
69
+ ON sc.module == sm.id
70
+ WHERE
71
+ si.value <> '[Max depth]'
72
+ ORDER BY
73
+ stackdepth DESC
74
+ )
75
+ GROUP BY
76
+ id
77
+ ORDER BY
78
+ cycles DESC
79
+ """
80
+
81
+
82
+ REGEX_TYPE_MODIFIER = "(?:(?:(?:unsigned)|(?:signed)|(?:long)) *){0,2}"
83
+ REGEX_TYPE_SPECIFIER = "[ \*&]*(?:const)?[ \*&]*"
84
+ REGEX_IDENTIFIER = "(?:(?:[^\W\d]|~)(?:[^\W]|[<>\*&\[\]])*)"
85
+
86
+ REGEX_SPECIAL_IDENTIFIERS = "(?:\(anonymous namespace\))|(?:\{lambda\(\)#?\d*\})|(?:decltype ?\(\))"
87
+
88
+ REGEX_NON_SPEC_TYPE_IDENTIFIER = "(?:{type_modifier}{identifier})".format(
89
+ type_modifier=REGEX_TYPE_MODIFIER, identifier=REGEX_IDENTIFIER
90
+ )
91
+ REGEX_QUALIFIED_NON_SPEC_TYPE_IDENTIFIER = (
92
+ "{non_spec_type_id}{type_specifier}(?:::{non_spec_type_id}{type_specifier})*(?:(?:::)?)?".format(
93
+ non_spec_type_id=REGEX_NON_SPEC_TYPE_IDENTIFIER, type_specifier=REGEX_TYPE_SPECIFIER
94
+ )
95
+ )
96
+
97
+ OVERLOADED_OPERATORS_LIST = [
98
+ "+",
99
+ "-",
100
+ "*",
101
+ "/",
102
+ "%",
103
+ "^",
104
+ "&",
105
+ "|",
106
+ "~",
107
+ "!",
108
+ "=",
109
+ "<",
110
+ ">",
111
+ "+=",
112
+ "-=",
113
+ "*=",
114
+ "/=",
115
+ "%=",
116
+ "^=",
117
+ "&=",
118
+ "|=",
119
+ "<<",
120
+ ">>",
121
+ "<<=",
122
+ ">>=",
123
+ "==",
124
+ "!=",
125
+ "<=",
126
+ ">=",
127
+ "&&",
128
+ "||",
129
+ "++",
130
+ "--",
131
+ ",",
132
+ "->*",
133
+ "->",
134
+ "()",
135
+ "[",
136
+ "]",
137
+ "new",
138
+ "delete",
139
+ "new[]",
140
+ "delete[]",
141
+ ]
142
+
143
+ REGEX_OVERLOADED_OPERATORS_LIST = [re.escape(op) for op in OVERLOADED_OPERATORS_LIST]
144
+ REGEX_OPERATOR_OVERLOADS = "(?:" + ")|(?:".join(REGEX_OVERLOADED_OPERATORS_LIST) + ")"
145
+ REGEX_OPERATOR_IDENTIFIER = "(?:operator *(?:<>)?(?:{type_id}|(?:{operator_overloads}))?(?:<>)?)".format(
146
+ type_id=REGEX_QUALIFIED_NON_SPEC_TYPE_IDENTIFIER, operator_overloads=REGEX_OPERATOR_OVERLOADS
147
+ )
148
+
149
+ REGEX_TYPE_IDENTIFIER = "(?:{type_modifier}{identifier}|{special_ids}|{operator_id})".format(
150
+ type_modifier=REGEX_TYPE_MODIFIER,
151
+ identifier=REGEX_IDENTIFIER,
152
+ special_ids=REGEX_SPECIAL_IDENTIFIERS,
153
+ operator_id=REGEX_OPERATOR_IDENTIFIER,
154
+ )
155
+ REGEX_QUALIFIED_TYPE_IDENTIFIER = "{type_id}{type_specifier}(?:::{type_id}{type_specifier})*(?:(?:::)?)?".format(
156
+ type_id=REGEX_TYPE_IDENTIFIER, type_specifier=REGEX_TYPE_SPECIFIER
157
+ )
158
+
159
+ FUNCTION_NAME_DELIMITER = "(?:[ &\*>])"
160
+ FUNCTION_ARGUMENTS = "(?:\(\))?"
161
+
162
+ APPROXIMATE_FUNCTION_STRING = "^((?:(?:{type_specifier}{func_name_delimiter})?{qualified_type_id}(?:{func_name_delimiter}{type_specifier})?{func_name_delimiter}))?({qualified_type_id})(?:{func_arg}{type_specifier})?$".format(
163
+ qualified_type_id=REGEX_QUALIFIED_TYPE_IDENTIFIER,
164
+ func_name_delimiter=FUNCTION_NAME_DELIMITER,
165
+ func_arg=FUNCTION_ARGUMENTS,
166
+ type_specifier=REGEX_TYPE_SPECIFIER,
167
+ )
168
+ APPROXIMATE_FUNCTION_REGEX = re.compile(APPROXIMATE_FUNCTION_STRING, re.U)
169
+
170
+
171
+ def collapse_parentheses(str_, left_p, right_p):
172
+ """Collapse everything between matching left_p and right_p (including collapsing of nested matches)
173
+
174
+ Args:
175
+ str_ (string): String to collapse.
176
+ left_p (string): Left delimiter
177
+ right_p (string): Right delimiter
178
+
179
+ Returns:
180
+ string: Collapsed string.
181
+ """
182
+ shortened_str = ""
183
+ inner_value = ""
184
+ parentheses_lvl = 0
185
+ for c in str_:
186
+ if parentheses_lvl == 0 or (parentheses_lvl == 1 and c == right_p):
187
+ if c == right_p:
188
+ if inner_value == "anonymous namespace":
189
+ shortened_str += inner_value
190
+ inner_value = ""
191
+ shortened_str += c
192
+
193
+ if c == right_p:
194
+ parentheses_lvl -= 1
195
+ if parentheses_lvl == 1:
196
+ inner_value += c
197
+ if c == left_p:
198
+ parentheses_lvl += 1
199
+ return shortened_str
200
+
201
+
202
+ def shorten_function_name_approximately(full_function_def):
203
+ """Try to shorten function name (in some cases shortening may fail and return the original filename).
204
+
205
+ Args:
206
+ full_function_def (string): Original filename.
207
+
208
+ Returns:
209
+ string: Shortened or full function name.
210
+ """
211
+ prepared_function_def = collapse_parentheses(full_function_def, "(", ")")
212
+ prepared_function_def = collapse_parentheses(prepared_function_def, "<", ">")
213
+ prepared_function_def = collapse_parentheses(prepared_function_def, "[", "]")
214
+ prepared_function_def = re.sub(r"[\n\t\s]+", " ", prepared_function_def)
215
+ prepared_function_def = re.sub(r"([ \*\&>\}\)\]])const::", r"\1::", prepared_function_def)
216
+ prepared_function_def = re.sub(r"\(\) *::", "::", prepared_function_def)
217
+ m = re.search(APPROXIMATE_FUNCTION_REGEX, prepared_function_def)
218
+ # may be a function address or a complex function name
219
+ if not m:
220
+ return full_function_def
221
+
222
+ function_name = ""
223
+ if m.group(1) and m.group(1).find("operator") != -1 and m.group(2):
224
+ function_name = m.group(1) + " " + m.group(2)
225
+ function_name = re.sub(r"[\n\t\s]+", " ", function_name)
226
+ elif m.group(2):
227
+ function_name = m.group(2)
228
+ else:
229
+ function_name = full_function_def
230
+ return function_name
231
+
232
+
233
+ def shorten_func_names_approximately(flamegraph_row, full_function_names):
234
+ """Try to shorten function names (in some cases shortening may fail and return the original filenames).
235
+
236
+ Args:
237
+ flamegraph_row (string): String suitable for flamegraph with original function names
238
+ full_function_names (string): Use full function names with return type, arguments and expanded templates, if available.
239
+
240
+ Returns:
241
+ list[string]: List of shortened or full function names.
242
+ """
243
+ if full_function_names:
244
+ return flamegraph_row
245
+ flamegraph_parts = flamegraph_row.split(" ")
246
+ if len(flamegraph_parts) < 2:
247
+ return flamegraph_row
248
+ cycles_cnt = flamegraph_parts[-1]
249
+ full_function_defs = " ".join(flamegraph_parts[:-1]).split(";")
250
+ full_function_defs_wo_recursive = []
251
+ if len(full_function_defs) > 1:
252
+ prev_val = full_function_defs[0]
253
+ for val in full_function_defs[1:]:
254
+ if val != prev_val:
255
+ full_function_defs_wo_recursive.append(val)
256
+ else:
257
+ full_function_defs_wo_recursive = full_function_defs
258
+
259
+ flamegraph_row = ";".join(
260
+ [
261
+ shorten_function_name_approximately(full_function_def)
262
+ for full_function_def in full_function_defs_wo_recursive
263
+ ]
264
+ )
265
+
266
+ flamegraph_row += " {}".format(cycles_cnt)
267
+
268
+ return flamegraph_row
269
+
270
+
271
+ def check_cpu_samples_exists(conn):
272
+ """Check if CPU callstacks exist in SQLite database
273
+
274
+ Args:
275
+ conn: SQLite database connection
276
+
277
+ Returns:
278
+ bool: True if CPU callstacks exist in SQLite database
279
+ """
280
+ c = conn.cursor()
281
+ c.execute(SELECT_CALLCHAIN_TABLE_EXISTENCE)
282
+ if c.fetchone()[0] == 1:
283
+ return True
284
+
285
+ return False
286
+
287
+
288
+ def convert_to_collapsed(sqlite_db_path, outfile_name, full_function_names):
289
+ """Convert CPU callstacks from a SQLite database file to an output suitable for flamegraph.pl
290
+
291
+ Args:
292
+ sqlite_db_path (string): _description_
293
+ outfile_name (string): Path to a results file. If None or empty an output is written to stdout.
294
+ full_function_names (bool): Use full function names with return type, arguments and expanded templates, if available.
295
+ """
296
+ with sqlite3.connect(sqlite_db_path) as conn:
297
+ if not check_cpu_samples_exists(conn):
298
+ sys.stderr.write("Report does not contain CPU samples. Folded output will not be generated.\n")
299
+ return
300
+
301
+ c = conn.cursor()
302
+ c.execute(SELECT_CALLSTACKS)
303
+ if outfile_name:
304
+ with open(outfile_name, "w", encoding="utf-8") as outfile:
305
+ for row in c:
306
+ outfile.write(shorten_func_names_approximately(row[0], full_function_names) + "\n")
307
+ else:
308
+ for row in c:
309
+ print(shorten_func_names_approximately(row[0], full_function_names))
310
+
311
+
312
+ def export_to_sqlite(nsys_target_bin_path, nsys_rep_path, sqlite_db_path):
313
+ """Export Nsight Systems report to a SQLite database file
314
+
315
+ Args:
316
+ nsys_target_bin_path (string): Path to a target Nsight Systems binary.
317
+ nsys_rep_path (string): Path to a Nsight Systems report.
318
+ sqlite_db_path (string): Path to a SQLite database file.
319
+
320
+ Raises:
321
+ ChildProcessError
322
+ """
323
+ popen = subprocess.Popen([nsys_target_bin_path, "export", "--type", "sqlite", "-o", sqlite_db_path, nsys_rep_path])
324
+ stdout, stderr = popen.communicate()
325
+ exit_code = popen.wait()
326
+ if exit_code != 0:
327
+ err_str = "Nsight Systems CLI export failed with exit code {}: {}\n{}".format(
328
+ exit_code, (stdout or b"").decode("utf-8", "ignore"), (stderr or b"").decode("utf-8", "ignore")
329
+ )
330
+ print(err_str)
331
+ raise ChildProcessError(err_str)
332
+
333
+
334
+ def get_arm_type_target_path_part(arch):
335
+ """Get the folder name part identifying the current supported armv8 arch (SBSA or tegra)
336
+
337
+ Args:
338
+ arch (string): Current architecture
339
+
340
+ Returns:
341
+ string: "-sbsa", "-tegra" or ""
342
+ """
343
+ if arch != "armv8":
344
+ return ""
345
+
346
+ tegra_check_popen = subprocess.Popen(
347
+ "find /proc/device-tree/ -maxdepth 1 -name 'tegra*' || echo ERROR",
348
+ shell=True,
349
+ stdout=subprocess.PIPE,
350
+ stderr=subprocess.STDOUT,
351
+ )
352
+ tegra_check_output, _ = tegra_check_popen.communicate()
353
+ if (tegra_check_output or b"").decode("utf-8", "ignore").startswith("/"):
354
+ return "-tegra"
355
+
356
+ sbsa_check_popen = subprocess.Popen(
357
+ "lsmod | grep 'nvidia' || echo ERROR", shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT
358
+ )
359
+ sbsa_check_output, _ = sbsa_check_popen.communicate()
360
+ if (sbsa_check_output or b"").decode("utf-8", "ignore").startswith("nvidia"):
361
+ return "-sbsa"
362
+
363
+ return ""
364
+
365
+
366
+ def get_target_bin_path(nsys_target_bin_path_arg):
367
+ """Try to retrieve a Nsight Systems CLI path from argument (if it exists) or from the default installation path.
368
+ Args:
369
+ nsys_target_bin_path_arg (string): User path to the Nsight Systems CLI binary
370
+
371
+ Raises:
372
+ FileNotFoundError: Nsight Systems CLI not found
373
+
374
+ Returns:
375
+ string: Path to the Nsight Systems CLI binary.
376
+ """
377
+
378
+ if nsys_target_bin_path_arg:
379
+ nsys_target_search_path = Path(nsys_target_bin_path_arg) / NSYS_CLI_BINARY_NAME
380
+ if nsys_target_search_path.is_file():
381
+ return str(nsys_target_search_path)
382
+
383
+ nsys_host_path = Path(__file__).resolve().parent.parent.parent
384
+ nsys_host_folder_name = nsys_host_path.name
385
+ nsys_host_folder_name_parts = nsys_host_folder_name.split("-")
386
+ nsys_target_path = None
387
+ if len(nsys_host_folder_name_parts) == 3:
388
+ host_os = nsys_host_folder_name_parts[1]
389
+ # assume actual host architecture
390
+ host_arch = nsys_host_folder_name_parts[2]
391
+ nsys_target_folder_name = "target-" + host_os + get_arm_type_target_path_part(host_arch) + "-" + host_arch
392
+ nsys_target_search_path = nsys_host_path.parent / nsys_target_folder_name / NSYS_CLI_BINARY_NAME
393
+ if nsys_target_search_path.is_file():
394
+ nsys_target_path = str(nsys_target_search_path)
395
+
396
+ if not nsys_target_path:
397
+ raise FileNotFoundError(
398
+ "Nsight Systems CLI binary (nsys) not found."
399
+ 'Use "--nsys" argument to set an Nsight Systems CLI binary path.'
400
+ )
401
+ return nsys_target_path
402
+
403
+
404
+ def collapse_callstacks(nsys_target_bin_path, nsys_rep_path, outfile_name, full_function_names):
405
+ """Export CPU callstacks from a Nsight Systems report file to a SQLite database and
406
+ convert them to an output suitable for flamegraph.pl
407
+
408
+ Args:
409
+ nsys_target_bin_path (string): Path to a Nsight Systems CLI directory.
410
+ nsys_rep_path (string): Path to a Nsight Systems report.
411
+ outfile_name (string): Path to a results file. If None or empty an output is written to stdout.
412
+ full_function_names (bool): Use full function names with return type, arguments and expanded templates, if available.
413
+ """
414
+ with tempfile.TemporaryDirectory() as tmp_dir:
415
+ sqlite_db_path = os.path.join(tmp_dir, "db.sqlite")
416
+ export_to_sqlite(nsys_target_bin_path, nsys_rep_path, sqlite_db_path)
417
+ convert_to_collapsed(sqlite_db_path, outfile_name, full_function_names)
418
+
419
+
420
+ if __name__ == "__main__":
421
+ parser = argparse.ArgumentParser(
422
+ description="Script for parsing Nsight Systems report files containing CPU call stacks and producing an output"
423
+ "suitable for flamegraph.pl."
424
+ )
425
+ parser.add_argument("--nsys", action="store", help="Path to the Nsight Systems CLI directory", required=False)
426
+ parser.add_argument(
427
+ "-o",
428
+ "--out",
429
+ action="store",
430
+ help="Path to the output file name (by default an output is written to stdout)",
431
+ )
432
+ parser.add_argument(
433
+ "--full_function_names",
434
+ default=False,
435
+ action="store_true",
436
+ help="Use full function names with return type, arguments and expanded "
437
+ "templates, if available (default: false).",
438
+ )
439
+ parser.add_argument("nsys_rep_file", help="Nsight Systems report file path")
440
+ args = parser.parse_args()
441
+
442
+ custom_outfile_name = None
443
+ if "out" in args and args.out:
444
+ custom_outfile_name = args.out
445
+
446
+ collapse_callstacks(
447
+ get_target_bin_path(args.nsys), args.nsys_rep_file, custom_outfile_name, args.full_function_names
448
+ )
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/python/lib/gpustats.py ADDED
@@ -0,0 +1,239 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SPDX-FileCopyrightText: Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
3
+ #
4
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
5
+ # property and proprietary rights in and to this material, related
6
+ # documentation and any modifications thereto. Any use, reproduction,
7
+ # disclosure or distribution of this material and related documentation
8
+ # without an express license agreement from NVIDIA CORPORATION or
9
+ # its affiliates is strictly prohibited.
10
+
11
+ import nsysstats
12
+
13
+ # Used as intermediate class to create GPU operation tables including the profiling overhead.
14
+ class GPUOperation(nsysstats.ExpertSystemsReport):
15
+ query_union = """
16
+ UNION ALL
17
+ """
18
+
19
+ def __init__(self, dbfile, args=[]):
20
+ super().__init__(dbfile, args)
21
+
22
+ self._gpu_ops_tables = {
23
+ "GPU_CUDA": self._query_cuda_gpu_ops(),
24
+ "GPU_VULKAN": self._query_vulkan_gpu_ops(),
25
+ "GPU_OPENGL": self._query_opengl_gpu_ops(),
26
+ "GPU_DX12": self._query_dx12_gpu_ops()
27
+ }
28
+
29
+ self._gpu_ops_tables = {key: value for key, value in self._gpu_ops_tables.items() if value is not None}
30
+ self._query_gpu_ops_union = ""
31
+
32
+ def query_gpu_ops_union(self):
33
+ return self._query_gpu_ops_union
34
+
35
+ def _select_gpu_ops_columns(self, table: str, api: str, global_id='globalPid', device_id='deviceId', context_id='contextId'):
36
+ query = """
37
+ SELECT
38
+ start,
39
+ end,
40
+ ({GLOBAL_ID} >> 24) & 0x00FFFFFF AS pid,
41
+ {GLOBAL_ID} AS globalId,
42
+ {DEVICE_ID} AS deviceId,
43
+ {CONTEXT_ID} AS contextId,
44
+ '{API}' AS api
45
+ FROM
46
+ {TABLE}
47
+ WHERE
48
+ start > 0
49
+ """
50
+
51
+ return query.format(
52
+ TABLE = table,
53
+ GLOBAL_ID = global_id,
54
+ DEVICE_ID = device_id,
55
+ CONTEXT_ID = context_id,
56
+ API = api
57
+ )
58
+
59
+ def _add_profiling_overhead(self, gpu_ops_table: str, overhead_condition='false'):
60
+ if self.table_exists('PROFILER_OVERHEAD'):
61
+ # Add the profiling overhead to the GPU operation table
62
+ # 1. CTE "range": Get [min(start), max(end)] for each deviceId/PID. It will be
63
+ # used as the clipping range for overheads.
64
+ # 2. CTE "overhead": Select the profiling overhead that we want to take into
65
+ # account.
66
+ # 3. Duplicate overhead rows for each deviceId/PID. This will create a deviceId
67
+ # column that is not initially in the PROFILER_OVERHEAD table.
68
+ # Note: a profiling overhead on one thread affects all GPUs of the same
69
+ # process.
70
+ # 4. The overhead rows are combined with GPU operation rows.
71
+ query_overhead = """
72
+ WITH
73
+ gpuops AS (
74
+ {TABLE}
75
+ ),
76
+ range AS (
77
+ SELECT
78
+ min(start) AS start,
79
+ max(end) AS end,
80
+ pid,
81
+ globalId,
82
+ deviceId,
83
+ contextId,
84
+ api
85
+ FROM
86
+ gpuops
87
+ GROUP BY deviceId, pid
88
+ ),
89
+ overheadID AS (
90
+ SELECT
91
+ id
92
+ FROM
93
+ StringIds
94
+ WHERE
95
+ {CONDITION}
96
+ ),
97
+ overhead AS (
98
+ SELECT
99
+ po.start,
100
+ po.end,
101
+ (po.globalTid >> 24) & 0x00FFFFFF AS pid
102
+ FROM
103
+ PROFILER_OVERHEAD AS po
104
+ JOIN
105
+ overheadID AS co
106
+ ON co.id == po.nameId
107
+ )
108
+ SELECT
109
+ co.start,
110
+ co.end,
111
+ co.pid,
112
+ range.globalId,
113
+ range.deviceId,
114
+ range.contextId,
115
+ range.api
116
+ FROM
117
+ overhead AS co
118
+ JOIN
119
+ range
120
+ ON co.pid == range.pid
121
+ AND co.start > range.start
122
+ AND co.end < range.end
123
+ UNION ALL
124
+ SELECT
125
+ *
126
+ FROM
127
+ gpuops
128
+ """
129
+
130
+ gpu_ops_table = query_overhead.format(
131
+ TABLE = gpu_ops_table,
132
+ CONDITION = overhead_condition
133
+ )
134
+
135
+ return gpu_ops_table
136
+
137
+ def _query_cuda_gpu_ops(self):
138
+ sub_queries = []
139
+
140
+ kernel = 'CUPTI_ACTIVITY_KIND_KERNEL'
141
+ memcpy = 'CUPTI_ACTIVITY_KIND_MEMCPY'
142
+ memset = 'CUPTI_ACTIVITY_KIND_MEMSET'
143
+
144
+ if self.table_exists(kernel):
145
+ sub_queries.append(self._select_gpu_ops_columns(kernel, 'cuda'))
146
+
147
+ if self.table_exists(memcpy):
148
+ sub_queries.append(self._select_gpu_ops_columns(memcpy, 'cuda'))
149
+
150
+ if self.table_exists(memset):
151
+ sub_queries.append(self._select_gpu_ops_columns(memset, 'cuda'))
152
+
153
+ if len(sub_queries) == 0:
154
+ return
155
+
156
+ ops = self.query_union.join(sub_queries)
157
+ overhead_condition = "value == 'CUDA profiling data flush overhead' \
158
+ OR value == 'CUDA profiling stop overhead' \
159
+ OR value == 'CUDA profiling overhead'"
160
+ return self._add_profiling_overhead(ops, overhead_condition)
161
+
162
+ def _query_vulkan_gpu_ops(self):
163
+ vulkan = 'VULKAN_WORKLOAD'
164
+
165
+ if not self.table_exists(vulkan):
166
+ return None
167
+
168
+ self.table_col_checks[vulkan] = \
169
+ { 'gpu':
170
+ "{DBFILE} could not be analyzed due to missing 'gpu'."
171
+ " Please re-export the report file with a recent version of Nsight Systems." }
172
+
173
+ ops = self._select_gpu_ops_columns(vulkan, 'vulkan', 'globalTid', 'gpu')
174
+ return self._add_profiling_overhead(ops, "value == 'Vulkan profiling overhead'")
175
+
176
+ def _query_opengl_gpu_ops(self):
177
+ opengl = 'OPENGL_WORKLOAD'
178
+
179
+ if not self.table_exists(opengl):
180
+ return None
181
+
182
+ ops = self._select_gpu_ops_columns(opengl, 'opengl', 'globalTid', 'gpu')
183
+ return self._add_profiling_overhead(ops, "value == 'OpenGL profiling overhead'")
184
+
185
+ def _query_dx12_gpu_ops(self):
186
+ dx12 = 'DX12_WORKLOAD'
187
+
188
+ if not self.table_exists(dx12):
189
+ return None
190
+
191
+ self.table_col_checks[dx12] = \
192
+ { 'gpu':
193
+ "{DBFILE} could not be analyzed due to missing 'gpu'."
194
+ " Please re-export the report file with a recent version of Nsight Systems."}
195
+
196
+ ops = self._select_gpu_ops_columns(dx12, 'dx12', 'globalTid', 'gpu', 'shortContextId')
197
+ return self._add_profiling_overhead(ops, "value == 'DX12 profiling overhead'")
198
+
199
+ # Creates the GPU operation view for each API and combines them into one.
200
+ # query_to_apply is a string query that needs to be applied to each GPU operation view
201
+ # before the union. It must contain a placeholder with 'GPU_TABLE' as named index.
202
+ def create_gpu_ops_view(self, query_to_apply=None):
203
+ tables_to_union = []
204
+
205
+ create_gpu_view = """
206
+ CREATE TEMP VIEW {TABLE} AS
207
+ {QUERY}
208
+ """
209
+
210
+ query_gpu_ops = """
211
+ SELECT *
212
+ FROM {TABLE}
213
+ """
214
+
215
+ for table_name, query in self._gpu_ops_tables.items():
216
+ if query_to_apply is not None:
217
+ query = query_to_apply.format(GPU_TABLE = query)
218
+
219
+ errmsg = self._execute_statement(
220
+ create_gpu_view.format(
221
+ TABLE = table_name,
222
+ QUERY = query
223
+ )
224
+ )
225
+ if errmsg != None:
226
+ return errmsg
227
+
228
+ tables_to_union.append(query_gpu_ops.format(TABLE = table_name))
229
+
230
+ self._query_gpu_ops_union = self.query_union.join(tables_to_union)
231
+
232
+ def setup(self):
233
+ if len(self._gpu_ops_tables) == 0:
234
+ return "{DBFILE} could not be analyzed because it does not contain the required data." \
235
+ " Does the application launch GPU operations?"
236
+
237
+ err = super().setup()
238
+ if err != None:
239
+ return err
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/python/lib/kernel_helper.py ADDED
@@ -0,0 +1,188 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SPDX-FileCopyrightText: Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
3
+ #
4
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
5
+ # property and proprietary rights in and to this material, related
6
+ # documentation and any modifications thereto. Any use, reproduction,
7
+ # disclosure or distribution of this material and related documentation
8
+ # without an express license agreement from NVIDIA CORPORATION or
9
+ # its affiliates is strictly prohibited.
10
+
11
+ EVENT_TYPE_NVTX_DOMAIN_CREATE = 75
12
+ EVENT_TYPE_NVTX_PUSHPOP_RANGE = 59
13
+ EVENT_TYPE_NVTX_STARTEND_RANGE = 60
14
+ EVENT_TYPE_NVTXT_PUSHPOP_RANGE = 70
15
+ EVENT_TYPE_NVTXT_STARTEND_RANGE = 71
16
+
17
+ CREATE_RUNTIME_RIDX_STATEMENTS = [
18
+ f"""
19
+ DROP TABLE IF EXISTS temp.NVTX_EVENTS_MINMAXTS
20
+ """,
21
+
22
+ f"""
23
+ CREATE TEMP TABLE NVTX_EVENTS_MINMAXTS
24
+ AS SELECT
25
+ min(min(start), min(end)) AS min,
26
+ max(max(start), max(end)) AS max
27
+ FROM main.NVTX_EVENTS
28
+ WHERE
29
+ eventType == {EVENT_TYPE_NVTX_PUSHPOP_RANGE}
30
+ OR eventType == {EVENT_TYPE_NVTX_STARTEND_RANGE}
31
+ OR eventType == {EVENT_TYPE_NVTXT_PUSHPOP_RANGE}
32
+ OR eventType == {EVENT_TYPE_NVTXT_STARTEND_RANGE}
33
+ """,
34
+
35
+ f"""
36
+ DROP TABLE IF EXISTS temp.NVTX_EVENTS_RIDX
37
+ """,
38
+
39
+ f"""
40
+ CREATE VIRTUAL TABLE temp.NVTX_EVENTS_RIDX
41
+ USING rtree (
42
+ rangeId,
43
+ startTS,
44
+ endTS,
45
+ +startNS INTEGER,
46
+ +endNS INTEGER,
47
+ +tid INTEGER,
48
+ +name TEXT,
49
+ )
50
+ """,
51
+
52
+ f"""
53
+ INSERT INTO temp.NVTX_EVENTS_RIDX
54
+ SELECT
55
+ e.rowid AS rangeId,
56
+ rtree_scale(e.start,
57
+ (SELECT min FROM temp.NVTX_EVENTS_MINMAXTS),
58
+ (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)) AS startTS,
59
+ rtree_scale(ifnull(e.end, (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)),
60
+ (SELECT min FROM temp.NVTX_EVENTS_MINMAXTS),
61
+ (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)) AS endTS,
62
+ e.start AS startNS,
63
+ ifnull(e.end, (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS)) AS endNS,
64
+ e.globalTid AS tid,
65
+ COALESCE(sid.value, e.text) AS name
66
+ FROM
67
+ main.NVTX_EVENTS AS e
68
+ LEFT JOIN
69
+ StringIds AS sid
70
+ ON e.textId == sid.id
71
+ WHERE
72
+ (e.eventType == {EVENT_TYPE_NVTX_PUSHPOP_RANGE}
73
+ OR e.eventType == {EVENT_TYPE_NVTX_STARTEND_RANGE}
74
+ OR e.eventType == {EVENT_TYPE_NVTXT_PUSHPOP_RANGE}
75
+ OR e.eventType == {EVENT_TYPE_NVTXT_STARTEND_RANGE})
76
+ AND e.endGlobalTid IS NULL
77
+ """,
78
+
79
+ ]
80
+
81
+ QUERY_NVTX_KERNEL_NAME = """
82
+ WITH
83
+ kernel AS (
84
+ {KERNEL_TABLE}
85
+ ),
86
+ projection AS (
87
+ SELECT
88
+ kernel.rowid,
89
+ rt.name AS nvtxName,
90
+ max(rt.startNS) AS maxStart
91
+ FROM
92
+ kernel
93
+ LEFT JOIN
94
+ main.CUPTI_ACTIVITY_KIND_RUNTIME AS r
95
+ ON kernel.correlationId == r.correlationId
96
+ AND kernel.globalPid == (r.globalTid & 0xFFFFFFFFFF000000)
97
+ LEFT JOIN
98
+ temp.NVTX_EVENTS_RIDX AS rt
99
+ ON rt.startTS <= rtree_scale(r.start,
100
+ (SELECT min FROM temp.NVTX_EVENTS_MINMAXTS),
101
+ (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS))
102
+ AND rt.endTS >= rtree_scale(r.end,
103
+ (SELECT min FROM temp.NVTX_EVENTS_MINMAXTS),
104
+ (SELECT max FROM temp.NVTX_EVENTS_MINMAXTS))
105
+ AND rt.startNS <= r.start
106
+ AND rt.endNS >= r.end
107
+ AND rt.tid == r.globalTid
108
+ GROUP BY kernel.rowid
109
+ )
110
+ SELECT
111
+ kernel.*,
112
+ COALESCE(nvtxName || '/' || kernelName, kernelName) AS name
113
+ FROM
114
+ kernel
115
+ JOIN
116
+ projection
117
+ ON kernel.rowid == projection.rowid
118
+ """
119
+
120
+ QUERY_KERNEL_NAME = """
121
+ WITH
122
+ kernel AS (
123
+ {KERNEL_TABLE}
124
+ )
125
+ SELECT
126
+ *,
127
+ kernelName as name
128
+ FROM
129
+ kernel
130
+ """
131
+
132
+ QUERY_KERNEL = """
133
+ SELECT
134
+ kernel.rowid,
135
+ kernel.*,
136
+ sid.value AS kernelName
137
+ FROM
138
+ CUPTI_ACTIVITY_KIND_KERNEL as kernel
139
+ LEFT JOIN
140
+ StringIds AS sid
141
+ ON sid.id == coalesce(kernel.{NAME_COL_NAME}, kernel.demangledName)
142
+ """
143
+
144
+ # Create a temporary view named 'CUPTI_ACTIVITY_KIND_KERNEL_NAMED' by adding
145
+ # a new column 'name' to the 'CUPTI_ACTIVITY_KIND_KERNEL' table. This column
146
+ # gives the kernel string name, which can be either the base or mangled name,
147
+ # optionally prefixed by the corresponding NVTX range name based on the
148
+ # provided options.
149
+ def create_kernel_view(instance):
150
+ use_base = getattr(instance._parsed_args, 'base', False)
151
+ use_mangled = getattr(instance._parsed_args, 'mangled', False)
152
+ use_nvtx_name = getattr(instance._parsed_args, 'nvtx_name', False)
153
+
154
+ name_col_name = 'demangledName'
155
+ if use_base:
156
+ name_col_name = 'shortName'
157
+ elif use_mangled and instance.table_col_exists('CUPTI_ACTIVITY_KIND_KERNEL', 'mangledName'):
158
+ name_col_name = 'mangledName'
159
+
160
+ kernel_query = QUERY_KERNEL.format(NAME_COL_NAME = name_col_name)
161
+ if use_nvtx_name:
162
+ if not instance.table_exists('NVTX_EVENTS'):
163
+ return "{DBFILE} does not contain NV Tools Extension (NVTX) data."
164
+ if not instance.table_exists('CUPTI_ACTIVITY_KIND_RUNTIME'):
165
+ return "{DBFILE} does not contain CUDA API data."
166
+
167
+ for stmt in CREATE_RUNTIME_RIDX_STATEMENTS:
168
+ errmsg = instance._execute_statement(stmt)
169
+ if errmsg != None:
170
+ return errmsg
171
+
172
+ kernel_name_query = QUERY_NVTX_KERNEL_NAME.format(KERNEL_TABLE = kernel_query)
173
+ else:
174
+ kernel_name_query = QUERY_KERNEL_NAME.format(KERNEL_TABLE = kernel_query)
175
+
176
+ errmsg = instance._execute_statement(
177
+ 'DROP VIEW IF EXISTS temp.CUPTI_ACTIVITY_KIND_KERNEL_NAMED'
178
+ )
179
+ if errmsg != None:
180
+ return errmsg
181
+
182
+ errmsg = instance._execute_statement(
183
+ 'CREATE TEMP VIEW CUPTI_ACTIVITY_KIND_KERNEL_NAMED AS {QUERY}'.format(
184
+ QUERY = kernel_name_query
185
+ )
186
+ )
187
+ if errmsg != None:
188
+ return errmsg
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/python/lib/nsysstats.py ADDED
@@ -0,0 +1,616 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SPDX-FileCopyrightText: Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
3
+ #
4
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
5
+ # property and proprietary rights in and to this material, related
6
+ # documentation and any modifications thereto. Any use, reproduction,
7
+ # disclosure or distribution of this material and related documentation
8
+ # without an express license agreement from NVIDIA CORPORATION or
9
+ # its affiliates is strictly prohibited.
10
+
11
+ import sys
12
+ import inspect
13
+ import os.path
14
+ import urllib.parse
15
+ import csv
16
+ import sqlite3
17
+ import re
18
+ import argparse
19
+
20
+ class Report:
21
+
22
+ class Error(Exception):
23
+ pass
24
+
25
+ class Error_MissingDatabaseFile(Error):
26
+ def __init__(self, filename):
27
+ super().__init__(f'Database file {filename} does not exist.')
28
+
29
+ class Error_InvalidDatabaseFile(Error):
30
+ def __init__(self, filename):
31
+ super().__init__(f'Database file {filename} could not be opened and appears to be invalid.')
32
+
33
+ class Error_InvalidSQL(Error):
34
+ def __init__(self, sql):
35
+ super().__init__(f'Bad SQL statement: {sql}')
36
+
37
+ class Error_ArgumentError(Error):
38
+ def __init__(self, msg):
39
+ super().__init__(msg)
40
+
41
+ class ArgumentParser(argparse.ArgumentParser):
42
+ def __init__(self, **kwargs):
43
+ self._options = []
44
+ super().__init__(self, **kwargs)
45
+
46
+ def exit(self, status=0, message=None):
47
+ raise Report.Error_ArgumentError(message)
48
+
49
+ def error(self, message):
50
+ raise Report.Error_ArgumentError(message)
51
+
52
+ # Allow optional arguments without dashes.
53
+ def add_optional_arg(self, *args, **kwargs):
54
+ self._options.extend(args)
55
+ dash_args = []
56
+ for arg in args:
57
+ if arg[0] == '+':
58
+ dash_args.append(arg[1:])
59
+ else:
60
+ dash_args.append('--' + arg)
61
+ return self.add_argument(*dash_args, **kwargs)
62
+
63
+ def parse_optional_dashless_args(self, args, parsed_args=None):
64
+ formatted_args = []
65
+ for arg in args:
66
+ if arg.split('=')[0] in self._options:
67
+ arg = '--' + arg
68
+ formatted_args.append(arg)
69
+ return self.parse_args(formatted_args, namespace=parsed_args)
70
+
71
+ # SQL Aggregate function that takes two arguments: start and end. Finds the
72
+ # total duration where at least one range is active, but doesn't over-count
73
+ # when events overlap. Events can be fed in any order.
74
+ class SQLiteAggregateUniqueDuration:
75
+ def __init__(self):
76
+ self.segments = []
77
+
78
+ def step(self, start, end):
79
+ if start >= end:
80
+ return
81
+ new_segs = []
82
+ new_start = start
83
+ new_end = end
84
+
85
+ for s in self.segments:
86
+ if start <= s[1] and end >= s[0]:
87
+ new_start = min(new_start, s[0])
88
+ new_end = max(new_end, s[1])
89
+ else:
90
+ new_segs.append(s)
91
+
92
+ new_segs.append([new_start, new_end])
93
+ self.segments = new_segs
94
+
95
+ def finalize(self):
96
+ dur = 0
97
+ for s in self.segments:
98
+ dur += s[1] - s[0]
99
+ self.segments = []
100
+ return dur
101
+
102
+ EXIT_HELP = 25
103
+ EXIT_DB = 26
104
+ EXIT_NODATA = 27
105
+ EXIT_SCRIPT = 28
106
+ EXIT_INVALID_ARG = 29
107
+
108
+ DEFAULT_ROW_LIMIT = 50
109
+
110
+ _LOAD_TABLE_QUERY = """
111
+ SELECT name
112
+ FROM sqlite_master
113
+ WHERE type LIKE 'table'
114
+ OR type LIKE 'view';
115
+ """
116
+
117
+ _CREATE_FILTERED_VIEW_QUERY = """
118
+ CREATE TEMP VIEW {TABLE} AS
119
+ SELECT rowid, *
120
+ FROM main.{TABLE}
121
+ WHERE ((start >= {START} AND start < {END})
122
+ OR (end >= {START} AND end < {END})
123
+ OR (start < {START} AND end >= {END}))
124
+ """
125
+
126
+ _FIND_NVTX_RANGE_QUERY = """
127
+ WITH
128
+ domain AS (
129
+ SELECT
130
+ domainId,
131
+ globalTid,
132
+ text
133
+ FROM
134
+ NVTX_EVENTS
135
+ WHERE
136
+ eventType == 75 -- EVENT_TYPE_NVTX_DOMAIN_CREATE
137
+ )
138
+ SELECT
139
+ nvtx.start,
140
+ nvtx.end,
141
+ nvtx.globalTid
142
+ FROM
143
+ NVTX_EVENTS AS nvtx
144
+ LEFT JOIN
145
+ domain
146
+ ON nvtx.domainId == domain.domainId
147
+ AND nvtx.globalTid >> 24 == domain.globalTid >> 24
148
+ LEFT JOIN
149
+ StringIds AS sid
150
+ ON nvtx.textId == sid.id
151
+ WHERE
152
+ nvtx.eventType IN (59, 60, 70, 71) -- EVENT_TYPE_NVTX[T]_(PUSHPOP|STARTEND)_RANGE
153
+ AND coalesce(nvtx.text, sid.value) || coalesce('@' || domain.text, '') == '{NVTX_RANGE}'
154
+ ORDER BY 1
155
+ LIMIT 1 OFFSET {NVTX_IDX}
156
+ """
157
+
158
+ _boilerplate_statements = [
159
+ f'pragma cache_size=-{32 * 1024}', # Set main DB page cache to 32MB
160
+ f'pragma temp.cache_size=-{32 * 1024}', # Set temp DB page cache to 32MB
161
+ ]
162
+
163
+ _arg_opts = [
164
+ [['start'], {'type': int, 'help': 'start time used for filtering'}],
165
+ [['end'], {'type': int, 'help': 'end time used for filtering'}],
166
+ [['nvtx'], {'type': str, 'help': 'NVTX range and domain for filtering'}],
167
+ ]
168
+
169
+ script_name = None
170
+ display_name = 'NO NAME GIVEN'
171
+ usage = "{SCRIPT} -- NO USAGE INFORMATION PROVIDED"
172
+ should_display = True
173
+ table_checks = {}
174
+ table_col_checks = {}
175
+ statements = []
176
+ query = "SELECT 1 AS 'ONE'"
177
+
178
+ def __init__(self, dbfile, args=[]):
179
+ self._tables = None
180
+ self._dbcon = None
181
+ self._dbcur = None
182
+ self._dbfile = dbfile
183
+ self._args = []
184
+ self._headers = []
185
+ self._parsed_args = None
186
+ self._parser = None
187
+
188
+ if isinstance(args, argparse.Namespace):
189
+ self._parsed_args = args
190
+ else:
191
+ self._args = args
192
+
193
+ # Check DB file
194
+ if not os.path.exists(self._dbfile):
195
+ raise self.Error_MissingDatabaseFile(self._dbfile)
196
+
197
+ # Open DB file
198
+ dburi_query = {
199
+ 'mode': 'ro',
200
+ 'nolock': '1',
201
+ 'immutable': '1'
202
+ }
203
+
204
+ qstr = urllib.parse.urlencode(dburi_query)
205
+ urlstr = urllib.parse.urlunsplit(['file', '', os.path.abspath(self._dbfile), qstr, ''])
206
+ try:
207
+ self._dbcon = sqlite3.connect(urlstr, isolation_level=None, uri=True, check_same_thread=False)
208
+ except sqlite3.Error:
209
+ self._dbcon = None
210
+ raise self.Error_InvalidDatabaseFile(self._dbfile)
211
+
212
+ # attach helper functions
213
+ self._dbcon.create_aggregate('unique_duration', 2, self.SQLiteAggregateUniqueDuration)
214
+
215
+ # load tables
216
+ try:
217
+ cur = self._dbcon.execute(self._LOAD_TABLE_QUERY)
218
+ except sqlite3.Error:
219
+ raise self.Error_InvalidDatabaseFile(self._dbfile)
220
+
221
+ self._tables = set(r[0] for r in cur.fetchall())
222
+ self._dbfile_basename = os.path.basename(os.path.splitext(self._dbfile)[0])
223
+
224
+ def __del__(self):
225
+ if self._dbcon != None:
226
+ self._dbcon.close()
227
+
228
+ def table_exists(self, table):
229
+ return table in self._tables
230
+
231
+ def search_tables(self, regex_str):
232
+ regex = re.compile(regex_str)
233
+ matches = []
234
+ for t in self._tables:
235
+ if regex.search(t) != None:
236
+ matches.append(t)
237
+ return matches
238
+
239
+ def table_col_exists(self, table, col):
240
+ q = 'SELECT name FROM pragma_table_info(?) WHERE name = ?'
241
+ try:
242
+ cur = self._dbcon.execute(q, (table, col))
243
+ except sqlite3.Error:
244
+ raise self.Error_InvalidSQL(q)
245
+
246
+ return cur.fetchone() != None
247
+
248
+ def check_columns(self):
249
+ for table, columns in self.table_col_checks.items():
250
+ for col, errmsg in columns.items():
251
+ if not self.table_col_exists(table, col):
252
+ return errmsg
253
+
254
+ def setup(self):
255
+ for table, errmsg in self.table_checks.items():
256
+ if not self.table_exists(table):
257
+ return errmsg
258
+
259
+ errmsg = self.check_columns()
260
+ if errmsg != None:
261
+ return errmsg
262
+
263
+ self._parser = self.ArgumentParser(allow_abbrev=False)
264
+ for opt in self._get_arg_options():
265
+ self._parser.add_optional_arg(*opt[0], **opt[1])
266
+ self._parsed_args = self._parser.parse_optional_dashless_args(self._args, self._parsed_args)
267
+
268
+ pid = getattr(self._parsed_args, 'process', -1)
269
+ # Negative value indicates no filtering.
270
+ pid = None if pid < 0 else pid
271
+
272
+ tid = getattr(self._parsed_args, 'thread', -1)
273
+ tid = None if tid < 0 else tid
274
+
275
+ errmsg = self.filter_time_range(self._parsed_args.start,
276
+ self._parsed_args.end, self._parsed_args.nvtx, pid, tid)
277
+ if errmsg != None:
278
+ return errmsg
279
+
280
+ def get_statements(self):
281
+ return self.statements
282
+
283
+ def _execute_statement(self, stmt):
284
+ if self._dbcon == None:
285
+ raise RuntimeError(f'Called {__name__}() with invalid database connection.')
286
+
287
+ try:
288
+ self._dbcon.execute(stmt)
289
+ except sqlite3.Error as err:
290
+ return str(err)
291
+
292
+ def run_statements(self):
293
+ for stmt in self._boilerplate_statements:
294
+ errmsg = self._execute_statement(stmt)
295
+ if errmsg != None:
296
+ return errmsg
297
+
298
+ for stmt in self.get_statements():
299
+ errmsg = self._execute_statement(stmt)
300
+ if errmsg != None:
301
+ return errmsg
302
+
303
+ def get_query(self):
304
+ return self.query
305
+
306
+ def run_query(self):
307
+ csvw = csv.writer(sys.stdout)
308
+ qcur = self._dbcon.execute(self.get_query())
309
+ qcur.arraysize = 100
310
+ header = list(d[0] for d in qcur.description)
311
+ csvw.writerow(header)
312
+
313
+ rows = qcur.fetchmany()
314
+ while rows != []:
315
+ csvw.writerows(rows)
316
+ rows = qcur.fetchmany()
317
+
318
+ def start_query(self):
319
+ if self._dbcon == None:
320
+ raise RuntimeError(f'Called {__name__}() with invalid database connection.')
321
+ if self._dbcur != None:
322
+ raise RuntimeError(f'Called {__name__}() more than once.')
323
+
324
+ try:
325
+ self._dbcur = self._dbcon.execute(self.get_query())
326
+ except sqlite3.Error as err:
327
+ return str(err)
328
+ self._headers = list(d[0] for d in self._dbcur.description)
329
+
330
+ def get_query_row(self):
331
+ if self._dbcon == None:
332
+ raise RuntimeError(f'Called {__name__}() with invalid database connection.')
333
+ if self._dbcur == None:
334
+ raise RuntimeError(f'Called {__name__}() without valid query.')
335
+
336
+ row = self._dbcur.fetchone()
337
+ if row == None:
338
+ del self._dbcur
339
+ self._dbcur = None
340
+ return row
341
+
342
+ def _query_nvtx_filter_range(self, nvtx):
343
+ if self._dbcon == None:
344
+ raise RuntimeError(f'Called {__name__}() with invalid database connection.')
345
+
346
+ if not self.table_exists('NVTX_EVENTS'):
347
+ errmsg = "{DBFILE} does not contain NV Tools Extension (NVTX) data.".format(
348
+ DBFILE = self.dbfile)
349
+ return (errmsg, None, None, None)
350
+
351
+ if not self.table_exists('StringIds'):
352
+ errmsg = "{DBFILE} file does not contain StringIds table.".format(
353
+ DBFILE = self.dbfile)
354
+ return (errmsg, None, None, None)
355
+
356
+ nvtx_range = nvtx
357
+ nvtx_idx = 0
358
+
359
+ # Find last slash (in case name contains a slash) and try to
360
+ # convert integer behind it. If number won't convert, assume
361
+ # slash and anything trailing is part of the name.
362
+ slash_idx = nvtx.rfind("/")
363
+ if slash_idx != -1:
364
+ name = nvtx[:slash_idx]
365
+ numbStr = nvtx[slash_idx+1:]
366
+ numb = None
367
+ try:
368
+ numb = int(numbStr)
369
+ if numb < 0:
370
+ numb = None
371
+ except:
372
+ pass
373
+ if numb is not None:
374
+ nvtx_range = name
375
+ nvtx_idx = numb
376
+
377
+ try:
378
+ cur = self._dbcon.execute(self._FIND_NVTX_RANGE_QUERY.format(
379
+ NVTX_RANGE = nvtx_range, NVTX_IDX = nvtx_idx))
380
+ except sqlite3.Error as err:
381
+ return (str(err), None, None, None)
382
+
383
+ row = cur.fetchone()
384
+ if row:
385
+ return (None, row[0], row[1], row[2])
386
+
387
+ errmsg = "NVTX range '{NVTX_RANGE}' could not be found in {DBFILE}.".format(
388
+ NVTX_RANGE = nvtx,
389
+ DBFILE = self.dbfile)
390
+ return (errmsg, None, None, None)
391
+
392
+ # Filters tables according to start, end, and nvtx flags, if applicable.
393
+ # Tables that should NOT be filtered (e.g. those used for correlation ID matching)
394
+ # should be prefixed with 'main' in the query.
395
+ def filter_time_range(self, start, end, nvtx, pid, tid):
396
+ if all(val is None for val in (start, end, nvtx, pid, tid)):
397
+ return None
398
+
399
+ nvtx_globaltid = None
400
+ if nvtx is None:
401
+ start = 0 if start is None else start
402
+ # If no value is specified, set the end variable to the largest
403
+ # possible timestamp value.
404
+ end = 0x7FFFFFFFFFFFFFFF if end is None else end
405
+ else:
406
+ err, nvtx_start, nvtx_end, nvtx_globaltid = self._query_nvtx_filter_range(nvtx)
407
+ if err != None:
408
+ return err
409
+
410
+ start = nvtx_start if start is None else start
411
+ end = nvtx_end if end is None else end
412
+
413
+ if start > end:
414
+ return "The start time cannot be greater than the end time."
415
+
416
+ if (pid is not None or tid is not None) and nvtx is not None:
417
+ return "The 'nvtx' option cannot be used with 'pid' or 'tid'."
418
+
419
+ for table in self._tables:
420
+ if not self.table_col_exists(table, 'start') or not self.table_col_exists(table, 'end'):
421
+ continue
422
+
423
+ statement = self._CREATE_FILTERED_VIEW_QUERY.format(
424
+ TABLE = table, START = start, END = end)
425
+
426
+ if pid is not None:
427
+ if self.table_col_exists(table, 'globalTid'):
428
+ statement += ' AND (globalTid >> 24) & 0x00FFFFFF == {PID}'.format(PID = pid)
429
+ elif self.table_col_exists(table, 'globalPid'):
430
+ statement += ' AND (globalPid >> 24) & 0x00FFFFFF == {PID}'.format(PID = pid)
431
+
432
+ if tid is not None and self.table_col_exists(table, 'globalTid'):
433
+ statement += ' AND globalTid & 0x00FFFFFF == {TID}'.format(TID = tid)
434
+
435
+ if nvtx_globaltid is not None:
436
+ nvtx_pid = (nvtx_globaltid >> 24) & 0x00FFFFFF
437
+ nvtx_tid = nvtx_globaltid & 0x00FFFFFF
438
+
439
+ if self.table_col_exists(table, 'globalTid'):
440
+ if nvtx_pid != nvtx_tid:
441
+ # NVTX Push/Pop range.
442
+ statement += ' AND globalTid == {GLOBAL_TID}'.format(GLOBAL_TID = nvtx_globaltid)
443
+ else:
444
+ # NVTX Start/End range.
445
+ statement += ' AND globalTid >> 24 == {GLOBAL_TID} >> 24'.format(GLOBAL_TID = nvtx_globaltid)
446
+ elif self.table_col_exists(table, 'globalPid'):
447
+ statement += ' AND globalPid >> 24 == {GLOBAL_TID} >> 24'.format(GLOBAL_TID = nvtx_globaltid)
448
+
449
+ errmsg = self._execute_statement('DROP VIEW IF EXISTS temp.{TABLE}'.format(TABLE = table))
450
+ if errmsg != None:
451
+ return errmsg
452
+
453
+ errmsg = self._execute_statement(statement)
454
+ if errmsg != None:
455
+ return errmsg
456
+
457
+ @property
458
+ def dbfile(self):
459
+ return self._dbfile
460
+
461
+ @property
462
+ def dbfile_basename(self):
463
+ return self._dbfile_basename
464
+
465
+ @property
466
+ def parsed_args(self):
467
+ return self._parsed_args
468
+
469
+ @property
470
+ def headers(self):
471
+ return self._headers
472
+
473
+ @property
474
+ def dbcon(self):
475
+ return self._dbcon
476
+
477
+ @property
478
+ def tables(self):
479
+ return self._tables
480
+
481
+ @classmethod
482
+ def get_script_name(klass):
483
+ if klass.script_name == None:
484
+ klass.script_name = os.path.basename(inspect.getmodule(klass).__file__)
485
+ if klass.script_name.endswith('.py'):
486
+ klass.script_name = klass.script_name[0:-3]
487
+ return klass.script_name
488
+
489
+ @classmethod
490
+ def get_display_name(klass):
491
+ return klass.display_name
492
+
493
+ @classmethod
494
+ def get_usage_summary(klass):
495
+ return klass.get_usage().split("\n", 1)[0]
496
+
497
+ @classmethod
498
+ def get_usage(klass):
499
+ return klass.usage.format(
500
+ SCRIPT=klass.get_script_name(),
501
+ DISPLAY_NAME=klass.get_display_name(),
502
+ ROW_LIMIT=klass.DEFAULT_ROW_LIMIT)
503
+
504
+ @classmethod
505
+ def get_should_display(klass):
506
+ if klass.get_script_name()[0] == '_':
507
+ return False
508
+ return klass.should_display
509
+
510
+ @classmethod
511
+ def _get_arg_options(klass):
512
+ opts = []
513
+ for k in klass.__mro__:
514
+ if '_arg_opts' in k.__dict__:
515
+ opts.extend(k._arg_opts)
516
+ return opts
517
+
518
+ @classmethod
519
+ def Setup(klass, dbfile, args):
520
+ try:
521
+ report = klass(dbfile, args)
522
+ except (klass.Error_MissingDatabaseFile, klass.Error_InvalidDatabaseFile) as err:
523
+ return None, klass.EXIT_DB, str(err)
524
+
525
+ # If/when we upgrade to Python 3.9 or higher, look into passing
526
+ # exit_on_error=False to the ArgumentParser constructor and updating
527
+ # how errors are handled with the .exit() function.
528
+ try:
529
+ errmsg = report.setup()
530
+ except klass.Error_ArgumentError as ex:
531
+ return None, klass.EXIT_INVALID_ARG, str(ex)
532
+
533
+ if errmsg != None:
534
+ return None, klass.EXIT_NODATA, errmsg.format(DBFILE=report.dbfile)
535
+
536
+ errmsg = report.run_statements()
537
+ if errmsg != None:
538
+ return None, klass.EXIT_SCRIPT, errmsg
539
+
540
+ return report, None, None
541
+
542
+ @classmethod
543
+ def Report(klass, dbfile, args):
544
+ report, exitval, errmsg = klass.Setup(dbfile, args)
545
+ if report == None:
546
+ return None, exitval, errmsg
547
+
548
+ errmsg = report.start_query()
549
+ if errmsg != None:
550
+ return None, klass.EXIT_SCRIPT, errmsg
551
+
552
+ return report, None, None
553
+
554
+ @classmethod
555
+ def Main(klass):
556
+ if len(sys.argv) <= 1:
557
+ print(klass.get_usage())
558
+ exit(klass.EXIT_HELP)
559
+
560
+ dbfile = sys.argv[1]
561
+ args = sys.argv[2:]
562
+
563
+ report, exitval, errmsg = klass.Report(dbfile, args)
564
+ if report == None:
565
+ print(errmsg, file=sys.stderr)
566
+ exit(exitval)
567
+
568
+ csvw = csv.writer(sys.stdout)
569
+
570
+ first_row = True
571
+ while True:
572
+ row = report.get_query_row()
573
+ if row == None:
574
+ break
575
+ if first_row:
576
+ first_row = False
577
+ csvw.writerow(report.headers)
578
+ csvw.writerow(row)
579
+
580
+ class StatsReport(Report):
581
+
582
+ def MessageNoResult(self):
583
+ return "Report was successfully run, but no data was returned."
584
+
585
+ class ExpertSystemsReport(Report):
586
+
587
+ DEFAULT_ROW_LIMIT = 50
588
+
589
+ _arg_opts = [
590
+ [['rows'], {'type': int, 'help': 'max rows', 'default': DEFAULT_ROW_LIMIT}],
591
+ ]
592
+
593
+ def setup(self):
594
+ err = super().setup()
595
+ if err != None:
596
+ return err
597
+
598
+ self._row_limit = self.parsed_args.rows
599
+
600
+ message_advice = "NO ADVICE MESSAGE DEFINED"
601
+ message_noresult = "NO NON-RESULT MESSAGE DEFINED"
602
+
603
+ def MessageAdvice(self, extended=True):
604
+ if extended and hasattr(self, 'message_advice_extended'):
605
+ return self.message_advice_extended
606
+ return self.message_advice
607
+
608
+ def MessageNoResult(self):
609
+ return self.message_noresult
610
+
611
+ def MessageRowLimit(self, rows):
612
+ if self._row_limit <= 0 or rows < self._row_limit:
613
+ return ''
614
+ if self._row_limit == 1:
615
+ return 'Only the top result is displayed. More data may be available.'
616
+ return f"Only the top {rows} results are displayed. More data may be available."
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/README.txt ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ This Python code used by the Nsight Systems applications. This includes both
3
+ the "nsys" CLI application and the "nsys-ui" desktop application.
4
+
5
+
6
+ The "<nsys_install_dir>/reports" directory contains Python code used by the
7
+ stats and reporting feature.
8
+
9
+ The "<nsys_install_dir>/rules" directory contains Python code used by the
10
+ expert system feature.
11
+
12
+
13
+ These Python files are designed to be used as plug-in modules for the Nsight
14
+ Systems applications. THESE FILES ARE NOT DESIGNED TO BE RUN AS STANDALONE
15
+ SCRIPTS. Although it is possible to run some of these Python files directly,
16
+ this use-case is for building and testing, and not supported for general
17
+ customer use.
18
+
19
+
20
+
21
+ NSYS-UI DESKTOP APPLICATION
22
+ ---------------------------
23
+
24
+ To utilize these reports and rules in the "nsys-ui" desktop application,
25
+ please utilize the drop-down menu in the lower-right section of the
26
+ application window to select either stats or expert systems. Once that
27
+ pane is visible, you an select a specific report or rule from the list
28
+ on the left side of the pane. The results will be displayed on the right
29
+ side of the pane.
30
+
31
+
32
+
33
+ NSYS COMMAND LINE APPLICATION
34
+ -----------------------------
35
+
36
+ To run a stats report, please use the command:
37
+
38
+ $ nsys stats --report <report name> <input file>
39
+
40
+ To run an expert systems rule, please use the command:
41
+
42
+ $ nsys analyze --rule <rule name> <input file>
43
+
44
+ The <report name> or <rule name> is the name of the Python script without
45
+ the ".py" extension.
46
+
47
+ To get a full list of the available reports & rules, the following commands
48
+ can be used:
49
+
50
+ $ nsys stats --help-reports
51
+ $ nsys analyze --help-rules
52
+
53
+ For more detailed information about a specific report, use the commands:
54
+
55
+ $ nsys stats --help-reports <report name>
56
+ $ nsys analyze --help-rules <rule name>
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/_sql.py ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ # THIS SCRIPT FOR DEBUGGING AND TESTING ONLY
14
+ # THIS SCRIPT FOR DEBUGGING AND TESTING ONLY
15
+ # THIS SCRIPT FOR DEBUGGING AND TESTING ONLY
16
+ # THIS SCRIPT FOR DEBUGGING AND TESTING ONLY
17
+
18
+ import nsysstats
19
+
20
+ class TESTReportSQLStatement(nsysstats.StatsReport):
21
+
22
+ DEFAULT_QUERY='SELECT 1'
23
+
24
+ display_name = 'DEBUG: SQL Statement'
25
+ usage = f"""{{SCRIPT}}[:sql=<sql_statement>] -- Run SQL Statement
26
+
27
+ sql : Arbitrary SQLite statement
28
+
29
+ Output defined by <sql_statement>.
30
+
31
+ This report accepts and executes an arbitrary SQL statement.
32
+ It is mostly for debugging/testing. If no <sql_statement> is
33
+ given, the statement "{DEFAULT_QUERY}" is executed.
34
+ """
35
+
36
+ _arg_opts = [
37
+ [['sql'], {'type': str, 'help': 'SQL stmt', 'default': DEFAULT_QUERY}],
38
+ ]
39
+
40
+ def setup(self):
41
+ err = super().setup()
42
+ if err != None:
43
+ return err
44
+
45
+ self.query = self.parsed_args.sql
46
+
47
+ if __name__ == "__main__":
48
+ TESTReportSQLStatement.Main()
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/_sqlfile.py ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ # THIS SCRIPT FOR DEBUGGING AND TESTING ONLY
14
+ # THIS SCRIPT FOR DEBUGGING AND TESTING ONLY
15
+ # THIS SCRIPT FOR DEBUGGING AND TESTING ONLY
16
+ # THIS SCRIPT FOR DEBUGGING AND TESTING ONLY
17
+
18
+ import nsysstats
19
+
20
+ class TESTReportSQLFile(nsysstats.StatsReport):
21
+
22
+ display_name = 'DEBUG: SQL File'
23
+ usage = f"""{{SCRIPT}}:file=<sql_file> -- Run SQL statement from file
24
+
25
+ file : File with SQL statement(s)
26
+
27
+ Output defined by <sql_file>.
28
+
29
+ This report executes an arbitrary SQL statement found in the given filename.
30
+ It is mostly for debugging/testing. If no file is given, or if the file
31
+ does not exist or cannot be opened, an error is returned. The file should
32
+ contain only a single SQL statement.
33
+ """
34
+
35
+ _arg_opts = [
36
+ [['file'], {'type': str, 'help': 'SQL file'}],
37
+ ]
38
+
39
+ query = "SELECT 1 AS 'ONE'"
40
+
41
+ def setup(self):
42
+ err = super().setup()
43
+ if err != None:
44
+ return err
45
+
46
+ if self.parsed_args.file == None:
47
+ return 'No filename given'
48
+
49
+ filename = self.parsed_args.file
50
+ try:
51
+ with open(filename, "r") as file:
52
+ self.query = file.read()
53
+ except EnvironmentError:
54
+ return f"File {filename} could not be opened"
55
+
56
+ if __name__ == "__main__":
57
+ TESTReportSQLFile.Main()
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/_tbl.py ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ # THIS SCRIPT FOR DEBUGGING AND TESTING ONLY
14
+ # THIS SCRIPT FOR DEBUGGING AND TESTING ONLY
15
+ # THIS SCRIPT FOR DEBUGGING AND TESTING ONLY
16
+ # THIS SCRIPT FOR DEBUGGING AND TESTING ONLY
17
+
18
+ import nsysstats
19
+
20
+ class TESTReportSQLTable(nsysstats.StatsReport):
21
+
22
+ DEFAULT_TABLE = 'TARGET_INFO_GPU'
23
+
24
+ display_name = 'DEBUG: SQL Table'
25
+ usage = f"""{{SCRIPT}}[:table=<table_name>] -- Return Table
26
+
27
+ table : Name of an SQLite table
28
+
29
+ Output defined by <table_name>.
30
+
31
+ This report accepts a database table (or view) name and
32
+ executes the statement "SELECT * FROM <table_name>". It is
33
+ mostly for debugging/testing. If no <table_name> is given,
34
+ the table {DEFAULT_TABLE} will be used.
35
+ """
36
+
37
+ query_stub = "SELECT * FROM {TABLE}"
38
+
39
+ _arg_opts = [
40
+ [['table'], {'type': str, 'help': 'SQL table', 'default': DEFAULT_TABLE}],
41
+ ]
42
+
43
+ def setup(self):
44
+ err = super().setup()
45
+ if err != None:
46
+ return err
47
+
48
+ table_name = self.parsed_args.table
49
+ if not self.table_exists(table_name):
50
+ return f"{{DBFILE}} does not contain the table {table_name}"
51
+ self.query = self.query_stub.format(TABLE=table_name)
52
+
53
+ if __name__ == "__main__":
54
+ TESTReportSQLTable.Main()
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/_values.py ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ # THIS SCRIPT FOR DEBUGGING AND TESTING ONLY
14
+ # THIS SCRIPT FOR DEBUGGING AND TESTING ONLY
15
+ # THIS SCRIPT FOR DEBUGGING AND TESTING ONLY
16
+ # THIS SCRIPT FOR DEBUGGING AND TESTING ONLY
17
+
18
+ import nsysstats
19
+
20
+ class TESTReportSQLValues(nsysstats.StatsReport):
21
+
22
+ DEFAULT_VALUE = [1]
23
+
24
+ display_name = 'DEBUG: SQL Values'
25
+ usage = f"""{{SCRIPT}}[:<v>[:<v>]...] -- Return Provided Values
26
+
27
+ <v> : One or more values
28
+
29
+ Output:
30
+ Value : Values passed in as <v>
31
+
32
+ This report accepts one or more values, <v> and returns those
33
+ values as a single column data set. It is mostly for
34
+ debugging/testing. If no <v> is given, the single value
35
+ "{DEFAULT_VALUE[0]}" will be used. The SQLite file is not
36
+ used or accessed, other than for verification.
37
+ """
38
+
39
+ query_stub = """
40
+ WITH VAL_CTE (VALUE) AS ( VALUES {VALUES} )
41
+ SELECT VALUE AS VALUE FROM VAL_CTE
42
+ """
43
+
44
+ _arg_opts = [
45
+ [['+vals'], {'type': str, 'help': 'SQL values', 'nargs': '*'}],
46
+ ]
47
+
48
+ def setup(self):
49
+ err = super().setup()
50
+ if err != None:
51
+ return err
52
+
53
+ values = []
54
+ if len(self.parsed_args.vals) == 0:
55
+ values = self.DEFAULT_VALUE
56
+ else:
57
+ values = self.parsed_args.vals
58
+
59
+ self.query = self.query_stub.format(VALUES = ",".join(["('{v}')".format(v=val) for val in values]))
60
+
61
+ if __name__ == "__main__":
62
+ TESTReportSQLValues.Main()
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/apigpusum.py ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ import nsysstats
14
+
15
+ class CUDAAPIandGPUSummary(nsysstats.StatsReport):
16
+
17
+ display_name = 'DEPRECATED - Use cuda_api_gpu_sum instead'
18
+ usage = '{SCRIPT} -- {{DISPLAY_NAME}}'
19
+ should_display = False
20
+
21
+ query_stub = """
22
+ WITH
23
+ apigpu AS (
24
+ {SUB_QUERY}
25
+ ),
26
+ summary AS (
27
+ SELECT
28
+ name AS name,
29
+ category AS category,
30
+ sum(duration) AS total,
31
+ count(*) AS num,
32
+ avg(duration) AS avg,
33
+ median(duration) AS med,
34
+ min(duration) AS min,
35
+ max(duration) AS max,
36
+ stdev(duration) AS stddev
37
+ FROM
38
+ apigpu
39
+ GROUP BY 1
40
+ ),
41
+ totals AS (
42
+ SELECT sum(total) AS total
43
+ FROM summary
44
+ )
45
+ SELECT
46
+ round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%",
47
+ summary.total AS "Total Time:dur_ns",
48
+ summary.num AS "Instances",
49
+ round(summary.avg, 1) AS "Avg:dur_ns",
50
+ round(summary.med, 1) AS "Med:dur_ns",
51
+ summary.min AS "Min:dur_ns",
52
+ summary.max AS "Max:dur_ns",
53
+ round(summary.stddev, 1) AS "StdDev:dur_ns",
54
+ summary.category AS "Category",
55
+ summary.name AS "Operation"
56
+ FROM
57
+ summary
58
+ ORDER BY 2 DESC
59
+ ;
60
+ """
61
+
62
+ query_runtime = """
63
+ SELECT
64
+ CASE substr(str.value, -6, 2)
65
+ WHEN '_v' THEN substr(str.value, 1, length(str.value)-6)
66
+ ELSE str.value
67
+ END AS name,
68
+ rt.end - rt.start AS duration,
69
+ 'CUDA_API' AS category
70
+ FROM
71
+ CUPTI_ACTIVITY_KIND_RUNTIME AS rt
72
+ LEFT OUTER JOIN
73
+ StringIds AS str
74
+ ON str.id == rt.nameId
75
+ """
76
+
77
+ query_kernel = """
78
+ SELECT
79
+ str.value AS name,
80
+ kern.end - kern.start AS duration,
81
+ 'CUDA_KERNEL' AS category
82
+ FROM
83
+ CUPTI_ACTIVITY_KIND_KERNEL AS kern
84
+ LEFT OUTER JOIN
85
+ StringIds AS str
86
+ ON str.id == coalesce(kern.{NAME_COL_NAME}, kern.demangledName)
87
+ """
88
+
89
+ query_memcpy = """
90
+ SELECT
91
+ '[CUDA memcpy ' || mos.label || ']' AS name,
92
+ mcpy.end - mcpy.start AS duration,
93
+ 'MEMORY_OPER' AS category
94
+ FROM
95
+ CUPTI_ACTIVITY_KIND_MEMCPY as mcpy
96
+ JOIN
97
+ ENUM_CUDA_MEMCPY_OPER AS mos
98
+ ON mos.id == mcpy.copyKind
99
+ """
100
+
101
+ query_memset = """
102
+ SELECT
103
+ '[CUDA memset]' AS name,
104
+ end - start AS duration,
105
+ 'MEMORY_OPER' AS category
106
+ FROM
107
+ CUPTI_ACTIVITY_KIND_MEMSET
108
+ """
109
+
110
+ query_union = """
111
+ UNION ALL
112
+ """
113
+
114
+ _arg_opts = [
115
+ [['base'], {'action': 'store_true'}],
116
+ [['mangled'], {'action': 'store_true'}],
117
+ ]
118
+
119
+ def setup(self):
120
+ err = super().setup()
121
+ if err != None:
122
+ return err
123
+
124
+ name_col_name = 'demangledName'
125
+ if self.parsed_args.base:
126
+ name_col_name = 'shortName'
127
+ elif (self.parsed_args.mangled and
128
+ self.table_col_exists('CUPTI_ACTIVITY_KIND_KERNEL', 'mangledName')):
129
+ name_col_name = 'mangledName'
130
+
131
+ sub_queries = []
132
+
133
+ if self.table_exists('CUPTI_ACTIVITY_KIND_RUNTIME'):
134
+ sub_queries.append(self.query_runtime)
135
+
136
+ if self.table_exists('CUPTI_ACTIVITY_KIND_KERNEL'):
137
+ sub_queries.append(self.query_kernel.format(NAME_COL_NAME = name_col_name))
138
+
139
+ if self.table_exists('CUPTI_ACTIVITY_KIND_MEMCPY'):
140
+ if not self.table_exists('ENUM_CUDA_MEMCPY_OPER'):
141
+ return '{DBFILE} does not contain ENUM_CUDA_MEMCPY_OPER table.'
142
+ sub_queries.append(self.query_memcpy)
143
+
144
+ if self.table_exists('CUPTI_ACTIVITY_KIND_MEMSET'):
145
+ sub_queries.append(self.query_memset)
146
+
147
+ if len(sub_queries) == 0:
148
+ return '{DBFILE} does not contain CUDA API, GPU kernel, nor memory operations data.'
149
+
150
+ self.query = self.query_stub.format(SUB_QUERY = self.query_union.join(sub_queries))
151
+
152
+ if __name__ == "__main__":
153
+ CUDAAPIandGPUSummary.Main()
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/cuda_api_gpu_sum.py ADDED
@@ -0,0 +1,191 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ import kernel_helper
14
+ import nsysstats
15
+
16
+ class CudaApiGpuSum(nsysstats.StatsReport):
17
+
18
+ display_name = 'CUDA Summary (API/Kernels/MemOps)'
19
+ usage = f'''{{SCRIPT}}[:nvtx-name][:base|:mangled] -- {{DISPLAY_NAME}}
20
+
21
+ nvtx-name - Optional argument, if given, will prefix the kernel name with
22
+ the name of the innermost enclosing NVTX range.
23
+
24
+ base - Optional argument, if given, will cause summary to be over the
25
+ base name of the kernel, rather than the templated name.
26
+
27
+ mangled - Optional argument, if given, will cause summary to be over the
28
+ raw mangled name of the kernel, rather than the templated name.
29
+
30
+ Note: the ability to display mangled names is a recent addition to the
31
+ report file format, and requires that the profile data be captured with
32
+ a recent version of Nsys. Re-exporting an existing report file is not
33
+ sufficient. If the raw, mangled kernel name data is not available, the
34
+ default demangled names will be used.
35
+
36
+ Output: All time values default to nanoseconds
37
+ Time : Percentage of "Total Time"
38
+ Total Time : Total time used by all executions of this kernel
39
+ Instances : Number of executions of this kernel
40
+ Avg : Average execution time of this kernel
41
+ Med : Median execution time of this kernel
42
+ Min : Smallest execution time of this kernel
43
+ Max : Largest execution time of this kernel
44
+ StdDev : Standard deviation of execution time of this kernel
45
+ Category : Category of the operation
46
+ Operation : Name of the kernel
47
+
48
+ This report provides a summary of CUDA API calls, kernels and memory
49
+ operations, and their execution times. Note that the "Time"
50
+ column is calculated using a summation of the "Total Time" column,
51
+ and represents that API call's, kernel's, or memory operation's
52
+ percent of the execution time of the APIs, kernels and memory
53
+ operations listed, and not a percentage of the application wall or
54
+ CPU execution time.
55
+
56
+ This report combines data from the "cuda_api_sum", "cuda_gpu_kern_sum", and
57
+ "cuda_gpu_mem_size_sum" reports. It is very similar to profile section of
58
+ "nvprof --dependency-analysis".
59
+ '''
60
+
61
+ query_stub = """
62
+ WITH
63
+ apigpu AS (
64
+ {SUB_QUERY}
65
+ ),
66
+ summary AS (
67
+ SELECT
68
+ name AS name,
69
+ category AS category,
70
+ sum(duration) AS total,
71
+ count(*) AS num,
72
+ avg(duration) AS avg,
73
+ median(duration) AS med,
74
+ min(duration) AS min,
75
+ max(duration) AS max,
76
+ stdev(duration) AS stddev
77
+ FROM
78
+ apigpu
79
+ GROUP BY 1
80
+ ),
81
+ totals AS (
82
+ SELECT sum(total) AS total
83
+ FROM summary
84
+ )
85
+ SELECT
86
+ round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%",
87
+ summary.total AS "Total Time:dur_ns",
88
+ summary.num AS "Instances",
89
+ round(summary.avg, 1) AS "Avg:dur_ns",
90
+ round(summary.med, 1) AS "Med:dur_ns",
91
+ summary.min AS "Min:dur_ns",
92
+ summary.max AS "Max:dur_ns",
93
+ round(summary.stddev, 1) AS "StdDev:dur_ns",
94
+ summary.category AS "Category",
95
+ summary.name AS "Operation"
96
+ FROM
97
+ summary
98
+ ORDER BY 2 DESC
99
+ ;
100
+ """
101
+
102
+ query_runtime = """
103
+ SELECT
104
+ CASE substr(str.value, -6, 2)
105
+ WHEN '_v' THEN substr(str.value, 1, length(str.value)-6)
106
+ ELSE str.value
107
+ END AS name,
108
+ rt.end - rt.start AS duration,
109
+ 'CUDA_API' AS category
110
+ FROM
111
+ CUPTI_ACTIVITY_KIND_RUNTIME AS rt
112
+ LEFT OUTER JOIN
113
+ StringIds AS str
114
+ ON str.id == rt.nameId
115
+ """
116
+
117
+ query_kernel = """
118
+ SELECT
119
+ name,
120
+ end - start AS duration,
121
+ 'CUDA_KERNEL' AS category
122
+ FROM
123
+ CUPTI_ACTIVITY_KIND_KERNEL_NAMED
124
+ """
125
+
126
+ query_memcpy = """
127
+ SELECT
128
+ '[CUDA memcpy ' || mos.label || ']' AS name,
129
+ mcpy.end - mcpy.start AS duration,
130
+ 'MEMORY_OPER' AS category
131
+ FROM
132
+ CUPTI_ACTIVITY_KIND_MEMCPY as mcpy
133
+ JOIN
134
+ ENUM_CUDA_MEMCPY_OPER AS mos
135
+ ON mos.id == mcpy.copyKind
136
+ """
137
+
138
+ query_memset = """
139
+ SELECT
140
+ '[CUDA memset]' AS name,
141
+ end - start AS duration,
142
+ 'MEMORY_OPER' AS category
143
+ FROM
144
+ CUPTI_ACTIVITY_KIND_MEMSET
145
+ """
146
+
147
+ query_union = """
148
+ UNION ALL
149
+ """
150
+
151
+ _arg_opts = [
152
+ [['nvtx-name'], {'action': 'store_true'}],
153
+ [['base'], {'action': 'store_true'}],
154
+ [['mangled'], {'action': 'store_true'}],
155
+ ]
156
+
157
+ table_checks = {
158
+ 'StringIds': '{DBFILE} file does not contain StringIds table.'
159
+ }
160
+
161
+ def setup(self):
162
+ err = super().setup()
163
+ if err != None:
164
+ return err
165
+
166
+ sub_queries = []
167
+
168
+ if self.table_exists('CUPTI_ACTIVITY_KIND_RUNTIME'):
169
+ sub_queries.append(self.query_runtime)
170
+
171
+ if self.table_exists('CUPTI_ACTIVITY_KIND_KERNEL'):
172
+ err = kernel_helper.create_kernel_view(self)
173
+ if err != None:
174
+ return err
175
+ sub_queries.append(self.query_kernel)
176
+
177
+ if self.table_exists('CUPTI_ACTIVITY_KIND_MEMCPY'):
178
+ if not self.table_exists('ENUM_CUDA_MEMCPY_OPER'):
179
+ return '{DBFILE} does not contain ENUM_CUDA_MEMCPY_OPER table.'
180
+ sub_queries.append(self.query_memcpy)
181
+
182
+ if self.table_exists('CUPTI_ACTIVITY_KIND_MEMSET'):
183
+ sub_queries.append(self.query_memset)
184
+
185
+ if len(sub_queries) == 0:
186
+ return '{DBFILE} does not contain CUDA API, GPU kernel, nor memory operations data.'
187
+
188
+ self.query = self.query_stub.format(SUB_QUERY = self.query_union.join(sub_queries))
189
+
190
+ if __name__ == "__main__":
191
+ CudaApiGpuSum.Main()
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/cuda_api_sum.py ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ import nsysstats
14
+
15
+ class CudaApiSum(nsysstats.StatsReport):
16
+
17
+ display_name = 'CUDA API Summary'
18
+ usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}}
19
+
20
+ No arguments.
21
+
22
+ Output: All time values default to nanoseconds
23
+ Time : Percentage of "Total Time"
24
+ Total Time : Total time used by all executions of this function
25
+ Num Calls : Number of calls to this function
26
+ Avg : Average execution time of this function
27
+ Med : Median execution time of this function
28
+ Min : Smallest execution time of this function
29
+ Max : Largest execution time of this function
30
+ StdDev : Standard deviation of the time of this function
31
+ Name : Name of the function
32
+
33
+ This report provides a summary of CUDA API functions and their
34
+ execution times. Note that the "Time" column is calculated
35
+ using a summation of the "Total Time" column, and represents that
36
+ function's percent of the execution time of the functions listed,
37
+ and not a percentage of the application wall or CPU execution time.
38
+ """
39
+
40
+ query = """
41
+ WITH
42
+ summary AS (
43
+ SELECT
44
+ nameId AS nameId,
45
+ sum(end - start) AS total,
46
+ count(*) AS num,
47
+ avg(end - start) AS avg,
48
+ median(end - start) AS med,
49
+ min(end - start) AS min,
50
+ max(end - start) AS max,
51
+ stdev(end - start) AS stddev,
52
+ lower_quartile(end - start) AS q1,
53
+ upper_quartile(end - start) AS q3
54
+ FROM
55
+ CUPTI_ACTIVITY_KIND_RUNTIME
56
+ GROUP BY 1
57
+ ),
58
+ totals AS (
59
+ SELECT sum(total) AS total
60
+ FROM summary
61
+ )
62
+ SELECT
63
+ round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%",
64
+ summary.total AS "Total Time:dur_ns",
65
+ summary.num AS "Num Calls",
66
+ round(summary.avg, 1) AS "Avg:dur_ns",
67
+ round(summary.med, 1) AS "Med:dur_ns",
68
+ summary.min AS "Min:dur_ns",
69
+ summary.max AS "Max:dur_ns",
70
+ round(summary.stddev, 1) AS "StdDev:dur_ns",
71
+ CASE substr(ids.value, -6, 2)
72
+ WHEN '_v'
73
+ THEN substr(ids.value, 1, length(value)-6)
74
+ ELSE ids.value
75
+ END AS "Name",
76
+ summary.q1 AS "_Q1",
77
+ summary.q3 AS "_Q3"
78
+ FROM
79
+ summary
80
+ LEFT JOIN
81
+ StringIds AS ids
82
+ ON ids.id == summary.nameId
83
+ ORDER BY 2 DESC
84
+ ;
85
+ """
86
+
87
+ table_checks = {
88
+ 'StringIds': '{DBFILE} file does not contain StringIds table.',
89
+ 'CUPTI_ACTIVITY_KIND_RUNTIME':
90
+ '{DBFILE} does not contain CUDA trace data.'
91
+ }
92
+
93
+ if __name__ == "__main__":
94
+ CudaApiSum.Main()
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/cuda_api_trace.py ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ import nsysstats
14
+
15
+ class CudaApiTrace(nsysstats.StatsReport):
16
+
17
+ display_name = 'CUDA API Trace'
18
+ usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}}
19
+
20
+ No arguments.
21
+
22
+ Output: All time values default to nanoseconds
23
+ Start : Timestamp when API call was made
24
+ Duration : Length of API calls
25
+ Name : API function name
26
+ Result : Return value of API call
27
+ CorrID : Correlation used to map to other CUDA calls
28
+ Pid : Process ID that made the call
29
+ Tid : Tread ID that made the call
30
+ T-Pri : Run priority of call thread
31
+ Thread Name : Name of thread that called API function
32
+
33
+ This report provides a trace record of CUDA API function calls and
34
+ their execution times.
35
+ """
36
+
37
+ query = """
38
+ SELECT
39
+ api.start AS "Start:ts_ns",
40
+ api.end - api.start AS "Duration:dur_ns",
41
+ CASE substr(nstr.value, -6, 2)
42
+ WHEN '_v'THEN substr(nstr.value, 1, length(nstr.value)-6)
43
+ ELSE nstr.value
44
+ END AS "Name",
45
+ api.returnValue AS "Result",
46
+ api.correlationId AS "CorrID",
47
+ -- (api.globalTid >> 40) & 0xFF AS "HWid",
48
+ -- (api.globalTid >> 32) & 0xFF AS "VMid",
49
+ (api.globalTid >> 24) & 0xFFFFFF AS "Pid",
50
+ (api.globalTid ) & 0xFFFFFF AS "Tid",
51
+ tname.priority AS "T-Pri",
52
+ tstr.value AS "Thread Name"
53
+ FROM
54
+ CUPTI_ACTIVITY_KIND_RUNTIME AS api
55
+ LEFT OUTER JOIN
56
+ StringIds AS nstr
57
+ ON nstr.id == api.nameId
58
+ LEFT OUTER JOIN
59
+ ThreadNames AS tname
60
+ ON tname.globalTid == api.globalTid
61
+ LEFT OUTER JOIN
62
+ StringIds AS tstr
63
+ ON tstr.id == tname.nameId
64
+ ORDER BY 1
65
+ ;
66
+ """
67
+
68
+ table_checks = {
69
+ 'StringIds': '{DBFILE} file does not contain StringIds table.',
70
+ 'ThreadNames': '{DBFILE} file does not contain ThreadNames table.',
71
+ 'CUPTI_ACTIVITY_KIND_RUNTIME':
72
+ '{DBFILE} does not contain CUDA trace data.'
73
+ }
74
+
75
+ if __name__ == "__main__":
76
+ CudaApiTrace.Main()
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/cuda_gpu_kern_gb_sum.py ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ import kernel_helper
14
+ import nsysstats
15
+
16
+ class CudaGpuKernGBSum(nsysstats.StatsReport):
17
+
18
+ display_name = 'CUDA GPU Kernel/Grid/Block Summary'
19
+ usage = f"""{{SCRIPT}}[:nvtx-name][:base|:mangled] -- {{DISPLAY_NAME}}
20
+
21
+ nvtx-name - Optional argument, if given, will prefix the kernel name with
22
+ the name of the innermost enclosing NVTX range.
23
+
24
+ base - Optional argument, if given, will cause summary to be over the
25
+ base name of the kernel, rather than the templated name.
26
+
27
+ mangled - Optional argument, if given, will cause summary to be over the
28
+ raw mangled name of the kernel, rather than the templated name.
29
+
30
+ Note: the ability to display mangled names is a recent addition to the
31
+ report file format, and requires that the profile data be captured with
32
+ a recent version of Nsys. Re-exporting an existing report file is not
33
+ sufficient. If the raw, mangled kernel name data is not available, the
34
+ default demangled names will be used.
35
+
36
+ Output: All time values default to nanoseconds
37
+ Time : Percentage of "Total Time"
38
+ Total Time : Total time used by all executions of this kernel
39
+ Instances : Number of calls to this kernel
40
+ Avg : Average execution time of this kernel
41
+ Med : Median execution time of this kernel
42
+ Min : Smallest execution time of this kernel
43
+ Max : Largest execution time of this kernel
44
+ StdDev : Standard deviation of the time of this kernel
45
+ GridXYZ : Grid dimensions for kernel launch call
46
+ BlockXYZ : Block dimensions for kernel launch call
47
+ Name : Name of the kernel
48
+
49
+ This report provides a summary of CUDA kernels and their execution times.
50
+ Kernels are sorted by grid dimensions, block dimensions, and kernel name.
51
+ Note that the "Time" column is calculated using a summation of the "Total
52
+ Time" column, and represents that kernel's percent of the execution time
53
+ of the kernels listed, and not a percentage of the application wall or
54
+ CPU execution time.
55
+ """
56
+
57
+ query = """
58
+ WITH
59
+ summary AS (
60
+ SELECT
61
+ name,
62
+ sum(end - start) AS total,
63
+ count(*) AS num,
64
+ avg(end - start) AS avg,
65
+ median(end - start) AS med,
66
+ min(end - start) AS min,
67
+ max(end - start) AS max,
68
+ stdev(end - start) AS stddev,
69
+ gridX, gridY, gridZ,
70
+ blockX, blockY, blockZ,
71
+ lower_quartile(end - start) AS q1,
72
+ upper_quartile(end - start) AS q3
73
+ FROM
74
+ CUPTI_ACTIVITY_KIND_KERNEL_NAMED
75
+ GROUP BY 1, gridX, gridY, gridZ, blockX, blockY, blockZ
76
+ ),
77
+ totals AS (
78
+ SELECT sum(total) AS total
79
+ FROM summary
80
+ )
81
+ SELECT
82
+ round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%",
83
+ summary.total AS "Total Time:dur_ns",
84
+ summary.num AS "Instances",
85
+ round(summary.avg, 1) AS "Avg:dur_ns",
86
+ round(summary.med, 1) AS "Med:dur_ns",
87
+ summary.min AS "Min:dur_ns",
88
+ summary.max AS "Max:dur_ns",
89
+ round(summary.stddev, 1) AS "StdDev:dur_ns",
90
+ printf('%4d %4d %4d', gridX, gridY, gridZ) AS "GridXYZ",
91
+ printf('%4d %4d %4d', blockX, blockY, blockZ) AS "BlockXYZ",
92
+ summary.name AS "Name",
93
+ summary.q1 AS "_Q1",
94
+ summary.q3 AS "_Q3"
95
+ FROM
96
+ summary
97
+ ORDER BY 2 DESC, 3, "Name"
98
+ ;
99
+ """
100
+
101
+ table_checks = {
102
+ 'StringIds': '{DBFILE} file does not contain StringIds table.',
103
+ 'CUPTI_ACTIVITY_KIND_KERNEL':
104
+ '{DBFILE} does not contain CUDA kernel data.'
105
+ }
106
+
107
+ _arg_opts = [
108
+ [['nvtx-name'], {'action': 'store_true'}],
109
+ [['base'], {'action': 'store_true'}],
110
+ [['mangled'], {'action': 'store_true'}],
111
+ ]
112
+
113
+ def setup(self):
114
+ err = super().setup()
115
+ if err != None:
116
+ return err
117
+
118
+ err = kernel_helper.create_kernel_view(self)
119
+ if err != None:
120
+ return err
121
+
122
+ if __name__ == "__main__":
123
+ CudaGpuKernGBSum.Main()
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/cuda_gpu_kern_sum.py ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ import kernel_helper
14
+ import nsysstats
15
+
16
+ class CudaGpuKernSum(nsysstats.StatsReport):
17
+
18
+ display_name = 'CUDA GPU Kernel Summary'
19
+ usage = f"""{{SCRIPT}}[:nvtx-name][:base|:mangled] -- {{DISPLAY_NAME}}
20
+
21
+ PLEASE NOTE: In recent versions of Nsight Systems, this report was expanded
22
+ to include and sort by CUDA grid and block dimensions. This change was
23
+ made to accommodate developers doing a certain type of optimization work.
24
+ Unfortunately, this change caused an unexpected burden for developers doing
25
+ a different type of optimization work. In order to service both use-cases,
26
+ this report has been returned to the original form, without grid or block
27
+ information. A new report, called "cuda_gpu_kern_gb_sum", has been created
28
+ that retains the grid and block information.
29
+
30
+ nvtx-name - Optional argument, if given, will prefix the kernel name with
31
+ the name of the innermost enclosing NVTX range.
32
+
33
+ base - Optional argument, if given, will cause summary to be over the
34
+ base name of the kernel, rather than the templated name.
35
+
36
+ mangled - Optional argument, if given, will cause summary to be over the
37
+ raw mangled name of the kernel, rather than the templated name.
38
+
39
+ Note: the ability to display mangled names is a recent addition to the
40
+ report file format, and requires that the profile data be captured with
41
+ a recent version of Nsys. Re-exporting an existing report file is not
42
+ sufficient. If the raw, mangled kernel name data is not available, the
43
+ default demangled names will be used.
44
+
45
+ Output: All time values default to nanoseconds
46
+ Time : Percentage of "Total Time"
47
+ Total Time : Total time used by all executions of this kernel
48
+ Instances : Number of calls to this kernel
49
+ Avg : Average execution time of this kernel
50
+ Med : Median execution time of this kernel
51
+ Min : Smallest execution time of this kernel
52
+ Max : Largest execution time of this kernel
53
+ StdDev : Standard deviation of the time of this kernel
54
+ Name : Name of the kernel
55
+
56
+ This report provides a summary of CUDA kernels and their execution times.
57
+ Note that the "Time" column is calculated using a summation of the "Total
58
+ Time" column, and represents that kernel's percent of the execution time
59
+ of the kernels listed, and not a percentage of the application wall or
60
+ CPU execution time.
61
+ """
62
+
63
+ query = """
64
+ WITH
65
+ summary AS (
66
+ SELECT
67
+ name,
68
+ sum(end - start) AS total,
69
+ count(*) AS num,
70
+ avg(end - start) AS avg,
71
+ median(end - start) AS med,
72
+ min(end - start) AS min,
73
+ max(end - start) AS max,
74
+ stdev(end - start) AS stddev,
75
+ lower_quartile(end - start) AS q1,
76
+ upper_quartile(end - start) AS q3
77
+ FROM
78
+ CUPTI_ACTIVITY_KIND_KERNEL_NAMED
79
+ GROUP BY 1
80
+ ),
81
+ totals AS (
82
+ SELECT sum(total) AS total
83
+ FROM summary
84
+ )
85
+ SELECT
86
+ round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%",
87
+ summary.total AS "Total Time:dur_ns",
88
+ summary.num AS "Instances",
89
+ round(summary.avg, 1) AS "Avg:dur_ns",
90
+ round(summary.med, 1) AS "Med:dur_ns",
91
+ summary.min AS "Min:dur_ns",
92
+ summary.max AS "Max:dur_ns",
93
+ round(summary.stddev, 1) AS "StdDev:dur_ns",
94
+ summary.name AS "Name",
95
+ summary.q1 AS "_Q1",
96
+ summary.q3 AS "_Q3"
97
+ FROM
98
+ summary
99
+ ORDER BY 2 DESC, 3, "Name"
100
+ ;
101
+ """
102
+
103
+ table_checks = {
104
+ 'StringIds': '{DBFILE} file does not contain StringIds table.',
105
+ 'CUPTI_ACTIVITY_KIND_KERNEL':
106
+ '{DBFILE} does not contain CUDA kernel data.'
107
+ }
108
+
109
+ _arg_opts = [
110
+ [['nvtx-name'], {'action': 'store_true'}],
111
+ [['base'], {'action': 'store_true'}],
112
+ [['mangled'], {'action': 'store_true'}],
113
+ ]
114
+
115
+ def setup(self):
116
+ err = super().setup()
117
+ if err != None:
118
+ return err
119
+
120
+ err = kernel_helper.create_kernel_view(self)
121
+ if err != None:
122
+ return err
123
+
124
+ if __name__ == "__main__":
125
+ CudaGpuKernSum.Main()
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/cuda_gpu_mem_size_sum.py ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ import nsysstats
14
+ class CudaGpuMemSizeSum(nsysstats.StatsReport):
15
+
16
+ display_name = 'CUDA GPU MemOps Summary (by Size)'
17
+ usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}}
18
+
19
+ No arguments.
20
+
21
+ Output:
22
+ Total : Total memory utilized by this operation
23
+ Count : Number of executions of this operation
24
+ Avg : Average memory size of this operation
25
+ Med : Median memory size of this operation
26
+ Min : Smallest memory size of this operation
27
+ Max : Largest memory size of this operation
28
+ StdDev : Standard deviation of the memory size of this operation
29
+ Operation : Name of the operation
30
+
31
+ This report provides a summary of GPU memory operations and
32
+ the amount of memory they utilize.
33
+ """
34
+
35
+ query_stub = """
36
+ WITH
37
+ memops AS (
38
+ {MEM_SUB_QUERY}
39
+ ),
40
+ summary AS (
41
+ SELECT
42
+ name AS name,
43
+ sum(size) AS total,
44
+ count(*) AS num,
45
+ avg(size) AS avg,
46
+ median(size) AS med,
47
+ min(size) AS min,
48
+ max(size) AS max,
49
+ stdev(size) AS stddev,
50
+ lower_quartile(size) AS q1,
51
+ upper_quartile(size) AS q3
52
+ FROM memops
53
+ GROUP BY 1
54
+ )
55
+ SELECT
56
+ summary.total AS "Total:mem_B",
57
+ summary.num AS "Count",
58
+ summary.avg AS "Avg:mem_B",
59
+ summary.med AS "Med:mem_B",
60
+ summary.min AS "Min:mem_B",
61
+ summary.max AS "Max:mem_B",
62
+ summary.stddev AS "StdDev:mem_B",
63
+ summary.name AS "Operation",
64
+ summary.q1 AS "_Q1",
65
+ summary.q3 AS "_Q3"
66
+ FROM
67
+ summary
68
+ ORDER BY 1 DESC
69
+ ;
70
+ """
71
+
72
+ query_memcpy = """
73
+ SELECT
74
+ '[CUDA memcpy ' || mos.label || ']' AS name,
75
+ mcpy.bytes AS size
76
+ FROM
77
+ CUPTI_ACTIVITY_KIND_MEMCPY as mcpy
78
+ INNER JOIN
79
+ ENUM_CUDA_MEMCPY_OPER AS mos
80
+ ON mos.id == mcpy.copyKind
81
+ """
82
+
83
+ query_memset = """
84
+ SELECT
85
+ '[CUDA memset]' AS name,
86
+ bytes AS size
87
+ FROM
88
+ CUPTI_ACTIVITY_KIND_MEMSET
89
+ """
90
+
91
+ query_union = """
92
+ UNION ALL
93
+ """
94
+
95
+ def setup(self):
96
+ err = super().setup()
97
+ if err != None:
98
+ return err
99
+
100
+ sub_queries = []
101
+
102
+ if self.table_exists('CUPTI_ACTIVITY_KIND_MEMCPY'):
103
+ if not self.table_exists('ENUM_CUDA_MEMCPY_OPER'):
104
+ return '{DBFILE} does not contain ENUM_CUDA_MEMCPY_OPER table.'
105
+ sub_queries.append(self.query_memcpy)
106
+
107
+ if self.table_exists('CUPTI_ACTIVITY_KIND_MEMSET'):
108
+ sub_queries.append(self.query_memset)
109
+
110
+ if len(sub_queries) == 0:
111
+ return "{DBFILE} does not contain GPU memory data."
112
+
113
+ self.query = self.query_stub.format(MEM_SUB_QUERY = self.query_union.join(sub_queries))
114
+
115
+ if __name__ == "__main__":
116
+ CudaGpuMemSizeSum.Main()
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/cuda_gpu_mem_time_sum.py ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ import nsysstats
14
+
15
+ class CudaGpuMemTimeSum(nsysstats.StatsReport):
16
+
17
+ display_name = 'CUDA GPU MemOps Summary (by Time)'
18
+ usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}}
19
+
20
+ No arguments.
21
+
22
+ Output: All time values default to nanoseconds
23
+ Time : Percentage of "Total Time"
24
+ Total Time : Total time used by all executions of this operation
25
+ Count : Number of operations to this type
26
+ Avg : Average execution time of this operation
27
+ Med : Median execution time of this operation
28
+ Min : Smallest execution time of this operation
29
+ Max : Largest execution time of this operation
30
+ StdDev : Standard deviation of execution time of this operation
31
+ Operation : Name of the memory operation
32
+
33
+ This report provides a summary of GPU memory operations and
34
+ their execution times. Note that the "Time" column is calculated
35
+ using a summation of the "Total Time" column, and represents that
36
+ operation's percent of the execution time of the operations listed,
37
+ and not a percentage of the application wall or CPU execution time.
38
+ """
39
+
40
+ query_stub = """
41
+ WITH
42
+ memops AS (
43
+ {MEM_SUB_QUERY}
44
+ ),
45
+ summary AS (
46
+ SELECT
47
+ name AS name,
48
+ sum(duration) AS total,
49
+ count(*) AS num,
50
+ avg(duration) AS avg,
51
+ median(duration) AS med,
52
+ min(duration) AS min,
53
+ max(duration) AS max,
54
+ stdev(duration) AS stddev,
55
+ lower_quartile(duration) AS q1,
56
+ upper_quartile(duration) AS q3
57
+ FROM
58
+ memops
59
+ GROUP BY 1
60
+ ),
61
+ totals AS (
62
+ SELECT sum(total) AS total
63
+ FROM summary
64
+ )
65
+ SELECT
66
+ round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%",
67
+ summary.total AS "Total Time:dur_ns",
68
+ summary.num AS "Count",
69
+ round(summary.avg, 1) AS "Avg:dur_ns",
70
+ round(summary.med, 1) AS "Med:dur_ns",
71
+ summary.min AS "Min:dur_ns",
72
+ summary.max AS "Max:dur_ns",
73
+ round(summary.stddev, 1) AS "StdDev:dur_ns",
74
+ summary.name AS "Operation",
75
+ summary.q1 AS "_Q1",
76
+ summary.q3 AS "_Q3"
77
+ FROM
78
+ summary
79
+ ORDER BY 2 DESC
80
+ ;
81
+ """
82
+
83
+ query_memcpy = """
84
+ SELECT
85
+ '[CUDA memcpy ' || mos.label || ']' AS name,
86
+ mcpy.end - mcpy.start AS duration
87
+ FROM
88
+ CUPTI_ACTIVITY_KIND_MEMCPY as mcpy
89
+ INNER JOIN
90
+ ENUM_CUDA_MEMCPY_OPER AS mos
91
+ ON mos.id == mcpy.copyKind
92
+ """
93
+
94
+ query_memset = """
95
+ SELECT
96
+ '[CUDA memset]' AS name,
97
+ end - start AS duration
98
+ FROM
99
+ CUPTI_ACTIVITY_KIND_MEMSET
100
+ """
101
+
102
+ query_union = """
103
+ UNION ALL
104
+ """
105
+
106
+ def setup(self):
107
+ err = super().setup()
108
+ if err != None:
109
+ return err
110
+
111
+ sub_queries = []
112
+
113
+ if self.table_exists('CUPTI_ACTIVITY_KIND_MEMCPY'):
114
+ if not self.table_exists('ENUM_CUDA_MEMCPY_OPER'):
115
+ return '{DBFILE} does not contain ENUM_CUDA_MEMCPY_OPER table.'
116
+ sub_queries.append(self.query_memcpy)
117
+
118
+ if self.table_exists('CUPTI_ACTIVITY_KIND_MEMSET'):
119
+ sub_queries.append(self.query_memset)
120
+
121
+ if len(sub_queries) == 0:
122
+ return "{DBFILE} does not contain GPU memory data."
123
+
124
+ self.query = self.query_stub.format(MEM_SUB_QUERY = self.query_union.join(sub_queries))
125
+
126
+ if __name__ == "__main__":
127
+ CudaGpuMemTimeSum.Main()
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/cuda_gpu_sum.py ADDED
@@ -0,0 +1,172 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ import kernel_helper
14
+ import nsysstats
15
+
16
+ class CudaGpuSum(nsysstats.StatsReport):
17
+
18
+ display_name = 'CUDA GPU Summary (Kernels/MemOps)'
19
+ usage = f"""{{SCRIPT}}[:nvtx-name][:base|:mangled] -- {{DISPLAY_NAME}}
20
+
21
+ nvtx-name - Optional argument, if given, will prefix the kernel name with
22
+ the name of the innermost enclosing NVTX range.
23
+
24
+ base - Optional argument, if given, will cause summary to be over the
25
+ base name of the kernel, rather than the templated name.
26
+
27
+ mangled - Optional argument, if given, will cause summary to be over the
28
+ raw mangled name of the kernel, rather than the templated name.
29
+
30
+ Note: the ability to display mangled names is a recent addition to the
31
+ report file format, and requires that the profile data be captured with
32
+ a recent version of Nsys. Re-exporting an existing report file is not
33
+ sufficient. If the raw, mangled kernel name data is not available, the
34
+ default demangled names will be used.
35
+
36
+ Output: All time values default to nanoseconds
37
+ Time : Percentage of "Total Time"
38
+ Total Time : Total time used by all executions of this kernel
39
+ Instances : Number of executions of this kernel
40
+ Avg : Average execution time of this kernel
41
+ Med : Median execution time of this kernel
42
+ Min : Smallest execution time of this kernel
43
+ Max : Largest execution time of this kernel
44
+ StdDev : Standard deviation of execution time of this kernel
45
+ Category : Category of the operation
46
+ Operation : Name of the kernel
47
+
48
+ This report provides a summary of CUDA kernels and memory operations,
49
+ and their execution times. Note that the "Time" column is calculated
50
+ using a summation of the "Total Time" column, and represents that
51
+ kernel's or memory operation's percent of the execution time of the
52
+ kernels and memory operations listed, and not a percentage of the
53
+ application wall or CPU execution time.
54
+
55
+ This report combines data from the "cuda_gpu_kern_sum" and
56
+ "cuda_gpu_mem_time_sum" reports. This report is very similar to output of
57
+ the command "nvprof --print-gpu-summary".
58
+ """
59
+
60
+ query_stub = """
61
+ WITH
62
+ gpuops AS (
63
+ {GPU_SUB_QUERY}
64
+ ),
65
+ summary AS (
66
+ SELECT
67
+ name AS name,
68
+ category AS category,
69
+ sum(duration) AS total,
70
+ count(*) AS num,
71
+ avg(duration) AS avg,
72
+ median(duration) AS med,
73
+ min(duration) AS min,
74
+ max(duration) AS max,
75
+ stdev(duration) AS stddev
76
+ FROM
77
+ gpuops
78
+ GROUP BY 1
79
+ ),
80
+ totals AS (
81
+ SELECT sum(total) AS total
82
+ FROM summary
83
+ )
84
+ SELECT
85
+ round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%",
86
+ summary.total AS "Total Time:dur_ns",
87
+ summary.num AS "Instances",
88
+ round(summary.avg, 1) AS "Avg:dur_ns",
89
+ round(summary.med, 1) AS "Med:dur_ns",
90
+ summary.min AS "Min:dur_ns",
91
+ summary.max AS "Max:dur_ns",
92
+ round(summary.stddev, 1) AS "StdDev:dur_ns",
93
+ summary.category AS "Category",
94
+ summary.name AS "Operation"
95
+ FROM
96
+ summary
97
+ ORDER BY 2 DESC
98
+ ;
99
+ """
100
+
101
+ query_kernel = """
102
+ SELECT
103
+ name,
104
+ end - start AS duration,
105
+ 'CUDA_KERNEL' AS category
106
+ FROM
107
+ CUPTI_ACTIVITY_KIND_KERNEL_NAMED
108
+ """
109
+
110
+ query_memcpy = """
111
+ SELECT
112
+ '[CUDA memcpy ' || mos.label || ']' AS name,
113
+ mcpy.end - mcpy.start AS duration,
114
+ 'MEMORY_OPER' AS category
115
+ FROM
116
+ CUPTI_ACTIVITY_KIND_MEMCPY as mcpy
117
+ JOIN
118
+ ENUM_CUDA_MEMCPY_OPER AS mos
119
+ ON mos.id == mcpy.copyKind
120
+ """
121
+
122
+ query_memset = """
123
+ SELECT
124
+ '[CUDA memset]' AS name,
125
+ end - start AS duration,
126
+ 'MEMORY_OPER' AS category
127
+ FROM
128
+ CUPTI_ACTIVITY_KIND_MEMSET
129
+ """
130
+
131
+ query_union = """
132
+ UNION ALL
133
+ """
134
+
135
+ table_checks = {
136
+ 'StringIds': '{DBFILE} file does not contain StringIds table.'
137
+ }
138
+
139
+ _arg_opts = [
140
+ [['nvtx-name'], {'action': 'store_true'}],
141
+ [['base'], {'action': 'store_true'}],
142
+ [['mangled'], {'action': 'store_true'}],
143
+ ]
144
+
145
+ def setup(self):
146
+ err = super().setup()
147
+ if err != None:
148
+ return err
149
+
150
+ sub_queries = []
151
+
152
+ if self.table_exists('CUPTI_ACTIVITY_KIND_KERNEL'):
153
+ err = kernel_helper.create_kernel_view(self)
154
+ if err != None:
155
+ return err
156
+ sub_queries.append(self.query_kernel)
157
+
158
+ if self.table_exists('CUPTI_ACTIVITY_KIND_MEMCPY'):
159
+ if not self.table_exists('ENUM_CUDA_MEMCPY_OPER'):
160
+ return '{DBFILE} does not contain ENUM_CUDA_MEMCPY_OPER table.'
161
+ sub_queries.append(self.query_memcpy)
162
+
163
+ if self.table_exists('CUPTI_ACTIVITY_KIND_MEMSET'):
164
+ sub_queries.append(self.query_memset)
165
+
166
+ if len(sub_queries) == 0:
167
+ return "{DBFILE} does not contain GPU kernel/memory operations data."
168
+
169
+ self.query = self.query_stub.format(GPU_SUB_QUERY = self.query_union.join(sub_queries))
170
+
171
+ if __name__ == "__main__":
172
+ CudaGpuSum.Main()
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/cuda_gpu_trace.py ADDED
@@ -0,0 +1,257 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ import kernel_helper
14
+ import nsysstats
15
+
16
+ class CudaGpuTrace(nsysstats.StatsReport):
17
+
18
+ display_name = 'CUDA GPU Trace'
19
+ usage = f"""{{SCRIPT}}[:nvtx-name][:base|:mangled] -- {{DISPLAY_NAME}}
20
+
21
+ nvtx-name - Optional argument, if given, will prefix the kernel name with
22
+ the name of the innermost enclosing NVTX range.
23
+
24
+ base - Optional argument, if given, will display the base name of the
25
+ kernel, rather than the templated name.
26
+
27
+ mangled - Optional argument, if given, will display the raw mangled name
28
+ of the kernel, rather than the templated name.
29
+
30
+ Note: the ability to display mangled names is a recent addition to the
31
+ report file format, and requires that the profile data be captured with
32
+ a recent version of Nsys. Re-exporting an existing report file is not
33
+ sufficient. If the raw, mangled kernel name data is not available, the
34
+ default demangled names will be used.
35
+
36
+ Output: All time values default to nanoseconds
37
+ Start : Timestamp of start time
38
+ Duration : Length of event
39
+ CorrId : Correlation ID
40
+ GrdX, GrdY, GrdZ : Grid values
41
+ BlkX, BlkY, BlkZ : Block values
42
+ Reg/Trd : Registers per thread
43
+ StcSMem : Size of Static Shared Memory
44
+ DymSMem : Size of Dynamic Shared Memory
45
+ Bytes : Size of memory operation
46
+ Throughput : Memory throughput
47
+ SrcMemKd : Memcpy source memory kind or memset memory kind
48
+ DstMemKd : Memcpy destination memory kind
49
+ Device : GPU device name and ID
50
+ Ctx : Context ID
51
+ GreenCtx: Green context ID
52
+ Strm : Stream ID
53
+ Name : Trace event name
54
+
55
+ This report displays a trace of CUDA kernels and memory operations.
56
+ Items are sorted by start time.
57
+ """
58
+
59
+ query_stub = """
60
+ WITH
61
+ recs AS (
62
+ {GPU_SUB_QUERY}
63
+ )
64
+ SELECT
65
+ start AS "Start:ts_ns",
66
+ duration AS "Duration:dur_ns",
67
+ correlation AS "CorrId",
68
+ gridX AS "GrdX",
69
+ gridY AS "GrdY",
70
+ gridZ AS "GrdZ",
71
+ blockX AS "BlkX",
72
+ blockY AS "BlkY",
73
+ blockZ AS "BlkZ",
74
+ regsperthread AS "Reg/Trd",
75
+ ssmembytes AS "StcSMem:mem_B",
76
+ dsmembytes AS "DymSMem:mem_B",
77
+ bytes AS "Bytes:mem_B",
78
+ CASE
79
+ WHEN bytes IS NULL
80
+ THEN NULL
81
+ ELSE
82
+ bytes * (1000000000 / duration)
83
+ END AS "Throughput:thru_B",
84
+ srcmemkind AS "SrcMemKd",
85
+ dstmemkind AS "DstMemKd",
86
+ device AS "Device",
87
+ context AS "Ctx",
88
+ NULLIF(greenContext, 0) AS "GreenCtx",
89
+ stream AS "Strm",
90
+ name AS "Name"
91
+ FROM
92
+ recs
93
+ ORDER BY start;
94
+ """
95
+
96
+ query_kernel = """
97
+ SELECT
98
+ start AS "start",
99
+ (end - start) AS "duration",
100
+ gridX AS "gridX",
101
+ gridY AS "gridY",
102
+ gridZ AS "gridZ",
103
+ blockX AS "blockX",
104
+ blockY AS "blockY",
105
+ blockZ AS "blockZ",
106
+ registersPerThread AS "regsperthread",
107
+ staticSharedMemory AS "ssmembytes",
108
+ dynamicSharedMemory AS "dsmembytes",
109
+ NULL AS "bytes",
110
+ NULL AS "srcmemkind",
111
+ NULL AS "dstmemkind",
112
+ NULL AS "memsetval",
113
+ printf('%s (%d)', gpu.name, deviceId) AS "device",
114
+ contextId AS "context",
115
+ greenContextId AS "greenContext",
116
+ streamId AS "stream",
117
+ kern.name AS "name",
118
+ correlationId AS "correlation"
119
+ FROM
120
+ CUPTI_ACTIVITY_KIND_KERNEL_NAMED AS kern
121
+ LEFT JOIN
122
+ TARGET_INFO_GPU AS gpu
123
+ ON gpu.id == kern.deviceId
124
+ """
125
+
126
+ query_memcpy = """
127
+ SELECT
128
+ start AS "start",
129
+ (end - start) AS "duration",
130
+ NULL AS "gridX",
131
+ NULL AS "gridY",
132
+ NULL AS "gridZ",
133
+ NULL AS "blockX",
134
+ NULL AS "blockY",
135
+ NULL AS "blockZ",
136
+ NULL AS "regsperthread",
137
+ NULL AS "ssmembytes",
138
+ NULL AS "dsmembytes",
139
+ bytes AS "bytes",
140
+ msrck.label AS "srcmemkind",
141
+ mdstk.label AS "dstmemkind",
142
+ NULL AS "memsetval",
143
+ printf('%s (%d)', gpu.name, deviceId) AS "device",
144
+ contextId AS "context",
145
+ greenContextId AS "greenContext",
146
+ streamId AS "stream",
147
+ '[CUDA memcpy ' || memopstr.label || ']' AS "name",
148
+ correlationId AS "correlation"
149
+ FROM
150
+ CUPTI_ACTIVITY_KIND_MEMCPY AS memcpy
151
+ LEFT JOIN
152
+ ENUM_CUDA_MEMCPY_OPER AS memopstr
153
+ ON memcpy.copyKind == memopstr.id
154
+ LEFT JOIN
155
+ ENUM_CUDA_MEM_KIND AS msrck
156
+ ON memcpy.srcKind == msrck.id
157
+ LEFT JOIN
158
+ ENUM_CUDA_MEM_KIND AS mdstk
159
+ ON memcpy.dstKind == mdstk.id
160
+ LEFT JOIN
161
+ TARGET_INFO_GPU AS gpu
162
+ ON memcpy.deviceId == gpu.id
163
+ """
164
+
165
+ query_memset = """
166
+ SELECT
167
+ start AS "start",
168
+ (end - start) AS "duration",
169
+ NULL AS "gridX",
170
+ NULL AS "gridY",
171
+ NULL AS "gridZ",
172
+ NULL AS "blockX",
173
+ NULL AS "blockY",
174
+ NULL AS "blockZ",
175
+ NULL AS "regsperthread",
176
+ NULL AS "ssmembytes",
177
+ NULL AS "dsmembytes",
178
+ bytes AS "bytes",
179
+ mk.label AS "srcmemkind",
180
+ NULL AS "dstmemkind",
181
+ value AS "memsetval",
182
+ printf('%s (%d)', gpu.name, deviceId) AS "device",
183
+ contextId AS "context",
184
+ greenContextId AS "greenContext",
185
+ streamId AS "stream",
186
+ '[CUDA memset]' AS "name",
187
+ correlationId AS "correlation"
188
+ FROM
189
+ CUPTI_ACTIVITY_KIND_MEMSET AS memset
190
+ LEFT JOIN
191
+ ENUM_CUDA_MEM_KIND AS mk
192
+ ON memset.memKind == mk.id
193
+ LEFT JOIN
194
+ TARGET_INFO_GPU AS gpu
195
+ ON memset.deviceId == gpu.id
196
+ """
197
+
198
+ query_union = """
199
+ UNION ALL
200
+ """
201
+
202
+ _arg_opts = [
203
+ [['nvtx-name'], {'action': 'store_true'}],
204
+ [['base'], {'action': 'store_true'}],
205
+ [['mangled'], {'action': 'store_true'}],
206
+ ]
207
+
208
+ table_checks = {
209
+ 'StringIds': '{DBFILE} file does not contain StringIds table.',
210
+ 'TARGET_INFO_GPU': '{DBFILE} file does not contain TARGET_INFO_GPU table.'
211
+ }
212
+
213
+ def setup(self):
214
+ err = super().setup()
215
+ if err != None:
216
+ return err
217
+
218
+ col_checks = {
219
+ 'greenContextId':
220
+ "{DBFILE} does not contain 'greenContextId' column."
221
+ " Please re-export the report file with a recent version of Nsight Systems."
222
+ }
223
+
224
+ sub_queries = []
225
+
226
+ if self.table_exists('CUPTI_ACTIVITY_KIND_KERNEL'):
227
+ self.table_col_checks['CUPTI_ACTIVITY_KIND_KERNEL'] = col_checks
228
+ err = kernel_helper.create_kernel_view(self)
229
+ if err != None:
230
+ return err
231
+ sub_queries.append(self.query_kernel)
232
+
233
+ if self.table_exists('CUPTI_ACTIVITY_KIND_MEMCPY'):
234
+ self.table_col_checks['CUPTI_ACTIVITY_KIND_MEMCPY'] = col_checks
235
+ if not self.table_exists('ENUM_CUDA_MEMCPY_OPER'):
236
+ return '{DBFILE} does not contain ENUM_CUDA_MEMCPY_OPER table.'
237
+ if not self.table_exists('ENUM_CUDA_MEM_KIND'):
238
+ return '{DBFILE} does not contain ENUM_CUDA_MEM_KIND table.'
239
+ sub_queries.append(self.query_memcpy)
240
+
241
+ if self.table_exists('CUPTI_ACTIVITY_KIND_MEMSET'):
242
+ self.table_col_checks['CUPTI_ACTIVITY_KIND_MEMSET'] = col_checks
243
+ if not self.table_exists('ENUM_CUDA_MEM_KIND'):
244
+ return '{DBFILE} does not contain ENUM_CUDA_MEM_KIND table.'
245
+ sub_queries.append(self.query_memset)
246
+
247
+ if len(sub_queries) == 0:
248
+ return "{DBFILE} does not contain GPU trace data."
249
+
250
+ err = self.check_columns()
251
+ if err != None:
252
+ return err
253
+
254
+ self.query = self.query_stub.format(GPU_SUB_QUERY = self.query_union.join(sub_queries))
255
+
256
+ if __name__ == "__main__":
257
+ CudaGpuTrace.Main()
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/cuda_kern_exec_sum.py ADDED
@@ -0,0 +1,170 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ import kernel_helper
14
+ import nsysstats
15
+
16
+ class CudaKernExecSum(nsysstats.StatsReport):
17
+
18
+ display_name = 'CUDA Kernel Launch & Exec Time Summary'
19
+ usage = f"""{{SCRIPT}}[:nvtx-name][:base|:mangled] -- {{DISPLAY_NAME}}
20
+
21
+ nvtx-name - Optional argument, if given, will prefix the kernel name with
22
+ the name of the innermost enclosing NVTX range.
23
+
24
+ base - Optional argument, if given, will cause summary to be over the
25
+ base name of the kernel, rather than the templated name.
26
+
27
+ mangled - Optional argument, if given, will cause summary to be over the
28
+ raw mangled name of the kernel, rather than the templated name.
29
+
30
+ Note: the ability to display mangled names is a recent addition to the
31
+ report file format, and requires that the profile data be captured with
32
+ a recent version of Nsys. Re-exporting an existing report file is not
33
+ sufficient. If the raw, mangled kernel name data is not available, the
34
+ default demangled names will be used.
35
+
36
+ Output: All time values default to nanoseconds
37
+ PID : Process ID that made kernel launch call
38
+ TID : Tread ID that made kernel launch call
39
+ DevId : CUDA Device ID that executed kernel (which GPU)
40
+ Count : Number of kernel records
41
+ QCount : Number of kernel records with positive queue time
42
+ Average, Median, Minimum, Maximum, and Standard Deviation for:
43
+ TAvg, TMed, TMin, TMax, TStdDev : Total time
44
+ AAvg, AMed, AMin, AMax, AStdDev : API time
45
+ QAvg, QMed, QMin, QMax, QStdDev : Queue time
46
+ KAvg, KMed, KMin, KMax, KStdDev : Kernel time
47
+ API Name : Name of CUDA API call used to launch kernel
48
+ Kernel Name : Name of CUDA Kernel
49
+
50
+ This report provides a summary of the launch and execution times of CUDA
51
+ kernels. The launch and execution is broken down into three phases: "API
52
+ time," the execution time of the CUDA API call on the CPU used to launch the
53
+ kernel; "Queue time," the time between the launch call and the kernel
54
+ execution; and "Kernel time," the kernel execution time on the GPU. The
55
+ "total time" is not a just sum of the other times, as the phases sometimes
56
+ overlap. Rather, the total time runs from the start of the API call to end
57
+ of the API call or the end of the kernel execution, whichever is later.
58
+
59
+ The reported queue time is measured from the end of the API call to the
60
+ start of the kernel execution. The actual queue time is slightly longer, as
61
+ the kernel is enqueue somewhere in the middle of the API call, and not in
62
+ the final nanosecond of function execution. Due to this delay, it is
63
+ possible for kernel execution to start before the CUDA launch call returns.
64
+ In these cases, no queue time will be reported. Only kernel launches with
65
+ positive queue times are included in the queue average, minimum, maximum,
66
+ and standard deviation calculations. The "QCount" column indicates how many
67
+ launches had positive queue times (and how many launches were involved in
68
+ calculating the queue time statistics). Subtracting "QCount" from "Count"
69
+ will indicate how many kernels had no queue time.
70
+
71
+ Be aware that having a queue time is not inherently bad. Queue times
72
+ indicate that the GPU was busy running other tasks when the new kernel was
73
+ scheduled for launch. If every kernel launch is immediate, without any queue
74
+ time, that _may_ indicate an idle GPU with poor utilization. In terms of
75
+ performance optimization, it should not necessarily be a goal to eliminate
76
+ queue time.
77
+ """
78
+
79
+ query = """
80
+ WITH
81
+ runkern AS (
82
+ SELECT
83
+ (r.globalTid >> 24) & 0x00FFFFFF AS pid,
84
+ r.globalTid & 0x00FFFFFF AS tid,
85
+ k.deviceId AS deviceId,
86
+ r.end - r.start AS ApiDur,
87
+ iif(k.start - r.end >= 0, k.start - r.end, NULL) AS QueDur,
88
+ k.end - k.start AS KernDur,
89
+ max(r.end, k.end) - r.start AS totalDur,
90
+ CASE substr(rname.value, -6, 2)
91
+ WHEN '_v'
92
+ THEN substr(rname.value, 1, length(rname.value)-6)
93
+ ELSE rname.value
94
+ END AS apiName,
95
+ k.name AS kernName
96
+ FROM
97
+ CUPTI_ACTIVITY_KIND_KERNEL_NAMED AS k
98
+ JOIN
99
+ CUPTI_ACTIVITY_KIND_RUNTIME AS r
100
+ ON k.correlationId == r.correlationId
101
+ AND k.globalPid == (r.globalTid & 0xFFFFFFFFFF000000)
102
+ LEFT JOIN
103
+ StringIds AS rname
104
+ ON r.nameId == rname.id
105
+ )
106
+
107
+ SELECT
108
+ pid AS PID, -- 1
109
+ tid AS TID,
110
+ deviceId AS DevId,
111
+
112
+ count(*) AS Count,
113
+ count(QueDur) AS QCount, -- 5
114
+
115
+ round(avg(totalDur), 1) AS "TAvg:dur_ns",
116
+ round(median(totalDur), 1) AS "TMed:dur_ns",
117
+ min(totalDur) AS "TMin:dur_ns",
118
+ max(totalDur) AS "TMax:dur_ns",
119
+ round(stdev(totalDur), 1) AS "TStdDev:dur_ns", -- 10
120
+
121
+ round(avg(ApiDur), 1) AS "AAvg:dur_ns",
122
+ round(median(ApiDur), 1) AS "AMed:dur_ns",
123
+ min(ApiDur) AS "AMin:dur_ns",
124
+ max(ApiDur) AS "AMax:dur_ns",
125
+ round(stdev(ApiDur), 1) AS "AStdDev:dur_ns", -- 15
126
+
127
+ round(avg(QueDur), 1) AS "QAvg:dur_ns",
128
+ round(median(QueDur), 1) AS "QMed:dur_ns",
129
+ min(QueDur) AS "QMin:dur_ns",
130
+ max(QueDur) AS "QMax:dur_ns",
131
+ round(stdev(QueDur), 1) AS "QStdDev:dur_ns", -- 20
132
+
133
+ round(avg(KernDur), 1) AS "KAvg:dur_ns",
134
+ round(median(KernDur), 1) AS "KMed:dur_ns",
135
+ min(KernDur) AS "KMin:dur_ns",
136
+ max(KernDur) AS "KMax:dur_ns",
137
+ round(stdev(KernDur), 1) AS "KStdDev:dur_ns", -- 25
138
+
139
+ apiName AS "API Name",
140
+ kernName AS "Kernel Name" -- 27
141
+ FROM runkern
142
+ GROUP BY 1, 2, 3, 26, 27
143
+ ORDER BY 6 DESC
144
+ """
145
+
146
+ table_checks = {
147
+ 'StringIds': '{DBFILE} file does not contain StringIds table.',
148
+ 'CUPTI_ACTIVITY_KIND_KERNEL':
149
+ "{DBFILE} does not contain CUDA kernel data.",
150
+ 'CUPTI_ACTIVITY_KIND_RUNTIME':
151
+ "{DBFILE} does not contain CUDA API data.",
152
+ }
153
+
154
+ _arg_opts = [
155
+ [['nvtx-name'], {'action': 'store_true'}],
156
+ [['base'], {'action': 'store_true'}],
157
+ [['mangled'], {'action': 'store_true'}],
158
+ ]
159
+
160
+ def setup(self):
161
+ err = super().setup()
162
+ if err != None:
163
+ return err
164
+
165
+ err = kernel_helper.create_kernel_view(self)
166
+ if err != None:
167
+ return err
168
+
169
+ if __name__ == "__main__":
170
+ CudaKernExecSum.Main()
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/cuda_kern_exec_trace.py ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ import kernel_helper
14
+ import nsysstats
15
+
16
+ class CudaKernExecTrace(nsysstats.StatsReport):
17
+
18
+ display_name = 'CUDA Kernel Launch & Exec Time Trace'
19
+ usage = f"""{{SCRIPT}}[:nvtx-name][:base|:mangled] -- {{DISPLAY_NAME}}
20
+
21
+ nvtx-name - Optional argument, if given, will prefix the kernel name with
22
+ the name of the innermost enclosing NVTX range.
23
+
24
+ base - Optional argument, if given, will cause summary to be over the
25
+ base name of the kernel, rather than the templated name.
26
+
27
+ mangled - Optional argument, if given, will cause summary to be over the
28
+ raw mangled name of the kernel, rather than the templated name.
29
+
30
+ Note: the ability to display mangled names is a recent addition to the
31
+ report file format, and requires that the profile data be captured with
32
+ a recent version of Nsys. Re-exporting an existing report file is not
33
+ sufficient. If the raw, mangled kernel name data is not available, the
34
+ default demangled names will be used.
35
+
36
+ Output: All time values default to nanoseconds
37
+ API Start : Start timestamp of CUDA API launch call
38
+ API Dur : Duration of CUDA API launch call
39
+ Queue Start : Start timestamp of queue wait time, if it exists
40
+ Queue Dur : Duration of queue wait time, if it exists
41
+ Kernel Start : Start timestamp of CUDA kernel
42
+ Kernel Dur : Duration of CUDA kernel
43
+ Total Dur : Duration from API start to kernel end
44
+ PID : Process ID that made kernel launch call
45
+ TID : Thread ID that made kernel launch call
46
+ DevId : CUDA Device ID that executed kernel (which GPU)
47
+ API Function : Name of CUDA API call used to launch kernel
48
+ GridXYZ : Grid dimensions for kernel launch call
49
+ BlockXYZ : Block dimensions for kernel launch call
50
+ Kernel Name : Name of CUDA Kernel
51
+
52
+ This report provides a trace of the launch and execution time of each CUDA
53
+ kernel. The launch and execution is broken down into three phases: "API
54
+ time," the execution time of the CUDA API call on the CPU used to launch the
55
+ kernel; "Queue time," the time between the launch call and the kernel
56
+ execution; and "Kernel time," the kernel execution time on the GPU. The
57
+ "total time" is not a just sum of the other times, as the phases sometimes
58
+ overlap. Rather, the total time runs from the start of the API call to end
59
+ of the API call or the end of the kernel execution, whichever is later.
60
+
61
+ The reported queue time is measured from the end of the API call to the
62
+ start of the kernel execution. The actual queue time is slightly longer, as
63
+ the kernel is enqueue somewhere in the middle of the API call, and not in
64
+ the final nanosecond of function execution. Due to this delay, it is
65
+ possible for kernel execution to start before the CUDA launch call returns.
66
+ In these cases, no queue times will be reported.
67
+
68
+ Be aware that having a queue time is not inherently bad. Queue times
69
+ indicate that the GPU was busy running other tasks when the new kernel was
70
+ scheduled for launch. If every kernel launch is immediate, without any queue
71
+ time, that _may_ indicate an idle GPU with poor utilization. In terms of
72
+ performance optimization, it should not necessarily be a goal to eliminate
73
+ queue time.
74
+ """
75
+
76
+ query = """
77
+ SELECT
78
+ r.start AS "API Start:ts_ns",
79
+ r.end - r.start AS "API Dur:dur_ns",
80
+ iif(k.start - r.end >= 0, r.end, NULL) AS "Queue Start:ts_ns",
81
+ iif(k.start - r.end >= 0, k.start - r.end, NULL) AS "Queue Dur:dur_ns",
82
+ k.start AS "Kernel Start:ts_ns",
83
+ k.end - k.start AS "Kernel Dur:dur_ns",
84
+ max(r.end, k.end) - r.start AS "Total Dur:dur_ns",
85
+ (r.globalTid >> 24) & 0x00FFFFFF AS PID,
86
+ r.globalTid & 0x00FFFFFF AS TID,
87
+ k.deviceId AS DevId,
88
+ CASE substr(rname.value, -6, 2)
89
+ WHEN '_v'
90
+ THEN substr(rname.value, 1, length(rname.value)-6)
91
+ ELSE rname.value
92
+ END AS "API Function",
93
+ printf('%4d %4d %4d', k.gridX, k.gridY, k.gridZ) AS "GridXYZ",
94
+ printf('%4d %4d %4d', k.blockX, k.blockY, k.blockZ) AS "BlockXYZ",
95
+ k.name AS "Kernel Name"
96
+ FROM
97
+ CUPTI_ACTIVITY_KIND_KERNEL_NAMED AS k
98
+ JOIN
99
+ CUPTI_ACTIVITY_KIND_RUNTIME AS r
100
+ ON k.correlationId == r.correlationId
101
+ AND k.globalPid == (r.globalTid & 0xFFFFFFFFFF000000)
102
+ LEFT JOIN
103
+ StringIds AS rname
104
+ ON r.nameId == rname.id
105
+ ORDER BY 1
106
+ """
107
+
108
+ table_checks = {
109
+ 'StringIds': '{DBFILE} file does not contain StringIds table.',
110
+ 'CUPTI_ACTIVITY_KIND_KERNEL':
111
+ "{DBFILE} does not contain CUDA kernel data.",
112
+ 'CUPTI_ACTIVITY_KIND_RUNTIME':
113
+ "{DBFILE} does not contain CUDA API data.",
114
+ }
115
+
116
+ _arg_opts = [
117
+ [['nvtx-name'], {'action': 'store_true'}],
118
+ [['base'], {'action': 'store_true'}],
119
+ [['mangled'], {'action': 'store_true'}],
120
+ ]
121
+
122
+ def setup(self):
123
+ err = super().setup()
124
+ if err != None:
125
+ return err
126
+
127
+ err = kernel_helper.create_kernel_view(self)
128
+ if err != None:
129
+ return err
130
+
131
+ if __name__ == "__main__":
132
+ CudaKernExecTrace.Main()
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/cudaapisum.py ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ import nsysstats
14
+
15
+ class CUDAAPISummary(nsysstats.StatsReport):
16
+
17
+ display_name = 'DEPRECATED - Use cuda_api_sum instead'
18
+ usage = '{SCRIPT} -- {{DISPLAY_NAME}}'
19
+ should_display = False
20
+
21
+ query = """
22
+ WITH
23
+ summary AS (
24
+ SELECT
25
+ nameId AS nameId,
26
+ sum(end - start) AS total,
27
+ count(*) AS num,
28
+ avg(end - start) AS avg,
29
+ median(end - start) AS med,
30
+ min(end - start) AS min,
31
+ max(end - start) AS max,
32
+ stdev(end - start) AS stddev
33
+ FROM
34
+ CUPTI_ACTIVITY_KIND_RUNTIME
35
+ GROUP BY 1
36
+ ),
37
+ totals AS (
38
+ SELECT sum(total) AS total
39
+ FROM summary
40
+ )
41
+ SELECT
42
+ round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%",
43
+ summary.total AS "Total Time:dur_ns",
44
+ summary.num AS "Num Calls",
45
+ round(summary.avg, 1) AS "Avg:dur_ns",
46
+ round(summary.med, 1) AS "Med:dur_ns",
47
+ summary.min AS "Min:dur_ns",
48
+ summary.max AS "Max:dur_ns",
49
+ round(summary.stddev, 1) AS "StdDev:dur_ns",
50
+ CASE substr(ids.value, -6, 2)
51
+ WHEN '_v'
52
+ THEN substr(ids.value, 1, length(value)-6)
53
+ ELSE ids.value
54
+ END AS "Name"
55
+ FROM
56
+ summary
57
+ LEFT JOIN
58
+ StringIds AS ids
59
+ ON ids.id == summary.nameId
60
+ ORDER BY 2 DESC
61
+ ;
62
+ """
63
+
64
+ table_checks = {
65
+ 'CUPTI_ACTIVITY_KIND_RUNTIME':
66
+ '{DBFILE} does not contain CUDA trace data.'
67
+ }
68
+
69
+ if __name__ == "__main__":
70
+ CUDAAPISummary.Main()
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/cudaapitrace.py ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ import nsysstats
14
+
15
+ class CUDAAPITrace(nsysstats.StatsReport):
16
+
17
+ display_name = 'DEPRECATED - Use cuda_api_trace instead'
18
+ usage = '{SCRIPT} -- {{DISPLAY_NAME}}'
19
+ should_display = False
20
+
21
+ query = """
22
+ SELECT
23
+ api.start AS "Start:ts_ns",
24
+ api.end - api.start AS "Duration:dur_ns",
25
+ CASE substr(nstr.value, -6, 2)
26
+ WHEN '_v'THEN substr(nstr.value, 1, length(nstr.value)-6)
27
+ ELSE nstr.value
28
+ END AS "Name",
29
+ api.returnValue AS "Result",
30
+ api.correlationId AS "CorrID",
31
+ -- (api.globalTid >> 40) & 0xFF AS "HWid",
32
+ -- (api.globalTid >> 32) & 0xFF AS "VMid",
33
+ (api.globalTid >> 24) & 0xFFFFFF AS "Pid",
34
+ (api.globalTid ) & 0xFFFFFF AS "Tid",
35
+ tname.priority AS "T-Pri",
36
+ tstr.value AS "Thread Name"
37
+ FROM
38
+ CUPTI_ACTIVITY_KIND_RUNTIME AS api
39
+ LEFT OUTER JOIN
40
+ StringIds AS nstr
41
+ ON nstr.id == api.nameId
42
+ LEFT OUTER JOIN
43
+ ThreadNames AS tname
44
+ ON tname.globalTid == api.globalTid
45
+ LEFT OUTER JOIN
46
+ StringIds AS tstr
47
+ ON tstr.id == tname.nameId
48
+ ORDER BY 1
49
+ ;
50
+ """
51
+
52
+ table_checks = {
53
+ 'CUPTI_ACTIVITY_KIND_RUNTIME':
54
+ '{DBFILE} does not contain CUDA trace data.'
55
+ }
56
+
57
+ if __name__ == "__main__":
58
+ CUDAAPITrace.Main()
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/dx11_pix_sum.py ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ import nsysstats
14
+
15
+ class Dx11PixSum(nsysstats.StatsReport):
16
+
17
+ display_name = 'DX11 PIX Range Summary'
18
+ usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}}
19
+
20
+ No arguments.
21
+
22
+ Output: All time values default to nanoseconds
23
+ Time : Percentage of "Total Time"
24
+ Total Time : Total time used by all instances of this range
25
+ Instances : Number of instances of this range
26
+ Avg : Average execution time of this range
27
+ Med : Median execution time of this rage
28
+ Min : Smallest execution time of this range
29
+ Max : Largest execution time of this range
30
+ StdDev : Standard deviation of execution time of this range
31
+ Range : Name of the range
32
+
33
+ This report provides a summary of D3D11 PIX CPU debug markers,
34
+ and their execution times. Note that the "Time" column
35
+ is calculated using a summation of the "Total Time" column, and represents
36
+ that range's percent of the execution time of the ranges listed, and not a
37
+ percentage of the application wall or CPU execution time.
38
+ """
39
+
40
+ query = f"""
41
+ WITH
42
+ summary AS (
43
+ SELECT
44
+ begin.textId AS textId,
45
+ sum(end.start - begin.end) AS total,
46
+ count(*) AS num,
47
+ avg(end.start - begin.end) AS avg,
48
+ median(end.start - begin.end) AS med,
49
+ min(end.start - begin.end) AS min,
50
+ max(end.start - begin.end) AS max,
51
+ stdev(end.start - begin.end) AS stddev
52
+ FROM
53
+ D3D11_PIX_DEBUG_API AS begin
54
+ JOIN
55
+ D3D11_PIX_DEBUG_API AS end
56
+ ON begin.correlationId == end.correlationId
57
+ AND begin.globalTid == end.globalTid
58
+ WHERE begin.textId IS NOT NULL
59
+ AND end.textId IS NULL
60
+ GROUP BY 1
61
+ ),
62
+ totals AS (
63
+ SELECT sum(total) AS total
64
+ FROM summary
65
+ )
66
+
67
+ SELECT
68
+ round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%",
69
+ summary.total AS "Total Time:dur_ns",
70
+ summary.num AS "Instances",
71
+ round(summary.avg, 1) AS "Avg:dur_ns",
72
+ round(summary.med, 1) AS "Med:dur_ns",
73
+ summary.min AS "Min:dur_ns",
74
+ summary.max AS "Max:dur_ns",
75
+ round(summary.stddev, 1) AS "StdDev:dur_ns",
76
+ ids.value AS "Range"
77
+ FROM
78
+ summary
79
+ LEFT JOIN
80
+ StringIds AS ids
81
+ ON ids.id == summary.textId
82
+ WHERE summary.total > 0
83
+ ORDER BY 2 DESC
84
+ ;
85
+ """
86
+
87
+ table_checks = {
88
+ 'StringIds': '{DBFILE} file does not contain StringIds table.',
89
+ 'D3D11_PIX_DEBUG_API':
90
+ "{DBFILE} does not contain DX11 CPU debug markers."
91
+ }
92
+
93
+ if __name__ == "__main__":
94
+ Dx11PixSum.Main()
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/dx11pixsum.py ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ import nsysstats
14
+
15
+ class D3D11PIXSummary(nsysstats.StatsReport):
16
+
17
+ display_name = 'DEPRECATED - Use dx11_pix_sum instead'
18
+ usage = '{SCRIPT} -- {{DISPLAY_NAME}}'
19
+ should_display = False
20
+
21
+ query = f"""
22
+ WITH
23
+ summary AS (
24
+ SELECT
25
+ begin.textId AS textId,
26
+ sum(end.start - begin.end) AS total,
27
+ count(*) AS num,
28
+ avg(end.start - begin.end) AS avg,
29
+ median(end.start - begin.end) AS med,
30
+ min(end.start - begin.end) AS min,
31
+ max(end.start - begin.end) AS max,
32
+ stdev(end.start - begin.end) AS stddev
33
+ FROM
34
+ D3D11_PIX_DEBUG_API AS begin
35
+ JOIN
36
+ D3D11_PIX_DEBUG_API AS end
37
+ ON begin.correlationId == end.correlationId
38
+ AND begin.globalTid == end.globalTid
39
+ WHERE begin.textId IS NOT NULL
40
+ AND end.textId IS NULL
41
+ GROUP BY 1
42
+ ),
43
+ totals AS (
44
+ SELECT sum(total) AS total
45
+ FROM summary
46
+ )
47
+
48
+ SELECT
49
+ round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%",
50
+ summary.total AS "Total Time:dur_ns",
51
+ summary.num AS "Instances",
52
+ round(summary.avg, 1) AS "Avg:dur_ns",
53
+ round(summary.med, 1) AS "Med:dur_ns",
54
+ summary.min AS "Min:dur_ns",
55
+ summary.max AS "Max:dur_ns",
56
+ round(summary.stddev, 1) AS "StdDev:dur_ns",
57
+ ids.value AS "Range"
58
+ FROM
59
+ summary
60
+ LEFT JOIN
61
+ StringIds AS ids
62
+ ON ids.id == summary.textId
63
+ WHERE summary.total > 0
64
+ ORDER BY 2 DESC
65
+ ;
66
+ """
67
+
68
+ table_checks = {
69
+ 'D3D11_PIX_DEBUG_API':
70
+ "{DBFILE} does not contain DX11 CPU debug markers."
71
+ }
72
+
73
+ if __name__ == "__main__":
74
+ D3D11PIXSummary.Main()
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/dx12_gpu_marker_sum.py ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ import nsysstats
14
+
15
+ class Dx12GpuMarkerSum(nsysstats.StatsReport):
16
+
17
+ display_name = 'DX12 GPU Command List PIX Ranges Summary'
18
+ usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}}
19
+
20
+ No arguments.
21
+
22
+ Output: All time values default to nanoseconds
23
+ Time : Percentage of "Total Time"
24
+ Total Time : Total time used by all instances of this range
25
+ Instances : Number of instances of this range
26
+ Avg : Average execution time of this range
27
+ Med : Median execution time of this range
28
+ Min : Smallest execution time of this range
29
+ Max : Largest execution time of this range
30
+ StdDev : Standard deviation of execution time of this range
31
+ Range : Name of the range
32
+
33
+ This report provides a summary of DX12 PIX GPU command list debug markers,
34
+ and their execution times. Note that the "Time" column
35
+ is calculated using a summation of the "Total Time" column, and represents
36
+ that range's percent of the execution time of the ranges listed, and not a
37
+ percentage of the application wall or CPU execution time.
38
+ """
39
+
40
+ query = """
41
+ WITH
42
+ summary AS (
43
+ SELECT
44
+ wl.textId AS textId,
45
+ sum(wl.end - wl.start) AS total,
46
+ count(*) AS num,
47
+ avg(wl.end - wl.start) AS avg,
48
+ median(wl.end - wl.start) AS med,
49
+ min(wl.end - wl.start) AS min,
50
+ max(wl.end - wl.start) AS max,
51
+ stdev(wl.end - wl.start) AS stddev
52
+ FROM
53
+ DX12_WORKLOAD AS wl
54
+ WHERE wl.textId IS NOT NULL
55
+ GROUP BY 1
56
+ ),
57
+ totals AS (
58
+ SELECT sum(total) AS total
59
+ FROM summary
60
+ )
61
+
62
+ SELECT
63
+ round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%",
64
+ summary.total AS "Total Time:dur_ns",
65
+ summary.num AS "Instances",
66
+ round(summary.avg, 1) AS "Avg:dur_ns",
67
+ round(summary.med, 1) AS "Med:dur_ns",
68
+ summary.min AS "Min:dur_ns",
69
+ summary.max AS "Max:dur_ns",
70
+ round(summary.stddev, 1) AS "StdDev:dur_ns",
71
+ ids.value AS "Range"
72
+ FROM
73
+ summary
74
+ LEFT JOIN
75
+ StringIds AS ids
76
+ ON ids.id == summary.textId
77
+ WHERE summary.total > 0
78
+ ORDER BY 2 DESC
79
+ ;
80
+ """
81
+
82
+ table_checks = {
83
+ 'StringIds': '{DBFILE} file does not contain StringIds table.',
84
+ 'DX12_WORKLOAD':
85
+ "{DBFILE} does not contain DX12 GPU debug markers."
86
+ }
87
+
88
+ if __name__ == "__main__":
89
+ Dx12GpuMarkerSum.Main()
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/dx12_pix_sum.py ADDED
@@ -0,0 +1,94 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ import nsysstats
14
+
15
+ class Dx12PixSum(nsysstats.StatsReport):
16
+
17
+ display_name = 'DX12 PIX Range Summary'
18
+ usage = f"""{{SCRIPT}} -- {{DISPLAY_NAME}}
19
+
20
+ No arguments.
21
+
22
+ Output: All time values default to nanoseconds
23
+ Time : Percentage of "Total Time"
24
+ Total Time : Total time used by all instances of this range
25
+ Instances : Number of instances of this range
26
+ Avg : Average execution time of this range
27
+ Med : Median execution time of this range
28
+ Min : Smallest execution time of this range
29
+ Max : Largest execution time of this range
30
+ StdDev : Standard deviation of execution time of this range
31
+ Range : Name of the range
32
+
33
+ This report provides a summary of D3D12 PIX CPU debug markers,
34
+ and their execution times. Note that the "Time" column
35
+ is calculated using a summation of the "Total Time" column, and represents
36
+ that range's percent of the execution time of the ranges listed, and not a
37
+ percentage of the application wall or CPU execution time.
38
+ """
39
+
40
+ query = f"""
41
+ WITH
42
+ summary AS (
43
+ SELECT
44
+ begin.textId AS textId,
45
+ sum(end.start - begin.end) AS total,
46
+ count(*) AS num,
47
+ avg(end.start - begin.end) AS avg,
48
+ median(end.start - begin.end) AS med,
49
+ min(end.start - begin.end) AS min,
50
+ max(end.start - begin.end) AS max,
51
+ stdev(end.start - begin.end) AS stddev
52
+ FROM
53
+ D3D12_PIX_DEBUG_API AS begin
54
+ JOIN
55
+ D3D12_PIX_DEBUG_API AS end
56
+ ON begin.correlationId == end.correlationId
57
+ AND begin.globalTid == end.globalTid
58
+ WHERE begin.textId IS NOT NULL
59
+ AND end.textId IS NULL
60
+ GROUP BY 1
61
+ ),
62
+ totals AS (
63
+ SELECT sum(total) AS total
64
+ FROM summary
65
+ )
66
+
67
+ SELECT
68
+ round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%",
69
+ summary.total AS "Total Time:dur_ns",
70
+ summary.num AS "Instances",
71
+ round(summary.avg, 1) AS "Avg:dur_ns",
72
+ round(summary.med, 1) AS "Med:dur_ns",
73
+ summary.min AS "Min:dur_ns",
74
+ summary.max AS "Max:dur_ns",
75
+ round(summary.stddev, 1) AS "StdDev:dur_ns",
76
+ ids.value AS "Range"
77
+ FROM
78
+ summary
79
+ LEFT JOIN
80
+ StringIds AS ids
81
+ ON ids.id == summary.textId
82
+ WHERE summary.total > 0
83
+ ORDER BY 2 DESC
84
+ ;
85
+ """
86
+
87
+ table_checks = {
88
+ 'StringIds': '{DBFILE} file does not contain StringIds table.',
89
+ 'D3D12_PIX_DEBUG_API':
90
+ "{DBFILE} does not contain DX12 CPU debug markers."
91
+ }
92
+
93
+ if __name__ == "__main__":
94
+ Dx12PixSum.Main()
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/dx12gpumarkersum.py ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ import nsysstats
14
+
15
+ class DX12GpuMarkerSummary(nsysstats.StatsReport):
16
+
17
+ display_name = 'DEPRECATED - Use dx12_gpu_marker_sum instead'
18
+ usage = '{SCRIPT} -- {{DISPLAY_NAME}}'
19
+ should_display = False
20
+
21
+ query = """
22
+ WITH
23
+ summary AS (
24
+ SELECT
25
+ wl.textId AS textId,
26
+ sum(wl.end - wl.start) AS total,
27
+ count(*) AS num,
28
+ avg(wl.end - wl.start) AS avg,
29
+ median(wl.end - wl.start) AS med,
30
+ min(wl.end - wl.start) AS min,
31
+ max(wl.end - wl.start) AS max,
32
+ stdev(wl.end - wl.start) AS stddev
33
+ FROM
34
+ DX12_WORKLOAD AS wl
35
+ WHERE wl.textId IS NOT NULL
36
+ GROUP BY 1
37
+ ),
38
+ totals AS (
39
+ SELECT sum(total) AS total
40
+ FROM summary
41
+ )
42
+
43
+ SELECT
44
+ round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%",
45
+ summary.total AS "Total Time:dur_ns",
46
+ summary.num AS "Instances",
47
+ round(summary.avg, 1) AS "Avg:dur_ns",
48
+ round(summary.med, 1) AS "Med:dur_ns",
49
+ summary.min AS "Min:dur_ns",
50
+ summary.max AS "Max:dur_ns",
51
+ round(summary.stddev, 1) AS "StdDev:dur_ns",
52
+ ids.value AS "Range"
53
+ FROM
54
+ summary
55
+ LEFT JOIN
56
+ StringIds AS ids
57
+ ON ids.id == summary.textId
58
+ WHERE summary.total > 0
59
+ ORDER BY 2 DESC
60
+ ;
61
+ """
62
+
63
+ table_checks = {
64
+ 'DX12_WORKLOAD':
65
+ "{DBFILE} does not contain DX12 GPU debug markers."
66
+ }
67
+
68
+ if __name__ == "__main__":
69
+ DX12GpuMarkerSummary.Main()
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/dx12pixsum.py ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2021-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ import nsysstats
14
+
15
+ class D3D12PIXSummary(nsysstats.StatsReport):
16
+
17
+ display_name = 'DEPRECATED - Use dx12_pix_sum instead'
18
+ usage = '{SCRIPT} -- {{DISPLAY_NAME}}'
19
+ should_display = False
20
+
21
+ query = f"""
22
+ WITH
23
+ summary AS (
24
+ SELECT
25
+ begin.textId AS textId,
26
+ sum(end.start - begin.end) AS total,
27
+ count(*) AS num,
28
+ avg(end.start - begin.end) AS avg,
29
+ median(end.start - begin.end) AS med,
30
+ min(end.start - begin.end) AS min,
31
+ max(end.start - begin.end) AS max,
32
+ stdev(end.start - begin.end) AS stddev
33
+ FROM
34
+ D3D12_PIX_DEBUG_API AS begin
35
+ JOIN
36
+ D3D12_PIX_DEBUG_API AS end
37
+ ON begin.correlationId == end.correlationId
38
+ AND begin.globalTid == end.globalTid
39
+ WHERE begin.textId IS NOT NULL
40
+ AND end.textId IS NULL
41
+ GROUP BY 1
42
+ ),
43
+ totals AS (
44
+ SELECT sum(total) AS total
45
+ FROM summary
46
+ )
47
+
48
+ SELECT
49
+ round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%",
50
+ summary.total AS "Total Time:dur_ns",
51
+ summary.num AS "Instances",
52
+ round(summary.avg, 1) AS "Avg:dur_ns",
53
+ round(summary.med, 1) AS "Med:dur_ns",
54
+ summary.min AS "Min:dur_ns",
55
+ summary.max AS "Max:dur_ns",
56
+ round(summary.stddev, 1) AS "StdDev:dur_ns",
57
+ ids.value AS "Range"
58
+ FROM
59
+ summary
60
+ LEFT JOIN
61
+ StringIds AS ids
62
+ ON ids.id == summary.textId
63
+ WHERE summary.total > 0
64
+ ORDER BY 2 DESC
65
+ ;
66
+ """
67
+
68
+ table_checks = {
69
+ 'D3D12_PIX_DEBUG_API':
70
+ "{DBFILE} does not contain DX12 CPU debug markers."
71
+ }
72
+
73
+ if __name__ == "__main__":
74
+ D3D12PIXSummary.Main()
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/gpukerngbsum.py ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ import nsysstats
14
+
15
+ class CUDAGPUKernelGBSummary(nsysstats.StatsReport):
16
+
17
+ display_name = 'DEPRECATED - Use cuda_gpu_kern_gb_sum instead'
18
+ usage = '{SCRIPT} -- {{DISPLAY_NAME}}'
19
+ should_display = False
20
+
21
+ query_stub = """
22
+ WITH
23
+ summary AS (
24
+ SELECT
25
+ coalesce({NAME_COL_NAME}, demangledName) AS nameId,
26
+ sum(end - start) AS total,
27
+ count(*) AS num,
28
+ avg(end - start) AS avg,
29
+ median(end - start) AS med,
30
+ min(end - start) AS min,
31
+ max(end - start) AS max,
32
+ stdev(end - start) AS stddev,
33
+ gridX, gridY, gridZ,
34
+ blockX, blockY, blockZ
35
+ FROM
36
+ CUPTI_ACTIVITY_KIND_KERNEL
37
+ GROUP BY 1, gridX, gridY, gridZ, blockX, blockY, blockZ
38
+ ),
39
+ totals AS (
40
+ SELECT sum(total) AS total
41
+ FROM summary
42
+ )
43
+ SELECT
44
+ round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%",
45
+ summary.total AS "Total Time:dur_ns",
46
+ summary.num AS "Instances",
47
+ round(summary.avg, 1) AS "Avg:dur_ns",
48
+ round(summary.med, 1) AS "Med:dur_ns",
49
+ summary.min AS "Min:dur_ns",
50
+ summary.max AS "Max:dur_ns",
51
+ round(summary.stddev, 1) AS "StdDev:dur_ns",
52
+ printf('%4d %4d %4d', gridX, gridY, gridZ) AS "GridXYZ",
53
+ printf('%4d %4d %4d', blockX, blockY, blockZ) AS "BlockXYZ",
54
+ ids.value AS "Name"
55
+ FROM
56
+ summary
57
+ LEFT JOIN
58
+ StringIds AS ids
59
+ ON ids.id == summary.nameId
60
+ ORDER BY 2 DESC, 3, "Name"
61
+ ;
62
+ """
63
+
64
+ table_checks = {
65
+ 'CUPTI_ACTIVITY_KIND_KERNEL':
66
+ '{DBFILE} does not contain CUDA kernel data.'
67
+ }
68
+
69
+ _arg_opts = [
70
+ [['base'], {'action': 'store_true'}],
71
+ [['mangled'], {'action': 'store_true'}],
72
+ ]
73
+
74
+ def setup(self):
75
+ err = super().setup()
76
+ if err != None:
77
+ return err
78
+
79
+ name_col_name = 'demangledName'
80
+ if self.parsed_args.base:
81
+ name_col_name = 'shortName'
82
+ elif (self.parsed_args.mangled and
83
+ self.table_col_exists('CUPTI_ACTIVITY_KIND_KERNEL', 'mangledName')):
84
+ name_col_name = 'mangledName'
85
+
86
+ self.query = self.query_stub.format(NAME_COL_NAME = name_col_name)
87
+
88
+ if __name__ == "__main__":
89
+ CUDAGPUKernelGBSummary.Main()
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/gpukernsum.py ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ import nsysstats
14
+
15
+ class CUDAGPUKernelSummary(nsysstats.StatsReport):
16
+
17
+ display_name = 'DEPRECATED - Use cuda_gpu_kern_sum instead'
18
+ usage = '{SCRIPT} -- {{DISPLAY_NAME}}'
19
+ should_display = False
20
+
21
+ query_stub = """
22
+ WITH
23
+ summary AS (
24
+ SELECT
25
+ coalesce({NAME_COL_NAME}, demangledName) AS nameId,
26
+ sum(end - start) AS total,
27
+ count(*) AS num,
28
+ avg(end - start) AS avg,
29
+ median(end - start) AS med,
30
+ min(end - start) AS min,
31
+ max(end - start) AS max,
32
+ stdev(end - start) AS stddev
33
+ FROM
34
+ CUPTI_ACTIVITY_KIND_KERNEL
35
+ GROUP BY 1
36
+ ),
37
+ totals AS (
38
+ SELECT sum(total) AS total
39
+ FROM summary
40
+ )
41
+ SELECT
42
+ round(summary.total * 100.0 / (SELECT total FROM totals), 1) AS "Time:ratio_%",
43
+ summary.total AS "Total Time:dur_ns",
44
+ summary.num AS "Instances",
45
+ round(summary.avg, 1) AS "Avg:dur_ns",
46
+ round(summary.med, 1) AS "Med:dur_ns",
47
+ summary.min AS "Min:dur_ns",
48
+ summary.max AS "Max:dur_ns",
49
+ round(summary.stddev, 1) AS "StdDev:dur_ns",
50
+ ids.value AS "Name"
51
+ FROM
52
+ summary
53
+ LEFT JOIN
54
+ StringIds AS ids
55
+ ON ids.id == summary.nameId
56
+ ORDER BY 2 DESC, 3, "Name"
57
+ ;
58
+ """
59
+
60
+ table_checks = {
61
+ 'CUPTI_ACTIVITY_KIND_KERNEL':
62
+ '{DBFILE} does not contain CUDA kernel data.'
63
+ }
64
+
65
+ _arg_opts = [
66
+ [['base'], {'action': 'store_true'}],
67
+ [['mangled'], {'action': 'store_true'}],
68
+ ]
69
+
70
+ def setup(self):
71
+ err = super().setup()
72
+ if err != None:
73
+ return err
74
+
75
+ name_col_name = 'demangledName'
76
+ if self.parsed_args.base:
77
+ name_col_name = 'shortName'
78
+ elif (self.parsed_args.mangled and
79
+ self.table_col_exists('CUPTI_ACTIVITY_KIND_KERNEL', 'mangledName')):
80
+ name_col_name = 'mangledName'
81
+
82
+ self.query = self.query_stub.format(NAME_COL_NAME = name_col_name)
83
+
84
+ if __name__ == "__main__":
85
+ CUDAGPUKernelSummary.Main()
cuda_toolkit/nsight-systems/nsight-systems/2023.4.4/host-windows-x64/reports/gpumemsizesum.py ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python
2
+
3
+ # SPDX-FileCopyrightText: Copyright (c) 2020-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4
+ # SPDX-License-Identifier: LicenseRef-NvidiaProprietary
5
+ #
6
+ # NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
7
+ # property and proprietary rights in and to this material, related
8
+ # documentation and any modifications thereto. Any use, reproduction,
9
+ # disclosure or distribution of this material and related documentation
10
+ # without an express license agreement from NVIDIA CORPORATION or
11
+ # its affiliates is strictly prohibited.
12
+
13
+ import nsysstats
14
+
15
+ class CUDAGPUMemorySizeSummary(nsysstats.StatsReport):
16
+
17
+ display_name = 'DEPRECATED - Use cuda_gpu_mem_size_sum instead'
18
+ usage = '{SCRIPT} -- {{DISPLAY_NAME}}'
19
+ should_display = False
20
+
21
+ query_stub = """
22
+ WITH
23
+ memops AS (
24
+ {MEM_SUB_QUERY}
25
+ ),
26
+ summary AS (
27
+ SELECT
28
+ name AS name,
29
+ sum(size) AS total,
30
+ count(*) AS num,
31
+ avg(size) AS avg,
32
+ median(size) AS med,
33
+ min(size) AS min,
34
+ max(size) AS max,
35
+ stdev(size) AS stddev
36
+ FROM memops
37
+ GROUP BY 1
38
+ )
39
+ SELECT
40
+ summary.total AS "Total:mem_B",
41
+ summary.num AS "Count",
42
+ summary.avg AS "Avg:mem_B",
43
+ summary.med AS "Med:mem_B",
44
+ summary.min AS "Min:mem_B",
45
+ summary.max AS "Max:mem_B",
46
+ summary.stddev AS "StdDev:mem_B",
47
+ summary.name AS "Operation"
48
+ FROM
49
+ summary
50
+ ORDER BY 1 DESC
51
+ ;
52
+ """
53
+
54
+ query_memcpy = """
55
+ SELECT
56
+ '[CUDA memcpy ' || mos.label || ']' AS name,
57
+ mcpy.bytes AS size
58
+ FROM
59
+ CUPTI_ACTIVITY_KIND_MEMCPY as mcpy
60
+ INNER JOIN
61
+ ENUM_CUDA_MEMCPY_OPER AS mos
62
+ ON mos.id == mcpy.copyKind
63
+ """
64
+
65
+ query_memset = """
66
+ SELECT
67
+ '[CUDA memset]' AS name,
68
+ bytes AS size
69
+ FROM
70
+ CUPTI_ACTIVITY_KIND_MEMSET
71
+ """
72
+
73
+ query_union = """
74
+ UNION ALL
75
+ """
76
+
77
+ def setup(self):
78
+ err = super().setup()
79
+ if err != None:
80
+ return err
81
+
82
+ sub_queries = []
83
+
84
+ if self.table_exists('CUPTI_ACTIVITY_KIND_MEMCPY'):
85
+ if not self.table_exists('ENUM_CUDA_MEMCPY_OPER'):
86
+ return '{DBFILE} does not contain ENUM_CUDA_MEMCPY_OPER table.'
87
+ sub_queries.append(self.query_memcpy)
88
+
89
+ if self.table_exists('CUPTI_ACTIVITY_KIND_MEMSET'):
90
+ sub_queries.append(self.query_memset)
91
+
92
+ if len(sub_queries) == 0:
93
+ return "{DBFILE} does not contain GPU memory data."
94
+
95
+ self.query = self.query_stub.format(MEM_SUB_QUERY = self.query_union.join(sub_queries))
96
+
97
+ if __name__ == "__main__":
98
+ CUDAGPUMemorySizeSummary.Main()