Metadata-Version: 2.1
Name: python-smi
Version: 0.0.2
Summary: Convenient access to `pynvml` (the library behind `nvidia-smi`)
Home-page: https://github.com/AnswerDotAI/py-smi
Author: Jeremy Howard
Author-email: info@fast.ai
License: Apache Software License 2.0
Keywords: nbdev jupyter notebook python
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: Apache Software License
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastcore
Requires-Dist: nvidia-ml-py
Requires-Dist: psutil
Provides-Extra: dev

# py_smi

<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Installation

Install latest from pypi:

``` sh
$ pip install python-smi
```

Links:

- [repo](https://github.com/AnswerDotAI/py-smi)
- [docs](https://AnswerDotAI.github.io/py-smi/)
- [pypi](https://pypi.org/project/python-smi/)

## How to use

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

``` python
from py_smi import NVML
```

``` python
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.

``` python
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)

``` python
[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`.

``` python
nv.utilization()
```

    _Utilization(gpu=0, memory=0, enc=0, dec=0)

``` python
nv.power()
```

    _Power(usage=17.22, limit=300.0)

``` python
nv.clocks()
```

    _Clocks(graphics=0, sm=0, mem=405)

``` python
nv.pcie_throughput()
```

    _PCIeThroughput(rx=0.0, tx=0.0)

``` python
nv.processes()
```

    [_ProcessInfo(pid=201084, name='/home/jhoward/miniconda3/bin/python3.12', memory=46476.0)]

``` python
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](https://nbdev.fast.ai/getting_started.html) project so the
source notebooks must be changed, rather than editing .py or .md files
directly.
