diff --git a/amdsmi_cli/amdsmi_helpers.py b/amdsmi_cli/amdsmi_helpers.py index e30e433a5..d89025724 100755 --- a/amdsmi_cli/amdsmi_helpers.py +++ b/amdsmi_cli/amdsmi_helpers.py @@ -1252,6 +1252,11 @@ def _has_read_access(self, path: str) -> Tuple[bool, Optional[int], Optional[str if os.geteuid() == 0: return True, None, None + # Use os.access to check read permission (including ACLs) without + # opening the path, to avoid potential issues with device nodes. + if os.access(path, os.R_OK): + return True, None, None + mode = st.st_mode uid = st.st_uid gid = st.st_gid