mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 04:55:04 +08:00
[tune][minor] Avoid throwing error when gpu check fails (#7362)
This commit is contained in:
@@ -58,7 +58,12 @@ class UtilMonitor(Thread):
|
||||
self.values["ram_util_percent"].append(
|
||||
float(getattr(psutil.virtual_memory(), "percent")))
|
||||
if GPUtil is not None:
|
||||
for gpu in GPUtil.getGPUs():
|
||||
gpu_list = []
|
||||
try:
|
||||
gpu_list = GPUtil.getGPUs()
|
||||
except Exception:
|
||||
logger.debug("GPUtil failed to retrieve GPUs.")
|
||||
for gpu in gpu_list:
|
||||
self.values["gpu_util_percent" + str(gpu.id)].append(
|
||||
float(gpu.load))
|
||||
self.values["vram_util_percent" + str(gpu.id)].append(
|
||||
|
||||
Reference in New Issue
Block a user