Files
automatic/modules/zluda.py
T
2024-02-15 20:42:34 +03:00

11 lines
430 B
Python

import platform
import torch
from modules import shared, devices
def initialize_zluda():
if platform.system() == "Windows" and devices.cuda_ok and torch.cuda.get_device_name(devices.get_optimal_device()).endswith("[ZLUDA]"):
torch.backends.cudnn.enabled = False
if shared.opts.cross_attention_optimization == "Scaled-Dot-Product":
shared.opts.cross_attention_optimization = "Batch matrix-matrix"