Skip to content

override device doesnt show all options #107

Open

Description

@yggdrasil75

I have 3 gpus, a 3090, 3080, and p40. the force/set clip device shows only "cpu" and "cuda:0". when I set the comfy device to cuda:0 it shows cuda:1 instead. I do not see cuda:2 ever.

Activity

  1. city96 commented on Dec 22, 2024

    @city96
    Owner

    What does launching without the cuda cli flag or cuda_visible_devices set do?

    Also, what do you get if you just run this in a standalone console:

    import torch
    print(torch.cuda.device_count())
  2. yggdrasil75 commented on Dec 22, 2024

    @yggdrasil75
    Author

    running that in console works right (get 3), and I dont use cuda_visible_devices, but rather the comfyui --cuda-device 0
    without --cuda-device it works.
    looks like it might be a comfyui issue I guess because comfyui sets the environment instead of just setting device. sorry for posting to the wrong place.

  3. city96 commented on Dec 22, 2024

    @city96
    Owner

    I think the problem might be that the --cuda-device flag in comfy just sets cuda_visible_devices internally here.

    You could try edit it to use torch.set_default_device instead I guess. Something like this: (untested)

        if args.cuda_device is not None:
            torch.set_default_device(f"cuda:{args.cuda_device}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions