mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-11 06:40:48 +08:00
Fix running on CPU again
This commit is contained in:
parent
b00964ace4
commit
8ab6b4b697
@ -1034,9 +1034,16 @@ def should_use_bf16(device=None, model_params=0, prioritize_performance=True, ma
|
||||
if is_intel_xpu():
|
||||
return True
|
||||
|
||||
props = torch.cuda.get_device_properties("cuda")
|
||||
if props.major >= 8:
|
||||
return True
|
||||
if device is None:
|
||||
device = torch.device("cuda")
|
||||
|
||||
try:
|
||||
props = torch.cuda.get_device_properties(device)
|
||||
if props.major >= 8:
|
||||
return True
|
||||
except AssertionError:
|
||||
logging.warning("Torch was not compiled with CUDA support")
|
||||
return False
|
||||
|
||||
bf16_works = torch.cuda.is_bf16_supported()
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user