evodiff icon indicating copy to clipboard operation
evodiff copied to clipboard

tag device='cuda' not working

Open arjunsbalaji opened this issue 2 years ago • 4 comments

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.

arjunsbalaji avatar Sep 18 '23 15:09 arjunsbalaji

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

sarahalamdari avatar Oct 12 '23 12:10 sarahalamdari

@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...

colbyford avatar Nov 01 '23 21:11 colbyford

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

yangkky avatar Nov 13 '23 15:11 yangkky

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

yangkky avatar Nov 13 '23 15:11 yangkky