mirror of
https://github.com/XuehaiPan/nvitop.git
synced 2026-10-23 08:07:34 -06:00
[PR #227] feat(npu): add Ascend NPU support via npu-smi (nvitop-npu) #225
Labels
No labels
api
bug
bug
cli / tui
dependencies
documentation
documentation
documentation
duplicate
enhancement
exporter
invalid
pull-request
pynvml
question
question
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github-starred/nvitop#225
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/XuehaiPan/nvitop/pull/227
Author: @Ruijie-Ysp
Created: 8/3/2026
Status: 🔄 Open
Base:
main← Head:dev_ysp_npu📝 Commits (5)
850864cfeat(npu): add Ascend NPU support via npu-smi (nvitop-npu)e275515test(npu): rewrite cli_npu tests to match the final CLI API583a134feat(npu): improve interactive monitor UId0ca012fix(npu): stabilize monitor input and pausea8a70f1feat(npu): add full-screen monitoring dashboard📊 Changes
20 files changed (+3920 additions, -0 deletions)
View changed files
📝
README.md(+56 -0)📝
nvitop/__init__.py(+4 -0)📝
nvitop/api/__init__.py(+37 -0)➕
nvitop/api/libnpu.py(+610 -0)➕
nvitop/api/npu_device.py(+706 -0)➕
nvitop/cli_npu.py(+369 -0)➕
nvitop/npu_monitor.py(+396 -0)➕
nvitop/npu_ui.py(+841 -0)📝
pyproject.toml(+1 -0)➕
tests_npu/samples/info--m.txt(+17 -0)➕
tests_npu/samples/info--t-board--i-0.txt(+19 -0)➕
tests_npu/samples/info--t-common--i-0.txt(+15 -0)➕
tests_npu/samples/info--t-memory--i-0.txt(+11 -0)➕
tests_npu/samples/info--t-power--i-0.txt(+6 -0)➕
tests_npu/samples/info--t-proc-mem--i-0.txt(+6 -0)➕
tests_npu/samples/info--t-temp--i-0.txt(+10 -0)➕
tests_npu/samples/info--t-usages--i-0.txt(+19 -0)➕
tests_npu/samples/info.txt(+49 -0)➕
tests_npu/test_cli_npu.py(+549 -0)➕
tests_npu/test_libnpu.py(+199 -0)📄 Description
Summary
Add Ascend NPU support to nvitop. A new
nvitop-npucommand monitorsHuawei Ascend NPUs through the
npu-smiCLI (no extra runtime dependencies),mirroring the nvitop
Device/GpuProcessAPI and rendering annvidia-smi-style report, plus a full-screen monitoring dashboard.Changes
nvitop/api/libnpu.py: dependency-freenpu-smiparsing layer with TTLcaches and parallel per-card batch queries
nvitop/api/npu_device.py:NpuDevice/NpuProcessdata model mirroringthe
Device/GpuProcessAPI of nvitopnvitop/cli_npu.py:nvitop-npuCLI (one-shot report, monitor mode,device/process filtering, ASCII & colorful output)
nvitop/npu_ui.py/nvitop/npu_monitor.py: responsive renderers and thefull-screen monitoring dashboard
tests_npu/: 41 unit tests against realnpu-smisamples (8x Ascend 910B3)pyproject.toml: register thenvitop-npuconsole scriptREADME.md: document Ascend NPU supportTest
pytest tests_npu/, stub-based, no NPU required)~5.4s; monitor mode refreshes every 2 seconds
Implementation notes
npu-smi infocall covers all cards (health / memory /power / temperature / process table incl. per-process memory)
npu-smirequires-ifor per-card detail queries; these are parallelizedwith a thread pool
batches of
npu-smicalls🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.