check for ampere

This commit is contained in:
C43H66N12O12S2 2022-10-08 17:27:21 +03:00 committed by AUTOMATIC1111
parent 7e639cd498
commit 017b6b8744
1 changed files with 4 additions and 3 deletions

View File

@ -22,7 +22,8 @@ def apply_optimizations():
undo_optimizations()
ldm.modules.diffusionmodules.model.nonlinearity = silu
if cmd_opts.xformers and shared.xformers_available and not torch.version.hip:
if cmd_opts.xformers and shared.xformers_available and torch.version.cuda:
if torch.cuda.get_device_capability(shared.device) == (8, 6):
ldm.modules.attention.CrossAttention.forward = sd_hijack_optimizations.xformers_attention_forward
ldm.modules.diffusionmodules.model.AttnBlock.forward = sd_hijack_optimizations.xformers_attnblock_forward
elif cmd_opts.opt_split_attention_v1: