Initial ZLUDA support.

This commit is contained in:
Seunghoon Lee
2024-02-15 07:38:49 +09:00
parent a956be05f7
commit cc4438651f
2 changed files with 11 additions and 0 deletions
+3
View File
@@ -17,6 +17,7 @@ from modules import errors, shared_items, shared_state, cmd_args, theme
from modules.paths import models_path, script_path, data_path, sd_configs_path, sd_default_config, sd_model_file, default_sd_model_file, extensions_dir, extensions_builtin_dir # pylint: disable=W0611
from modules.dml import memory_providers, default_memory_provider, directml_do_hijack
from modules.onnx_impl import initialize_onnx, execution_providers
from modules.zluda import initialize_zluda
import modules.interrogate
import modules.memmon
import modules.styles
@@ -922,6 +923,8 @@ mem_mon = modules.memmon.MemUsageMonitor("MemMon", devices.device)
max_workers = 4
if devices.backend == "directml":
directml_do_hijack()
elif devices.backend == "cuda":
initialize_zluda()
initialize_onnx()
+8
View File
@@ -0,0 +1,8 @@
import torch
from modules import shared, devices
def initialize_zluda():
if devices.cuda_ok and torch.cuda.get_device_name(devices.get_optimal_device()).endswith("[ZLUDA]"):
torch.backends.cudnn.enabled = False
shared.opts.cross_attention_optimization = "Batch matrix-matrix"