Skip to content

Commit

Permalink
Merge pull request #571 from mathoudebine/fix/537-cannot-select-gpu-t…
Browse files Browse the repository at this point in the history
…o-use-when-theres-an-apuigpu-available
  • Loading branch information
mathoudebine authored Sep 9, 2024
2 parents 8434c0a + 4aa8935 commit 4ca1f5f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions library/sensors/sensors_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,14 @@ def frequency() -> float:
@staticmethod
def is_available() -> bool:
global DETECTED_GPU
if GpuAmd.is_available():
logger.info("Detected AMD GPU(s)")
DETECTED_GPU = GpuType.AMD
elif GpuNvidia.is_available():
# Always use Nvidia GPU if available
if GpuNvidia.is_available():
logger.info("Detected Nvidia GPU(s)")
DETECTED_GPU = GpuType.NVIDIA
# Otherwise, use the AMD GPU / APU if available
elif GpuAmd.is_available():
logger.info("Detected AMD GPU(s)")
DETECTED_GPU = GpuType.AMD
else:
logger.warning("No supported GPU found")
DETECTED_GPU = GpuType.UNSUPPORTED
Expand Down

0 comments on commit 4ca1f5f

Please sign in to comment.