Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions comfy_aimdo/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@


def detect_vendor():
version = ""
try:
torch_spec = importlib.util.find_spec("torch")
for folder in torch_spec.submodule_search_locations:
Expand All @@ -19,15 +18,13 @@ def detect_vendor():
spec = importlib.util.spec_from_file_location("torch_version_import", ver_file)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
version = module.__version__
if module.cuda != None:
return "cuda"
if module.rocm != None:
return "rocm"
except Exception as e:
logging.warning("Failed to detect Torch version")
pass

if '+cu' in version:
return "cuda"
if '+rocm' in version:
return "rocm"
return None


Expand Down