Skip to content

Commit

Permalink
Sanity check amdgpu module is loaded in rocm_smi.py
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bill-shuzhou-liu committed Apr 14, 2022
1 parent 7860de5 commit 9f6614e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python_smi_tools/rocm_smi.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 9f6614e

Please sign in to comment.