aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2022-12-03 10:30:34 +0300
committerGitHub <noreply@github.com>2022-12-03 10:30:34 +0300
commit681c0003df071a311142dd09628dfcaac8c73d5b (patch)
treeb859c3688b8c77a760ffe31148ae109885ee7940
parent37fc1fa401c13369f42a77542d07ed81d6c8b59a (diff)
parent62e9fec3df8518da3a2c35fa090bb54946c856b2 (diff)
Merge pull request #4407 from yoinked-h/patch-1
Fix issue with 16xx cards
-rw-r--r--modules/devices.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/devices.py b/modules/devices.py
index 046460fa..1325569c 100644
--- a/modules/devices.py
+++ b/modules/devices.py
@@ -53,10 +53,17 @@ def torch_gc():
def enable_tf32():
if torch.cuda.is_available():
+ for devid in range(0,torch.cuda.device_count()):
+ if torch.cuda.get_device_capability(devid) == (7, 5):
+ shd = True
+ if shd:
+ torch.backends.cudnn.benchmark = True
+ torch.backends.cudnn.enabled = True
torch.backends.cuda.matmul.allow_tf32 = True
torch.backends.cudnn.allow_tf32 = True
+
errors.run(enable_tf32, "Enabling TF32")
cpu = torch.device("cpu")