When would I use model.to("cuda:1") as opposed to model.to("cuda:0")?

I have a user with two GPU's; the first one is AMD which can't run CUDA, and the second one is a cuda-capable NVIDIA GPU. I am using the code model.half().to(cuda:0). I'm not sure if the invocation successfully used the GPU, nor am I able to test it because I don't have any spare computer with more than 1 GPU lying around.

In this case, does cuda:0 mean the first device which can run CUDA, so it would've worked even if their first device was AMD? Or would I need to say cuda:1 instead? How would I detect which number is the first CUDA-capable device?

Topic cuda pytorch

Category Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.