Skip to content

Commit 7c799cc

Browse files
committed
Improve docs, Cython refactoring
1 parent 9299d4c commit 7c799cc

6 files changed

Lines changed: 112 additions & 130 deletions

File tree

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ Only Linux is supported, using the AMDGPU driver.
1010

1111
The library is written using Cython, meaning that Cython and and a C compiler are needed to build and install from source. Additionally, libdrm development headers are required.
1212

13-
Precompiled wheels for Python 3.8-3.12 are the default method of install. This means that you don't need Cython or any other dependencies to install it normally.
13+
Precompiled wheels for Python 3.8-3.12 are the default method of install. This means that you don't need Cython or any other dependencies to install from PyPi.
1414

1515
## Usage
1616

1717
Example:
1818
```python
1919
>>> import pyamdgpuinfo
20-
>>> n_devices = pyamdgpuinfo.detect_gpus()
20+
>>> pyamdgpuinfo.detect_gpus()
2121
1 # we have 1 device present, so it'll be at index 0
2222
>>> first_gpu = pyamdgpuinfo.get_gpu(0) # returns a GPUInfo object
2323
>>> vram_usage = first_gpu.query_vram_usage()
24-
>>> print(vram_usage)
24+
>>> vram_usage
2525
3954978816 # number of bytes in use
2626
```
2727

@@ -33,8 +33,8 @@ Available functions are (see docstrings for more info):
3333

3434

3535
GPUInfo methods (see docstring for class overview)
36-
* start_utilisation_polling - Starts polling GPU registers for utilisation statistics
37-
* stop_utilisation_polling - Stops the utilisation polling thread
36+
* start_utilisation_polling - Starts polling GPU functional units for utilisation statistics
37+
* stop_utilisation_polling - Stops utilisation polling
3838
* query_utilisation - Queries utilisation of different GPU parts
3939
* query_max_clocks - Queries max GPU clocks
4040
* query_sclk - Queries shader (core) clock

pyamdgpuinfo/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
from ._pyamdgpuinfo import GPUInfo, get_gpu, detect_gpus
1+
from ._impl import GPUInfo, get_gpu, detect_gpus
2+
3+
# update the module paths to avoid pyamdgpuinfo._impl.obj names
4+
for value in locals().copy().values():
5+
if getattr(value, "__module__", "").startswith("pyamdgpuinfo."):
6+
value.__module__ = __name__
7+
# make sure value doesn't hang around as a module attribute
8+
del value # pylint: disable=undefined-loop-variable

0 commit comments

Comments
 (0)