Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
ComfyUI
Commits
ff6b047a
Commit
ff6b047a
authored
Jul 17, 2023
by
comfyanonymous
Browse files
Fix device print on old torch version.
parent
9871a15c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
comfy/model_management.py
comfy/model_management.py
+5
-1
No files found.
comfy/model_management.py
View file @
ff6b047a
...
...
@@ -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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment