一个使用NVIDIA Nsight工具对单元格执行进行剖析的JupyterLab扩展。
项目描述
NVIDIA Nsight工具JupyterLab扩展
一个使用NVIDIA Nsight工具对单元格执行进行剖析的JupyterLab扩展。
演示
点击图片启动视频
需求
- JupyterLab >= 4.0.0
- Docker (可选,用于GUI支持)
- nvtx (要求Nsight Compute支持)
Nsight工具不包含在此扩展中。所需的工具应在JupyterLab服务器机器上单独安装。
安装和设置
- 要安装扩展,请执行
pip install jupyterlab-nvidia-nsight
-
安装Nsight Systems和/或Nsight Compute(这些工具不包含在此扩展中)。
-
在扩展设置中设置Nsight Systems和/或Nsight Compute的安装位置。
- 示例:如果Nsight Systems的安装位置设置为
/opt/nvidia/nsight-systems/<version>
,则扩展将在/opt/nvidia/nsight-systems/<version>/target-linux-x64
中查找nsys可执行文件。 - 如果没有设置,则
PATH
环境变量应包含工具的可执行文件位置。
- 示例:如果Nsight Systems的安装位置设置为
剖析JupyterLab单元格
- 使用“使用Nsight Systems/Compute...”命令下的NVIDIA Nsight菜单或通过命令面板启用Nsight工具。
- 注意:此操作将重启JupyterLab内核。
- 使用“运行并剖析所选单元格...”命令剖析单元格执行。
- 单元格的剖析信息显示在单元格输出区域中。
在Nsight工具GUI中分析配置会话
- 默认情况下禁用了GUI显示。要使用Nsight Systems GUI分析报告文件,请检查扩展设置中的启用Nsight Systems UI复选框。
- 在JupyterLab中的一个标签页中打开Nsight工具报告文件。
- 显示Nsight工具GUI需要WebRTC Docker镜像。通过执行以下命令构建GUI WebRTC Docker镜像:
<nsys_install_dir>/host-linux-x64/Scripts/WebRTCContainer/build.sh
支持的工具
Nsight Systems
- 支持Nsight Systems版本2024.1.1或更高版本。建议使用最新版本。
- 在分析单元格执行时使用
--stats=true
,以查看nsys stats
的文本输出。
在扩展中无法使用的NSYS CLI标志列表
--help
,-h
–hotkey-capture
--output
,-o
–session-new
–session
--stop-on-exit
,-x
Nsight Compute
- 支持Nsight Compute版本2024.3或更高版本。建议使用最新版本。
在扩展中无法使用的NCU CLI标志列表
–app-replay-buffer
–app-replay-match
–app-replay-mode
–check-exit-code
–chips
–config-file-path
–config-file
--export
,-o
--force-overwrite
,-f
--help
,-h
–hostname
--import
,-i
–kill
–list-chips
–list-metrics
–list-rules
–list-sections
–list-sets
–log-file
–mode
–null-stdin
–open-in-ui
–profile-from-start
–query-metrics-collection
–query-metrics-mode
–query-metrics
–quiet
–range-filter
–range-replay-options
–rename-kernels-export
–replay-mode
–section-folder-restore
--version
,-v
仅当启用NCU时才可使用的NCU CLI标志列表
–apply-rules
–cache-control
–call-stack-type
–call-stack
–clock-control
–disable-profiler-start-stop
–graph-profiling
–import-source
–injection-path-32
–injection-path-64
–max-connections
–metrics
–pm-sampling-buffer-size
–pm-sampling-interval
–pm-sampling-max-passes
--port
,-p
–preload-library
–rule
–section-folder-recursive
–section-folder
–section
–set
–source-folders
–support-32bit
–target-processes-filter
–target-processes
–verbose
–warp-sampling-buffer-size
–warp-sampling-interval
–warp-sampling-max-passes
仅当分析单元格时才可使用的NCU CLI标志列表
–csv
–devices
–disable-extra-suffixes
–filter-mode
–kernel-id
–kernel-name-base
--kernel-name
,-k
--launch-count
,-c
–launch-skip-before-match
- –launch-skip,
-s
–nvtx-exclude
–nvtx-include
–page
–print-details
–print-fp
–print-kernel-base
–print-metric-attribution
–print-metric-instances
–print-metric-name
–print-nvtx-rename
–print-rule-details
–print-source
–print-summary
–print-units
–rename-kernels-path
–rename-kernels
–resolve-source-file
卸载
要移除扩展,请执行
pip uninstall jupyterlab-nvidia-nsight
故障排除
如果您看到前端扩展,但它没有工作,请检查服务器扩展是否启用
jupyter server extension list
如果已安装并启用了服务器扩展,但您看不到前端扩展,请检查前端扩展是否已安装
jupyter labextension list
已知问题
- 当Nsight Compute启用时,使用“中断内核”命令(通过使用命令面板、内核菜单或停止按钮)中断JupyterLab内核会导致内核终止并重新启动。
发行说明
0.6.0
- 支持在JupyterLab内部显示Nsight Compute UI。
- 修复与Nsight工具UI的键盘交互问题。
0.5.2
- 在项目描述中添加了Nsight Compute部分。
- 在扩展加载时验证服务器连接。
0.5.1
- 初始版本。
项目详情
关闭
jupyterlab_nvidia_nsight-0.6.0-py3-none-any.whl的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | e7a1299157d3bef5ae34499a8f0cb2dcd963181062ed7ac7d70d5c3998b8ae25 |
|
MD5 | 588658c2c197b86e732ec2e7108dc1bb |
|
BLAKE2b-256 | 5cec5fc05199a5afe28483975d91b76fb44c6302ced3649362b100acb78befab |