From c7c2ac55597915cc2584ebf206d5c5d55a7c4833 Mon Sep 17 00:00:00 2001 From: Kent Russell Date: Tue, 13 Apr 2021 08:00:17 -0400 Subject: [PATCH] rocm_smi.py: Don't try to reset non-AMD GPUs This won't work for obvious reasons, so exit with an error instead of trying to access a file that doesn't exist and segfaulting Change-Id: Id1230922fa6e9a19e9394280faad88a43c7d2e34 --- python_smi_tools/rocm_smi.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/python_smi_tools/rocm_smi.py b/python_smi_tools/rocm_smi.py index 087a223c17..e52aa3ad38 100755 --- a/python_smi_tools/rocm_smi.py +++ b/python_smi_tools/rocm_smi.py @@ -941,6 +941,10 @@ def resetGpu(device): logging.error('GPU Reset can only be performed on one GPU per call') RETCODE = 1 return + if not isAmdDevice(device): + logging.error('GPU Reset can only be performed on an AMD GPU') + RETCODE = 1 + return resetDev = int(device[0]) ret = rocmsmi.rsmi_dev_gpu_reset(resetDev) if rsmi_ret_ok(ret, resetDev):