mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-07-03 13:19:23 +08:00
Merge 9696b494fa into 35c1470935
This commit is contained in:
commit
b822aa1add
@ -65,6 +65,7 @@ def cuda_malloc_supported():
|
|||||||
|
|
||||||
|
|
||||||
version = ""
|
version = ""
|
||||||
|
cuda_available = False
|
||||||
|
|
||||||
try:
|
try:
|
||||||
torch_spec = importlib.util.find_spec("torch")
|
torch_spec = importlib.util.find_spec("torch")
|
||||||
@ -75,6 +76,7 @@ try:
|
|||||||
module = importlib.util.module_from_spec(spec)
|
module = importlib.util.module_from_spec(spec)
|
||||||
spec.loader.exec_module(module)
|
spec.loader.exec_module(module)
|
||||||
version = module.__version__
|
version = module.__version__
|
||||||
|
cuda_available = module.cuda != None
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -89,7 +91,7 @@ def get_raw_cuda_version(version_str):
|
|||||||
|
|
||||||
if not args.cuda_malloc:
|
if not args.cuda_malloc:
|
||||||
try:
|
try:
|
||||||
if int(version[0]) >= 2 and "+cu" in version: # enable by default for torch version 2.0 and up only on cuda torch
|
if int(version[0]) >= 2 and cuda_available: # enable by default for torch version 2.0 and up only on cuda torch
|
||||||
if PerformanceFeature.AutoTune not in args.fast: # Autotune has issues with cuda malloc
|
if PerformanceFeature.AutoTune not in args.fast: # Autotune has issues with cuda malloc
|
||||||
cuda_version = get_raw_cuda_version(version)
|
cuda_version = get_raw_cuda_version(version)
|
||||||
if cuda_version is not None and cuda_version >= 130:
|
if cuda_version is not None and cuda_version >= 130:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user