mirror of
https://github.com/vale981/ray
synced 2025-03-06 18:41:40 -05:00
[tune][minor] Avoid throwing error when gpu check fails (#7362)
This commit is contained in:
parent
f321eaec9b
commit
ca40b0fcc6
1 changed files with 6 additions and 1 deletions
|
@ -58,7 +58,12 @@ class UtilMonitor(Thread):
|
||||||
self.values["ram_util_percent"].append(
|
self.values["ram_util_percent"].append(
|
||||||
float(getattr(psutil.virtual_memory(), "percent")))
|
float(getattr(psutil.virtual_memory(), "percent")))
|
||||||
if GPUtil is not None:
|
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(
|
self.values["gpu_util_percent" + str(gpu.id)].append(
|
||||||
float(gpu.load))
|
float(gpu.load))
|
||||||
self.values["vram_util_percent" + str(gpu.id)].append(
|
self.values["vram_util_percent" + str(gpu.id)].append(
|
||||||
|
|
Loading…
Add table
Reference in a new issue