Skip to content

Commit

Permalink
Use Nvidia GPU in priority
Browse files Browse the repository at this point in the history
  • Loading branch information
mathoudebine committed Jul 22, 2024
1 parent 980577f commit 4aa8935
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 4aa8935

Please sign in to comment.