Commit ff6b047a authored by comfyanonymous's avatar comfyanonymous
Browse files

Fix device print on old torch version.

parent 9871a15c
...@@ -204,7 +204,11 @@ print(f"Set vram state to: {vram_state.name}") ...@@ -204,7 +204,11 @@ print(f"Set vram state to: {vram_state.name}")
def get_torch_device_name(device): def get_torch_device_name(device):
if hasattr(device, 'type'): if hasattr(device, 'type'):
if device.type == "cuda": 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: else:
return "{}".format(device.type) return "{}".format(device.type)
else: else:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment