Skip to content

Commit

Permalink
Default to nvidia.
Browse files Browse the repository at this point in the history
  • Loading branch information
bethune-bryant committed Jul 29, 2024
1 parent 3c1a744 commit 8ba8134
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions gpustat/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@

from gpustat import util

if util.hasNvidia():
from gpustat import nvml
from gpustat.nvml import nvml as N
from gpustat.nvml import check_driver_nvml_version
else:
if util.hasAMD():
from gpustat import rocml as nvml
from gpustat import rocml as N
from gpustat.rocml import check_driver_nvml_version
else:
from gpustat import nvml
from gpustat.nvml import nvml as N
from gpustat.nvml import check_driver_nvml_version

NOT_SUPPORTED = 'Not Supported'
MB = 1024 * 1024
Expand Down
4 changes: 2 additions & 2 deletions gpustat/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ def report_summary(self, concise=True):
self._write('')


def hasNvidia():
def hasAMD():
try:
subprocess.check_output('nvidia-smi')
subprocess.check_output('rocm-smi')
return True
except Exception:
return False

0 comments on commit 8ba8134

Please sign in to comment.