Skip to content

Commit adb3ddd

Browse files
committed
main: init all visible cuda devices in aimdo
1 parent 48deb15 commit adb3ddd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def execute_script(script_path):
192192
if 'torch' in sys.modules:
193193
logging.warning("WARNING: Potential Error in code: Torch already imported, torch should never be imported before this point.")
194194

195-
195+
import torch
196196
import comfy.utils
197197

198198
import execution
@@ -210,7 +210,7 @@ def execute_script(script_path):
210210
if args.enable_dynamic_vram or (enables_dynamic_vram() and comfy.model_management.is_nvidia() and not comfy.model_management.is_wsl()):
211211
if (not args.enable_dynamic_vram) and (comfy.model_management.torch_version_numeric < (2, 8)):
212212
logging.warning("Unsupported Pytorch detected. DynamicVRAM support requires Pytorch version 2.8 or later. Falling back to legacy ModelPatcher. VRAM estimates may be unreliable especially on Windows")
213-
elif comfy_aimdo.control.init_device(comfy.model_management.get_torch_device().index):
213+
elif comfy_aimdo.control.init_devices(range(torch.cuda.device_count())):
214214
if args.verbose == 'DEBUG':
215215
comfy_aimdo.control.set_log_debug()
216216
elif args.verbose == 'CRITICAL':

0 commit comments

Comments
 (0)