Don't use ROCm on Linux if an NVIDIA card is present

This commit is contained in:
cmdr2 2023-04-18 17:14:24 +05:30
parent 30a133bad9
commit bf3df097b8

View File

@ -82,7 +82,7 @@ def apply_torch_install_overrides(module_version: str):
elif os_name == "Linux":
with open("/proc/bus/pci/devices", "r") as f:
device_info = f.read()
if "amdgpu" in device_info:
if "amdgpu" in device_info and "nvidia" not in device_info:
index_url = "https://download.pytorch.org/whl/rocm5.4.2"
return module_version, index_url