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

tag device='cuda' not working #9

Open
arjunsbalaji opened this issue Sep 18, 2023 · 4 comments
Open

tag device='cuda' not working #9

arjunsbalaji opened this issue Sep 18, 2023 · 4 comments

Comments

@arjunsbalaji
Copy link

Hi,

When I specify device=cuda I get an error saying cpu and cuda devices are in use?

I can see that in generate.py .to(device) is being called in inputs and model so not sure why this is happening.

@sarahalamdari
Copy link
Collaborator

Can you specify which script/function you are running? And I can help solve this

@colbyford
Copy link

@arjunsbalaji - When running from Python, you can run the following command to set the default Torch device:

import torch
torch.set_default_device('cuda:0')

This fixed the cpu/cuda error for me...

@yangkky
Copy link
Collaborator

yangkky commented Nov 13, 2023

@arjunsbalaji do you have an update or more details? Otherwise, I would like to close this.

@yangkky
Copy link
Collaborator

yangkky commented Nov 13, 2023

In general, I believe you have to set device='cuda:0', not just cuda.

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

4 participants