rocm_smi.py: Fix gpu reset error

Since device is a list, we need to pass a single item to the isAmdGpu
function.

Fixes: 17bdc065a1 "rocm_smi.py: Don't try to reset non-AMD GPUs"

Signed-off-by: Kent Russell <kent.russell@amd.com>
Change-Id: I19a74377636ff4589f11d092f41e1d35c1acb307


[ROCm/rocm_smi_lib commit: 242d94a668]
This commit is contained in:
Kent Russell
2021-04-28 07:43:07 -04:00
parent 2ba625e569
commit 22485bf114
@@ -961,11 +961,11 @@ def resetGpu(device):
logging.error('GPU Reset can only be performed on one GPU per call')
RETCODE = 1
return
if not isAmdDevice(device):
resetDev = int(device[0])
if not isAmdDevice(resetDev):
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):
printLog(resetDev, 'Successfully reset GPU %d' % (resetDev), None)