diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-09-09 06:39:37 +0000 |
---|---|---|
committer | AUTOMATIC1111 <16777216c@gmail.com> | 2023-09-09 06:39:37 +0000 |
commit | 46375f059276cb2d4d1e47bf65f984c6466dc2a0 (patch) | |
tree | 4580b8900177b75807f73ecabc7389b3276fd49a /modules | |
parent | 558baffa2c934e84eff1a6648b2b4f4c4eb25e2b (diff) | |
download | stable-diffusion-webui-gfx803-46375f059276cb2d4d1e47bf65f984c6466dc2a0.tar.gz stable-diffusion-webui-gfx803-46375f059276cb2d4d1e47bf65f984c6466dc2a0.tar.bz2 stable-diffusion-webui-gfx803-46375f059276cb2d4d1e47bf65f984c6466dc2a0.zip |
fix for crash when running #12924 without --device-id
Diffstat (limited to 'modules')
-rw-r--r-- | modules/devices.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/devices.py b/modules/devices.py index 63c38eff..1d4eb563 100644 --- a/modules/devices.py +++ b/modules/devices.py @@ -60,7 +60,7 @@ def enable_tf32(): # enabling benchmark option seems to enable a range of cards to do fp16 when they otherwise can't # see https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/4407 - device_id = (int(shared.cmd_opts.device_id) if shared.cmd_opts.device_id.isdigit() else 0) or torch.cuda.current_device() + device_id = (int(shared.cmd_opts.device_id) if shared.cmd_opts.device_id is not None and shared.cmd_opts.device_id.isdigit() else 0) or torch.cuda.current_device() if torch.cuda.get_device_capability(device_id) == (7, 5) and torch.cuda.get_device_name(device_id).startswith("NVIDIA GeForce GTX 16"): torch.backends.cudnn.benchmark = True |