Change Task runtime info: add prefix cpu_/gpu_: cpu_cores, gpu_driver_version, gpu_driver_cuda_version

This commit is contained in:
allegroai 2021-07-04 09:32:33 +03:00
parent 226c68330e
commit 75d0577570

View File

@ -343,14 +343,14 @@ class ResourceMonitor(BackgroundMonitor):
'python_exec': str(sys.executable), 'python_exec': str(sys.executable),
'OS': str(platform.platform(aliased=True)), 'OS': str(platform.platform(aliased=True)),
'processor': str(platform.machine()), 'processor': str(platform.machine()),
'cores': int(psutil.cpu_count()), 'cpu_cores': int(psutil.cpu_count()),
'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': '',
'gpu_memory': '', 'gpu_memory': '',
'driver_version': '', 'gpu_driver_version': '',
'driver_cuda_version': '', 'gpu_driver_cuda_version': '',
} }
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)
@ -359,8 +359,8 @@ class ResourceMonitor(BackgroundMonitor):
specs['gpu_count'] = int(len(gpus)) specs['gpu_count'] = int(len(gpus))
specs['gpu_type'] = ', '.join(g.name for g in gpus) specs['gpu_type'] = ', '.join(g.name for g in gpus)
specs['gpu_memory'] = ', '.join('{}GB'.format(round(g.memory_total/1024.0)) for g in gpus) specs['gpu_memory'] = ', '.join('{}GB'.format(round(g.memory_total/1024.0)) for g in gpus)
specs['driver_version'] = gpu_stat.driver_version or '' specs['gpu_driver_version'] = gpu_stat.driver_version or ''
specs['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 {} return {}