From 9bf38c36a3577ea7b59f99867c95ad0ba99db144 Mon Sep 17 00:00:00 2001 From: "Bill(Shuzhou) Liu" Date: Mon, 28 Mar 2022 11:47:19 -0400 Subject: [PATCH] Sanity check amdgpu module is loaded in rocm_smi.py Instead of check /proc/modules for amdgpu, the code will check /sys/module/amdgpu/initstate which covers the case when the driver is compiled into the kernel. Change-Id: Id39ec5b0eb9b68204bc9f5f779057ba8cc090bdc [ROCm/amdsmi commit: 9f6614e83b6d5a09015efb76ed1421605be612dd] --- projects/amdsmi/python_smi_tools/rocm_smi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/amdsmi/python_smi_tools/rocm_smi.py b/projects/amdsmi/python_smi_tools/rocm_smi.py index 056ab2fbd8..0271e40ea0 100755 --- a/projects/amdsmi/python_smi_tools/rocm_smi.py +++ b/projects/amdsmi/python_smi_tools/rocm_smi.py @@ -66,7 +66,7 @@ def driverInitialized(): """ driverInitialized = '' try: - driverInitialized = str(subprocess.check_output("cat /proc/modules|grep amdgpu", shell=True)) + driverInitialized = str(subprocess.check_output("cat /sys/module/amdgpu/initstate |grep live", shell=True)) except subprocess.CalledProcessError: pass if len(driverInitialized) > 0: