mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2024-12-26 08:58:54 +01:00
Fail gracefully if proc access isn't possible
This commit is contained in:
parent
e4a7537952
commit
b77036443f
@ -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":
|
||||||
with open("/proc/bus/pci/devices", "r") as f:
|
try:
|
||||||
device_info = f.read()
|
with open("/proc/bus/pci/devices", "r") as f:
|
||||||
if "amdgpu" in device_info and "nvidia" not in device_info:
|
device_info = f.read()
|
||||||
return True
|
if "amdgpu" in device_info and "nvidia" not in device_info:
|
||||||
|
return True
|
||||||
|
except:
|
||||||
|
return False
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user