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 can I choose my preferred GPU? #338

Open
GuGuGuDove opened this issue Aug 2, 2024 · 1 comment
Open

How can I choose my preferred GPU? #338

GuGuGuDove opened this issue Aug 2, 2024 · 1 comment

Comments

@GuGuGuDove
Copy link

GuGuGuDove commented Aug 2, 2024

The trainer will move diffusion (the model) to the accelerator device -- cuda, which is written and fixed in Accelerator class. And accelerator.device is a read-only property that can not be changed.

How can I perform my training on cuda:1 (or other devices)?

Thanks a lot.

@GuGuGuDove GuGuGuDove changed the title How can I choose preferred GPU? How can I choose my preferred GPU? Aug 2, 2024
@francotheengineer
Copy link

francotheengineer commented Sep 16, 2024

run export CUDA_VISIBLE_DEVICES=1 to select gpu 1 in bash or your chosen shell before running your python script. The GPU ID if 0 indexed, so 1 is the 2nd GPU in your machine.`

In your training script set the cuda cuda:0 since on python side it will only see 1 gpu.

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

No branches or pull requests

2 participants