dcustat
一个能够简洁的显示海光 DCU 设备状态的命令行工具;
之前使用GPU时习惯了使用工具 gpustat 查看GPU状态,使用海光的 DCU 设备之后发现并没有类似的工具,于是仿照 gpustat 自己写了一个;
显示效果如下图:
依赖说明
python版本要求:python>=3.8;
该工具的底层是调用的命令 rocm-smi,所以在使用该工具前需要确保 DCU 的固件和驱动都正常安装。
安装说明
pip install dcustat
使用说明
使用如下命令单次获取当前 dcu 设备信息:
dcustat
使用如下命令动态刷新当前 dcu 设备信息,默认每2秒刷新一次:
dcustat --watch
可选参数如下:
usage: dcustat [-h] [-i [INTERVAL]] [--light] [--debug] [-v]
optional arguments:
-h, --help show this help message and exit
-i [INTERVAL], --interval [INTERVAL], --watch [INTERVAL]
动态刷新模式;INTERVAL为刷新间隔,单位:秒;默认每2秒刷新一次;
--light 使用较亮的模式显示,如果显示器渲染出来的结果较暗,可以打开该参数;
--debug Debug模式时允许在程序出错的情况下打印更多的调试信息;
-v, --version show program's version number and exit
参数 --light 说明
有的显示器渲染结果中部分指标比较暗,如下图左侧所示。此时可以添加上 --light 参数,所有的结果都会以更亮的形式进行显示,如下图右侧所示。
dcustat --watch --light
| 默认 | 加--light参数 |
|---|---|
显示内容说明
sxcs-k8s-master-01 Mon Aug 7 17:35:53 2023
ID 温度, 风扇, AvgPwr / PwrCap, 显存, Core
[0] 43.0°C, 0.0%, 20.0W / 450.0W, 0.0%, 0.0%
[1] 43.0°C, 0.0%, 20.0W / 450.0W, 0.0%, 0.0%
[2] 43.0°C, 0.0%, 20.0W / 450.0W, 0.0%, 0.0%
[3] 43.0°C, 0.0%, 20.0W / 450.0W, 0.0%, 0.0%
-
header:第1行为header,展示的信息从左到右依次为机器名称、当前时间;
-
title:第2行为title,title是对后面展示的信息的各字段的说明:
-
ID列是显卡的id; -
温度列是显卡的当前温度; -
风扇列是显卡风扇的当前转速; -
AvgPwr列是平均功率; -
PwrCap列是显卡的功率上限; -
显存列是当前显存的使用率; -
Core列是当前计算资源的使用率。
-
Reference
本项目的灵感、排版展示、以及代码的整体结构都是源自 gpustat,本项目只是将其工作适配到了海光 DCU 设备上;
License
Metadata
Release files for dcustat 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dcustat-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for dcustat-0.0.3-py3-none-any.whl |
Release files / dcustat-0.0.3-py3-none-any.whl
| Download URL | dcustat-0.0.3-py3-none-any.whl |
|---|---|
| Size | 9.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8f098964fd528fe697fe04a41d7949dcb567a9a8323ec1534b0aadc4ff9d2f1c
|
|
BLAKE2b-256 checksum How to use checksums |
fbdee24c5d19a648b44372483e83bf9bd8a3a3883fc7ff0af80c2697b506be24
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.6
|
Security for dcustat 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.