Skip to content

Commit e5ddc4c

Browse files
committed
Add back pyamdgpuinfo GPU detection
1 parent d363667 commit e5ddc4c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

library/sensors/sensors_python.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ class GpuAmd(sensors.Gpu):
275275
def stats() -> Tuple[float, float, float, float]: # load (%) / used mem (%) / used mem (Mb) / temp (°C)
276276
if pyamdgpuinfo:
277277
# Unlike other sensors, AMD GPU with pyamdgpuinfo pulls in all the stats at once
278+
pyamdgpuinfo.detect_gpus()
278279
amd_gpu = pyamdgpuinfo.get_gpu(0)
279280

280281
try:
@@ -345,6 +346,7 @@ def fan_percent() -> float:
345346
@staticmethod
346347
def frequency() -> float:
347348
if pyamdgpuinfo:
349+
pyamdgpuinfo.detect_gpus()
348350
return pyamdgpuinfo.get_gpu(0).query_sclk() / 1000000
349351
elif pyadl:
350352
return pyadl.ADLManager.getInstance().getDevices()[0].getCurrentEngineClock()

0 commit comments

Comments
 (0)