Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Launch Comfy UI Desktop with Specific GPU (e.g., GPU 1)? #895

Open
Lionnn107 opened this issue Feb 13, 2025 · 2 comments
Open

How to Launch Comfy UI Desktop with Specific GPU (e.g., GPU 1)? #895

Lionnn107 opened this issue Feb 13, 2025 · 2 comments
Labels
question Further information is requested

Comments

@Lionnn107
Copy link

Lionnn107 commented Feb 13, 2025

Could you please tell me how to launch Comfy UI Desktop with GPU 1? In the portable version, I did it like this: "set CUDA_VISIBLE_DEVICES=1", but I've been trying to figure it out on the desktop version for two days now, and none of the solutions I found online worked for me.

┆Issue is synchronized with this Notion page by Unito

Copy link

dosubot bot commented Feb 13, 2025

Hey @Lionnn107! 👋 I'm here to help you with any bugs, questions, or contributions you have. If you need assistance, feel free to ask!

The ComfyUI Desktop application does not have explicit documentation or command-line arguments for setting a specific GPU directly. However, you can try setting the CUDA_VISIBLE_DEVICES environment variable before launching the application, similar to what you did with the portable version. This environment variable is a standard way to specify which GPU to use in CUDA applications.

Here's how you can do it:

  1. Open a terminal or command prompt.
  2. Set the environment variable: set CUDA_VISIBLE_DEVICES=1 (on Windows) or export CUDA_VISIBLE_DEVICES=1 (on Linux/Mac).
  3. Launch the ComfyUI Desktop application from the same terminal or command prompt.

This method should help the application recognize and use the specified GPU. If this doesn't work, it might be due to how the desktop application is packaged or executed, which could ignore the environment variable settings.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other | Bug Report

@dosubot dosubot bot added the question Further information is requested label Feb 13, 2025
@Lionnn107
Copy link
Author

Hey @Lionnn107! 👋 I'm here to help you with any bugs, questions, or contributions you have. If you need assistance, feel free to ask!

The ComfyUI Desktop application does not have explicit documentation or command-line arguments for setting a specific GPU directly. However, you can try setting the CUDA_VISIBLE_DEVICES environment variable before launching the application, similar to what you did with the portable version. This environment variable is a standard way to specify which GPU to use in CUDA applications.

Here's how you can do it:

  1. Open a terminal or command prompt.
  2. Set the environment variable: set CUDA_VISIBLE_DEVICES=1 (on Windows) or export CUDA_VISIBLE_DEVICES=1 (on Linux/Mac).
  3. Launch the ComfyUI Desktop application from the same terminal or command prompt.

This method should help the application recognize and use the specified GPU. If this doesn't work, it might be due to how the desktop application is packaged or executed, which could ignore the environment variable settings.

Thank you, this helped me a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant