Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

Commit

Permalink
fix: add exception handling to get amd gpu usage
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed Jan 19, 2024
1 parent 4826e9b commit 0bb8d49
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pyra/hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ def update_gpu():
gpu_load = min(100, gpu.query_load()) # max of 100
else:
name = f'{gpu.adapterName.decode("utf-8")}-{gpu.adapterIndex}' # adapterName is bytes so decode it
gpu_load = min(100, gpu.getCurrentUsage()) # max of 100
try:
gpu_load = min(100, gpu.getCurrentUsage()) # max of 100
except Exception:
gpu_load = None

Check warning on line 157 in pyra/hardware.py

View check run for this annotation

Codecov / codecov/patch

pyra/hardware.py#L154-L157

Added lines #L154 - L157 were not covered by tests

if initialized and name:
try:
Expand Down

0 comments on commit 0bb8d49

Please sign in to comment.