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 assign TORCH_DEVICE? #12

Closed
JinguangHe opened this issue Oct 21, 2024 · 3 comments
Closed

How to assign TORCH_DEVICE? #12

JinguangHe opened this issue Oct 21, 2024 · 3 comments

Comments

@JinguangHe
Copy link

Is there no parameter to assign TORCH_DEVICE 0 or 1 ?

@VikParuchuri
Copy link
Owner

You mean set your cuda device? You can set that with CUDA_VISIBLE_DEVICES . For torch device, like "cuda", "mps", "cpu", you can set via TORCH_DEVICE

@JinguangHe
Copy link
Author

You mean set your cuda device? You can set that with CUDA_VISIBLE_DEVICES . For torch device, like "cuda", "mps", "cpu", you can set via TORCH_DEVICE

I have tried to modify settings.py
settings = Settings(CUDA_VISIBLE_DEVICES=1)
and created local.env to set "CUDA_VISIBLE_DEVICES=1"
But it didn't work, it always used gpu 0, not 1

@VikParuchuri
Copy link
Owner

You just export CUDA_VISIBLE_DEVICES=1 on the command line - this is an nvidia env variable, has nothing to do with this repo

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