mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
Initial ZLUDA support.
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
|
||||
@@ -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"
|
||||
Reference in New Issue
Block a user