From b77036443ffc8175b21675ad49874c996ca40071 Mon Sep 17 00:00:00 2001 From: JeLuF Date: Thu, 18 May 2023 16:04:28 +0200 Subject: [PATCH] Fail gracefully if proc access isn't possible --- scripts/check_modules.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/check_modules.py b/scripts/check_modules.py index 18549217..df89f2b2 100644 --- a/scripts/check_modules.py +++ b/scripts/check_modules.py @@ -130,10 +130,13 @@ def include_cuda_versions(module_versions: tuple) -> tuple: def is_amd_on_linux(): if os_name == "Linux": - with open("/proc/bus/pci/devices", "r") as f: - device_info = f.read() - if "amdgpu" in device_info and "nvidia" not in device_info: - return True + try: + with open("/proc/bus/pci/devices", "r") as f: + device_info = f.read() + if "amdgpu" in device_info and "nvidia" not in device_info: + return True + except: + return False return False