File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,22 @@ In [4]: amdgpu_stats.utils.get_clock('core', format_freq=True)
47
47
Out[4 ]: ' 659 MHz'
48
48
```
49
49
50
+ Attempts are made to provide guidance as ` ValueErrors ` . For example:
51
+
52
+ ``` python
53
+ In [2 ]: amdgpu_stats.utils.CARDS
54
+ Out[2 ]: {' card1' : ' /sys/class/drm/card1/device/hwmon/hwmon3' }
55
+
56
+ In [3 ]: amdgpu_stats.utils.get_core_stats(' card0' )
57
+ [... ]
58
+ File ~ / .local/ lib/ python3.12/ site- packages/ amdgpu_stats/ utils.py:82 , in validate_card(card)
59
+ 80 raise ValueError (" No AMD GPUs or hwmon directories found" )
60
+ 81 # if 'card' was specified (not None) but invalid (not in 'CARDS'), raise a helpful error
61
+ -- -> 82 raise ValueError (f " Invalid card: ' { card} '. Must be one of: { list (CARDS .keys())} " )
62
+
63
+ ValueError : Invalid card: ' card0' . Must be one of: [' card1' ]
64
+ ```
65
+
50
66
For more information on what the module provides, please see:
51
67
52
68
- [ ReadTheDocs] ( https://amdgpu-stats.readthedocs.io/en/latest/ )
You can’t perform that action at this time.
0 commit comments