Make error messages for gpu stats more clear (#4962)

* Make error messages for gpu stats more clear

* Make error messages for gpu stats more clear
This commit is contained in:
Nicolas Mowen 2023-01-08 13:00:46 -07:00 committed by GitHub
parent 5f4c439f57
commit 61243ad34b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -780,7 +780,7 @@ def get_amd_gpu_stats() -> dict[str, str]:
) )
if p.returncode != 0: if p.returncode != 0:
logger.error(p.stderr) logger.error(f"Unable to poll radeon GPU stats: {p.stderr}")
return None return None
else: else:
usages = p.stdout.split(",") usages = p.stdout.split(",")
@ -816,7 +816,7 @@ def get_intel_gpu_stats() -> dict[str, str]:
# timeout has a non-zero returncode when timeout is reached # timeout has a non-zero returncode when timeout is reached
if p.returncode != 124: if p.returncode != 124:
logger.error(p.stderr) logger.error(f"Unable to poll intel GPU stats: {p.stderr}")
return None return None
else: else:
reading = "".join(p.stdout.split()) reading = "".join(p.stdout.split())
@ -866,7 +866,7 @@ def get_nvidia_gpu_stats() -> dict[str, str]:
) )
if p.returncode != 0: if p.returncode != 0:
logger.error(p.stderr) logger.error(f"Unable to poll nvidia GPU stats: {p.stderr}")
return None return None
else: else:
usages = p.stdout.split("\n")[1].strip().split(",") usages = p.stdout.split("\n")[1].strip().split(",")