Skip to main content

A unified stat tool for NVIDIA, AMD, Intel, Huawei, Hygon, Cambricon and Moore Threads accelerators

Project description

xpustat

GitHub Authors: Salah Eddine Bekhouche, Hichem Telli

A unified accelerator stat tool โ€” think gpustat, but for every vendor.

Supported backends

Status Vendor Device CLI tool Filter key
โœ… Tested AMD Radeon RX 7900 XTX (gfx1100) amd-smi amd
โœ… Tested NVIDIA NVIDIA L4 (cc8.9), TITAN V (cc7.0) nvidia-smi nvidia
๐Ÿ”ฒ Untested Intel Gaudi / Gaudi 2 / Gaudi 3 hl-smi gaudi
๐Ÿ”ฒ Untested Intel Arc / Data Center GPU xpu-smi intel
โœ… Tested Huawei Ascend 910B2 ascend-dmi / npu-smi huawei
๐Ÿ”ฒ Untested Hygon DCU hy-smi hygon
๐Ÿ”ฒ Untested Cambricon MLU cnmon cambricon
๐Ÿ”ฒ Untested Moore Threads MTT GPU mthreads-gmi moorethreads

Legend: โœ… Tested on real hardware โ€” ๐Ÿ”ฒ Implemented, awaiting hardware test

Backends whose management tool is not installed are silently skipped.

Running Vendor Hardware Tests

If you have access to specific hardware, you can help us verify the implementation by running the standalone test scripts found in the vendor_devices_tests/ directory:

# Example: Testing the Huawei backend on a machine with Ascend NPUs
python vendor_devices_tests/test_huawei.py

# Example: Testing the NVIDIA backend
python vendor_devices_tests/test_nvidia.py

If the test successfully outputs your hardware metrics, please let us know so we can update the backend status to โœ… Tested!

Install

pip

pip install xpustat

conda

conda install -c conda-forge xpustat

CLI usage

xpustat                      # coloured table of all detected devices
xpustat -pui                 # watch mode, showing processes (-p), users (-u), refreshing every 1.0s (-i)
xpustat -i 2                 # watch mode, refresh every 2 seconds
xpustat -i 1 -n 10           # 10 refreshes then exit
xpustat -a                   # show everything (util, temp, power, arch, user, pid, cmd)
xpustat -f nvidia amd        # show only NVIDIA and AMD
xpustat --no-color           # plain text, no ANSI codes
xpustat --json               # raw JSON output
xpustat --version

Example output:

xpustat 0.1.0  ยท  myhost  ยท  Fri May 22  11:24:00  2026
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
[NVIDIA] #0    Tesla V100                          โ”‚   1,024 / 32,768 MB   โ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘    3%
[AMD   ] #0    Radeon RX 7900 XTX                  โ”‚      26 / 24,560 MB   โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘    0%
[HUAWEI] #0:0  Ascend 310                          โ”‚   2,703 /  8,192 MB   โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   33%

Example output with processes, users, and watch mode (xpustat -pui):

xpustat 0.1.0  ยท  salah-amd  ยท  Fri May 29  10:07:57  2026
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
[AMD   ] #0    Radeon RX 7900 XTX              โ”‚  17,918 / 24,560 MB  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘   72%
              โ””โ”€ salah/348504(17480M)
  refreshing every 1.0s  ยท  Ctrl+C to quit

Python API

import xpustat

# Query everything at once (parallel by default)
stats = xpustat.query_all()

print(stats)                      # XPUStatCollection(nvidia=0, amd=1, ...)
print(stats.amd[0].name)          # "Radeon RX 7900 XTX"
print(stats.amd[0].mem_used_mb)   # 26

# As a dict (JSON-serialisable)
import json
print(json.dumps(stats.to_dict(), indent=2))

# Query a single vendor
from xpustat import NvidiaGPUStatCollection
gpus = NvidiaGPUStatCollection.new_query()

Version history

0.1.0

  • Initial release
  • Support for NVIDIA, AMD, Intel Gaudi, Intel Arc/GPU, Huawei Ascend, Hygon DCU, Cambricon MLU, Moore Threads

Project details


Download files

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

Source Distribution

xpustat-0.1.0.tar.gz (28.0 kB view details)

Uploaded Source

Built Distribution

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

xpustat-0.1.0-py3-none-any.whl (31.2 kB view details)

Uploaded Python 3

File details

Details for the file xpustat-0.1.0.tar.gz.

File metadata

  • Download URL: xpustat-0.1.0.tar.gz
  • Upload date:
  • Size: 28.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for xpustat-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9acf2e2a56b1fb9db3346a3284b2c3654ea1c1019b9beff08de655c5cd83c2a6
MD5 eb8bfcc10134d4b7d26a94fc91526c71
BLAKE2b-256 b1459ffee75bdab68e0695e54b34b4fbe0c2ebdca314f329d23546d9e00e3114

See more details on using hashes here.

File details

Details for the file xpustat-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: xpustat-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 31.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for xpustat-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ccf056e54a935620458ca06a5318811a07fdb24f2640c298ab481c3100070644
MD5 f70045f50ea4efbfff0dc52c52110158
BLAKE2b-256 fa8f67af1cc7968b9397a6f6a388c62111dc65b5e9193f8998aa9a5d738768fa

See more details on using hashes here.

Supported by

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