mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-01-25 15:55:18 +00:00
Fix device print on old torch version.
This commit is contained in:
parent
9871a15cf9
commit
ff6b047a74
@ -204,7 +204,11 @@ print(f"Set vram state to: {vram_state.name}")
|
||||
def get_torch_device_name(device):
|
||||
if hasattr(device, 'type'):
|
||||
if device.type == "cuda":
|
||||
return "{} {} : {}".format(device, torch.cuda.get_device_name(device), torch.cuda.get_allocator_backend())
|
||||
try:
|
||||
allocator_backend = torch.cuda.get_allocator_backend()
|
||||
except:
|
||||
allocator_backend = ""
|
||||
return "{} {} : {}".format(device, torch.cuda.get_device_name(device), allocator_backend)
|
||||
else:
|
||||
return "{}".format(device.type)
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user