Skip to content
This repository has been archived by the owner on Jan 24, 2025. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants