Amdsmidocs reorg

Change-Id: I836fc341d2a3567f531ba753463e57cd4b9b6495
Signed-off-by: Galantsev, Dmitrii <dmitrii.galantsev@amd.com>


[ROCm/amdsmi commit: af225a6deb]
This commit is contained in:
Roopa Malavally
2024-04-15 10:16:39 -07:00
committed by Maisam Arif
parent bbcff5221d
commit 584e10f58b
14 changed files with 6610 additions and 27 deletions
@@ -0,0 +1,29 @@
====================
Python Tutorials
====================
This chapter is the rocm_smi Python api tutorials.
.. code-block:: python
import sys
sys.path.append("/opt/rocm/libexec/rocm_smi/")
try:
import rocm_smi
except ImportError:
raise ImportError("Could not import /opt/rocm/libexec/rocm_smi/rocm_smi.py")
class prof_utils:
def __init__(self, mode) -> None:
rocm_smi.initializeRsmi()
def getPower(self, device):
return rocm_smi.getPower(device)
def listDevices(self):
return rocm_smi.listDevices()
def getMemInfo(self, device):
(memUsed, memTotal) = rocm_smi.getMemInfo(device, "vram")
return round(float(memUsed)/float(memTotal) * 100, 2)