Modify smi error detection to check for non-zero exit code

Signed-off-by: colramos-amd <colramos@amd.com>


[ROCm/rocprofiler-compute commit: 194e168414]
This commit is contained in:
colramos-amd
2024-02-02 14:27:08 -06:00
parent 4fbbe78d08
commit c40ad2895e
@@ -224,7 +224,7 @@ def gpuinfo():
def run(cmd):
p = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if cmd[0] == "rocm-smi" and p.returncode == 8:
if cmd[0] == "rocm-smi" and p.returncode != 0:
print("ERROR: No GPU detected. Unable to load rocm-smi")
sys.exit(1)
return p.stdout.decode("utf-8")