Skip to content

Commit 47f0f2c

Browse files
committed
Updated readme
1 parent 6bc82e9 commit 47f0f2c

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

README.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,25 @@ gpu server). These are:
2222

2323
See the Utils section below for more info.
2424

25+
Updates in Version 0.2.3
26+
------------------------
27+
To try and keep py3nvml somewhat up-to-date with the constantly evolving nvidia
28+
drivers, I have done some work to the `py3nvml.py3nvml` module. In particular,
29+
I have updated all the constants that were missing in py3nvml and existing in the
30+
`NVIDIA source`__ as of version 418.43. In addition, I have wrapped all of these
31+
constants in Enums so it is easier to see what constants go together. Finally,
32+
for all the functions in `py3nvml.py3nvml` I have copied in the
33+
C docstring. While this will result in some strange looking docstrings which
34+
will be slightly incorrect, they should give good guidance on the scope of the
35+
function, something which was ill-defined before.
36+
37+
Finally, I will remove the `py3nvml.nvidia_smi` module in a future version, as
38+
I believe it was only ever meant as an example of how to use the nvml functions
39+
to query the gpus, and is now quite out of date. To get the same functionality,
40+
you can call `nvidia-smi -q -x` from python with subprocess.
41+
42+
__ https://github.com/NVIDIA/nvidia-settings/blob/master/src/nvml.h
43+
2544
Requires
2645
--------
2746
Python 3.5+.
@@ -109,6 +128,19 @@ value is True if no process was found running on gpu n. An example use is:
109128
if True not in free_gpus:
110129
print('No free gpus found')
111130
131+
get_num_procs
132+
~~~~~~~~~~~~~
133+
This function is called by `get_free_gpus`. It simply returns a list of integers
134+
with the number of processes running on each gpu. E.g. if you had 1 process
135+
running on gpu 5 in an 8 gpu system, you would expect to get the following:
136+
137+
.. code:: python
138+
139+
import py3nvml
140+
num_procs = py3nvml.get_num_procs()
141+
print(num_proces)
142+
>>> [0, 0, 0, 0, 0, 1, 0, 0]
143+
112144
py3smi
113145
~~~~~~
114146
I found the default `nvidia-smi` output was missing some useful info, so made use of the

0 commit comments

Comments
 (0)