mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-13 00:47:03 +08:00
feat: add basic zluda support
This commit is contained in:
parent
dccca1daa5
commit
daeabb3fdb
@ -254,7 +254,24 @@ def get_torch_device_name(device):
|
||||
return "CUDA {}: {}".format(device, torch.cuda.get_device_name(device))
|
||||
|
||||
try:
|
||||
print("Device:", get_torch_device_name(get_torch_device()))
|
||||
torch_device_name = get_torch_device_name(get_torch_device())
|
||||
|
||||
if "[ZLUDA]" in torch_device_name:
|
||||
print("Detected ZLUDA, support for it is experimental and comfy may not work properly.")
|
||||
|
||||
if torch.backends.cudnn.enabled:
|
||||
torch.backends.cudnn.enabled = False
|
||||
print("Disabling cuDNN because ZLUDA does currently not support it.")
|
||||
|
||||
torch.backends.cuda.enable_flash_sdp(True)
|
||||
torch.backends.cuda.enable_math_sdp(False)
|
||||
torch.backends.cuda.enable_mem_efficient_sdp(False)
|
||||
|
||||
if ENABLE_PYTORCH_ATTENTION:
|
||||
print("Disabling pytorch cross attention because ZLUDA does currently not support it.")
|
||||
ENABLE_PYTORCH_ATTENTION = False
|
||||
|
||||
print("Device:", torch_device_name)
|
||||
except:
|
||||
print("Could not pick default device.")
|
||||
|
||||
|
||||
@ -50,7 +50,9 @@ def cuda_malloc_supported():
|
||||
except:
|
||||
names = set()
|
||||
for x in names:
|
||||
if "NVIDIA" in x:
|
||||
if "AMD" in x:
|
||||
return False
|
||||
elif "NVIDIA" in x:
|
||||
for b in blacklist:
|
||||
if b in x:
|
||||
return False
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user