diff options
author | CodeHatchling <steve@codehatch.com> | 2023-12-03 04:14:02 +0000 |
---|---|---|
committer | CodeHatchling <steve@codehatch.com> | 2023-12-03 04:14:02 +0000 |
commit | 3bd3a091604a332de6ff249870dabd2a91215499 (patch) | |
tree | 0323625627748ee44fc192bb2496585a4db56b5a /modules/devices.py | |
parent | bb04d400c95df01d191ef6c1a43e66b95425fa33 (diff) | |
parent | f0f100e67b78f686dc73cf3c8cad422e45cc9b8a (diff) | |
download | stable-diffusion-webui-gfx803-3bd3a091604a332de6ff249870dabd2a91215499.tar.gz stable-diffusion-webui-gfx803-3bd3a091604a332de6ff249870dabd2a91215499.tar.bz2 stable-diffusion-webui-gfx803-3bd3a091604a332de6ff249870dabd2a91215499.zip |
Merge remote-tracking branch 'origin/dev' into soft-inpainting
# Conflicts:
# modules/processing.py
Diffstat (limited to 'modules/devices.py')
-rw-r--r-- | modules/devices.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/devices.py b/modules/devices.py index c01f0602..1d4eb563 100644 --- a/modules/devices.py +++ b/modules/devices.py @@ -60,7 +60,8 @@ 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 - if any(torch.cuda.get_device_capability(devid) == (7, 5) for devid in range(0, torch.cuda.device_count())): + 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 torch.backends.cuda.matmul.allow_tf32 = True |