Fail gracefully if proc access isn't possible

This commit is contained in:
JeLuF 2023-05-18 16:04:28 +02:00
parent e4a7537952
commit b77036443f

View File

@ -130,10 +130,13 @@ def include_cuda_versions(module_versions: tuple) -> tuple:
def is_amd_on_linux(): def is_amd_on_linux():
if os_name == "Linux": if os_name == "Linux":
try:
with open("/proc/bus/pci/devices", "r") as f: with open("/proc/bus/pci/devices", "r") as f:
device_info = f.read() device_info = f.read()
if "amdgpu" in device_info and "nvidia" not in device_info: if "amdgpu" in device_info and "nvidia" not in device_info:
return True return True
except:
return False
return False return False