Skip to main content

py_smi

Installation

Install latest from pypi:

$ pip install python-smi

Links:

How to use

Here’s a quick demo of all the methods available:

from py_smi import NVML
nv = NVML()
nv.driver_version, nv.cuda_version
('535.183.06', '12.2')

All methods have a single parameter, which is the index of the GPU to get information about.

nv.info(0)
_Info(name='NVIDIA RTX A6000', serial='1322123048138', uuid='GPU-61e56e6f-2a64-c0f4-b26c-ab3ead0eed5b', persistence_mode=1, bus_id='00000000:01:00.0', display_active=0, performance_state=8, fan_speed=30, temperature=32, compute_mode=0)
[nv.mem(i) for i in range(3)]
[_Memory(free=2193.25, total=49140.0, used=46946.75),
 _Memory(free=48672.4375, total=49140.0, used=467.5625),
 _Memory(free=48672.4375, total=49140.0, used=467.5625)]

The index defaults to 0.

nv.utilization()
_Utilization(gpu=0, memory=0, enc=0, dec=0)
nv.power()
_Power(usage=17.22, limit=300.0)
nv.clocks()
_Clocks(graphics=0, sm=0, mem=405)
nv.pcie_throughput()
_PCIeThroughput(rx=0.0, tx=0.0)
nv.processes()
[_ProcessInfo(pid=201084, name='/home/jhoward/miniconda3/bin/python3.12', memory=46476.0)]
nv.dmon()
_DMon(pwr=17.039, gtemp=32, sm=0, mem=0, enc=0, dec=0, mclk=405, pclk=0)

Contributing

I’ve added the obvious pieces based on how I use nvidia-smi, but I’m sure there’s missing useful features, so PRs are welcome! Note that this is an nbdev project so the source notebooks must be changed, rather than editing .py or .md files directly.

Metadata

Release files for python-smi 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-smi 0.0.2
File Size Uploaded Provenance Actions
python_smi-0.0.2.tar.gz 9.9 kB Without provenance Details for python_smi-0.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for python-smi 0.0.2
File Interpreter ABI Platform Actions
python_smi-0.0.2-py3-none-any.whl Python 3 none any Details for python_smi-0.0.2-py3-none-any.whl

Total release size: 19.1 kB

Release files / python_smi-0.0.2.tar.gz

Download URL python_smi-0.0.2.tar.gz
Size 9.9 kB
Tags Source
SHA-256 checksum
How to use checksums
01bbf3b72409e5fd569f4bc13234afb2109af7f1c3c552b5ddc468c0b92dcbc2
BLAKE2b-256 checksum
How to use checksums
b7a3f0e71c29f82fa7913981a68970b2c5bd36b8161fb55673fd0174f04d0428
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release files / python_smi-0.0.2-py3-none-any.whl

Download URL python_smi-0.0.2-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9c884088f8e8f0cd836dc4823cc594fae75c3fcd97c417d7985939c28083bf01
BLAKE2b-256 checksum
How to use checksums
c10338ef44241ef005a2302ee66a0cdf8266edd42f5e6b8fd32873d3d9ef92c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Security for python-smi 0.0.2

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.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page