mirror of
https://github.com/clearml/clearml
synced 2025-06-25 17:46:28 +00:00
Fix machine specs when GPU is not supported
This commit is contained in:
parent
d83f1cd2c1
commit
d585535dcd
@ -335,6 +335,7 @@ class ResourceMonitor(BackgroundMonitor):
|
|||||||
|
|
||||||
def _get_machine_specs(self):
|
def _get_machine_specs(self):
|
||||||
# type: () -> dict
|
# type: () -> dict
|
||||||
|
specs = {}
|
||||||
# noinspection PyBroadException
|
# noinspection PyBroadException
|
||||||
try:
|
try:
|
||||||
specs = {
|
specs = {
|
||||||
@ -347,10 +348,10 @@ class ResourceMonitor(BackgroundMonitor):
|
|||||||
'memory_gb': round(psutil.virtual_memory().total / 1024 ** 3, 1),
|
'memory_gb': round(psutil.virtual_memory().total / 1024 ** 3, 1),
|
||||||
'hostname': str(platform.node()),
|
'hostname': str(platform.node()),
|
||||||
'gpu_count': 0,
|
'gpu_count': 0,
|
||||||
'gpu_type': '',
|
'gpu_type': 'N/A',
|
||||||
'gpu_memory': '',
|
'gpu_memory': 'N/A',
|
||||||
'gpu_driver_version': '',
|
'gpu_driver_version': 'N/A',
|
||||||
'gpu_driver_cuda_version': '',
|
'gpu_driver_cuda_version': 'N/A',
|
||||||
}
|
}
|
||||||
if self._gpustat:
|
if self._gpustat:
|
||||||
gpu_stat = self._gpustat.new_query(shutdown=True, get_driver_info=True)
|
gpu_stat = self._gpustat.new_query(shutdown=True, get_driver_info=True)
|
||||||
@ -363,6 +364,6 @@ class ResourceMonitor(BackgroundMonitor):
|
|||||||
specs['gpu_driver_cuda_version'] = gpu_stat.driver_cuda_version or ''
|
specs['gpu_driver_cuda_version'] = gpu_stat.driver_cuda_version or ''
|
||||||
|
|
||||||
except Exception:
|
except Exception:
|
||||||
return {}
|
pass
|
||||||
|
|
||||||
return specs
|
return specs
|
||||||
|
Loading…
Reference in New Issue
Block a user