aboutsummaryrefslogtreecommitdiffstats
path: root/modules/devices.py
diff options
context:
space:
mode:
authorpepe10-gpu <pepe.dannyboy@gmail.com>2022-11-08 02:06:48 +0000
committerGitHub <noreply@github.com>2022-11-08 02:06:48 +0000
commit29eff4a194d22f0f0e7a7a976d746a71a4193cf5 (patch)
treee10345ef4e61f055da7a71de53e69af06446c6c6 /modules/devices.py
parentcd6c55c1ab14fcab15329cde599cf79e8d555657 (diff)
downloadstable-diffusion-webui-gfx803-29eff4a194d22f0f0e7a7a976d746a71a4193cf5.tar.gz
stable-diffusion-webui-gfx803-29eff4a194d22f0f0e7a7a976d746a71a4193cf5.tar.bz2
stable-diffusion-webui-gfx803-29eff4a194d22f0f0e7a7a976d746a71a4193cf5.zip
terrible hack
Diffstat (limited to 'modules/devices.py')
-rw-r--r--modules/devices.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/modules/devices.py b/modules/devices.py
index 858bf399..4c63f465 100644
--- a/modules/devices.py
+++ b/modules/devices.py
@@ -39,8 +39,15 @@ def torch_gc():
def enable_tf32():
if torch.cuda.is_available():
- torch.backends.cudnn.benchmark = True
- torch.backends.cudnn.enabled = True
+ #TODO: make this better; find a way to check if it is a turing card
+ turing = ["1630","1650","1660","Quadro RTX 3000","Quadro RTX 4000","Quadro RTX 4000","Quadro RTX 5000","Quadro RTX 5000","Quadro RTX 6000","Quadro RTX 6000","Quadro RTX 8000","Quadro RTX T400","Quadro RTX T400","Quadro RTX T600","Quadro RTX T1000","Quadro RTX T1000","2060","2070","2080","Titan RTX","Tesla T4","MX450","MX550"]
+ for devid in range(0,torch.cuda.device_count()):
+ for i in turing:
+ if i in torch.cuda.get_device_name(devid):
+ 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