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
Tento commit je obsažen v:
Bill(Shuzhou) Liu
2022-03-28 11:47:19 -04:00
odevzdal Shuzhou Liu
rodič 7860de5107
revize 9f6614e83b
+1 -1
Zobrazit soubor
@@ -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: