From ff6b047a74745f93d528df19cc3b40c6f185808c Mon Sep 17 00:00:00 2001 From: comfyanonymous Date: Mon, 17 Jul 2023 15:18:58 -0400 Subject: [PATCH] Fix device print on old torch version. --- comfy/model_management.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/comfy/model_management.py b/comfy/model_management.py index 69542cc37..34d22429a 100644 --- a/comfy/model_management.py +++ b/comfy/model_management.py @@ -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: