Catch exceptions from rocm-smi (#85)

Signed-off-by: coleramos425 <colramos@amd.com>
This commit is contained in:
coleramos425
2023-02-21 09:47:45 -06:00
parent 1d82bc67b0
commit f77173a2f1
+4
View File
@@ -216,6 +216,10 @@ def get_machine_specs(devicenum):
) = gpuinfo()
rocm_smi = run(["rocm-smi"])
if search(r"ERROR(\S*)", rocm_smi) != None:
print("ERROR: No GPU detected. Unable to load rocm-smi")
sys.exit(1)
device = rf"^\s*{devicenum}(.*)"
hostname = socket.gethostname()