aboutsummaryrefslogtreecommitdiff
path: root/modules/devices.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2022-12-03 15:57:52 +0300
committerAUTOMATIC <16777216c@gmail.com>2022-12-03 15:57:52 +0300
commit2651267e3af5886b8b6b1dc3023f2507f7079118 (patch)
treefb655cb8be97adec6a15a334ae8d5aae7d041c3e /modules/devices.py
parentce049c471b4a1d22f5a8fe8f527788edcf934eda (diff)
fix #4407 breaking UI entirely for card other than ones related to the PR
Diffstat (limited to 'modules/devices.py')
-rw-r--r--modules/devices.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/modules/devices.py b/modules/devices.py
index 1325569c..547ea46c 100644
--- a/modules/devices.py
+++ b/modules/devices.py
@@ -53,12 +53,10 @@ 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:
+ if any([torch.cuda.get_device_capability(devid) == (7, 5) for devid in range(0, torch.cuda.device_count())]):
torch.backends.cudnn.benchmark = True
torch.backends.cudnn.enabled = True
+
torch.backends.cuda.matmul.allow_tf32 = True
torch.backends.cudnn.allow_tf32 = True