Skip to content

Commit e78d230

Browse files
Only enable cuda malloc on cuda torch. (Comfy-Org#9031)
1 parent d3504e1 commit e78d230

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cuda_malloc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ def cuda_malloc_supported():
7474
module = importlib.util.module_from_spec(spec)
7575
spec.loader.exec_module(module)
7676
version = module.__version__
77-
if int(version[0]) >= 2: #enable by default for torch version 2.0 and up
77+
78+
if int(version[0]) >= 2 and "+cu" in version: #enable by default for torch version 2.0 and up only on cuda torch
7879
args.cuda_malloc = cuda_malloc_supported()
7980
except:
8081
pass

0 commit comments

Comments
 (0)