[SWDEV-495057] Update check to ignore sudo (#150)

Change-Id: Id4f24c254e805647782ae68667903a8d467c49b1

Signed-off-by: adapryor <Adam.pryor@amd.com>

[ROCm/amdsmi commit: ace5162735]
Этот коммит содержится в:
Pryor, Adam
2025-03-05 23:54:24 -06:00
коммит произвёл GitHub
родитель 66d62a786c
Коммит 58f8b8666f
+5
Просмотреть файл
@@ -992,6 +992,11 @@ class AMDSMIHelpers():
Check if the current user is a member of the required groups.
If not, log a warning.
"""
# Skip check if running as root.
if os.geteuid() == 0:
return
required_groups = {'video', 'render'}
try:
user_groups = {grp.getgrgid(gid).gr_name for gid in os.getgroups()}