# 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.
Raw data
{
"_id": null,
"home_page": "https://github.com/AnswerDotAI/py-smi",
"name": "python-smi",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "nbdev jupyter notebook python",
"author": "Jeremy Howard",
"author_email": "info@fast.ai",
"download_url": "https://files.pythonhosted.org/packages/b7/a3/f0e71c29f82fa7913981a68970b2c5bd36b8161fb55673fd0174f04d0428/python_smi-0.0.2.tar.gz",
"platform": null,
"description": "# py_smi\n\n<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->\n\n## Installation\n\nInstall latest from pypi:\n\n``` sh\n$ pip install python-smi\n```\n\nLinks:\n\n- [repo](https://github.com/AnswerDotAI/py-smi)\n- [docs](https://AnswerDotAI.github.io/py-smi/)\n- [pypi](https://pypi.org/project/python-smi/)\n\n## How to use\n\nHere\u2019s a quick demo of all the methods available:\n\n``` python\nfrom py_smi import NVML\n```\n\n``` python\nnv = NVML()\nnv.driver_version, nv.cuda_version\n```\n\n ('535.183.06', '12.2')\n\nAll methods have a single parameter, which is the index of the GPU to\nget information about.\n\n``` python\nnv.info(0)\n```\n\n _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)\n\n``` python\n[nv.mem(i) for i in range(3)]\n```\n\n [_Memory(free=2193.25, total=49140.0, used=46946.75),\n _Memory(free=48672.4375, total=49140.0, used=467.5625),\n _Memory(free=48672.4375, total=49140.0, used=467.5625)]\n\nThe index defaults to `0`.\n\n``` python\nnv.utilization()\n```\n\n _Utilization(gpu=0, memory=0, enc=0, dec=0)\n\n``` python\nnv.power()\n```\n\n _Power(usage=17.22, limit=300.0)\n\n``` python\nnv.clocks()\n```\n\n _Clocks(graphics=0, sm=0, mem=405)\n\n``` python\nnv.pcie_throughput()\n```\n\n _PCIeThroughput(rx=0.0, tx=0.0)\n\n``` python\nnv.processes()\n```\n\n [_ProcessInfo(pid=201084, name='/home/jhoward/miniconda3/bin/python3.12', memory=46476.0)]\n\n``` python\nnv.dmon()\n```\n\n _DMon(pwr=17.039, gtemp=32, sm=0, mem=0, enc=0, dec=0, mclk=405, pclk=0)\n\n## Contributing\n\nI\u2019ve added the obvious pieces based on how I use `nvidia-smi`, but I\u2019m\nsure there\u2019s missing useful features, so PRs are welcome! Note that this\nis an [nbdev](https://nbdev.fast.ai/getting_started.html) project so the\nsource notebooks must be changed, rather than editing .py or .md files\ndirectly.\n",
"bugtrack_url": null,
"license": "Apache Software License 2.0",
"summary": "Convenient access to `pynvml` (the library behind `nvidia-smi`)",
"version": "0.0.2",
"project_urls": {
"Homepage": "https://github.com/AnswerDotAI/py-smi"
},
"split_keywords": [
"nbdev",
"jupyter",
"notebook",
"python"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c10338ef44241ef005a2302ee66a0cdf8266edd42f5e6b8fd32873d3d9ef92c2",
"md5": "3adcc8cc195210d79fb5c97b6eeb8615",
"sha256": "9c884088f8e8f0cd836dc4823cc594fae75c3fcd97c417d7985939c28083bf01"
},
"downloads": -1,
"filename": "python_smi-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3adcc8cc195210d79fb5c97b6eeb8615",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 9221,
"upload_time": "2024-10-18T20:48:56",
"upload_time_iso_8601": "2024-10-18T20:48:56.248788Z",
"url": "https://files.pythonhosted.org/packages/c1/03/38ef44241ef005a2302ee66a0cdf8266edd42f5e6b8fd32873d3d9ef92c2/python_smi-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b7a3f0e71c29f82fa7913981a68970b2c5bd36b8161fb55673fd0174f04d0428",
"md5": "04313a81e65107e54ee1c3216f8698fe",
"sha256": "01bbf3b72409e5fd569f4bc13234afb2109af7f1c3c552b5ddc468c0b92dcbc2"
},
"downloads": -1,
"filename": "python_smi-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "04313a81e65107e54ee1c3216f8698fe",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 9855,
"upload_time": "2024-10-18T20:48:58",
"upload_time_iso_8601": "2024-10-18T20:48:58.528865Z",
"url": "https://files.pythonhosted.org/packages/b7/a3/f0e71c29f82fa7913981a68970b2c5bd36b8161fb55673fd0174f04d0428/python_smi-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-18 20:48:58",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "AnswerDotAI",
"github_project": "py-smi",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "python-smi"
}