candle icon indicating copy to clipboard operation
candle copied to clipboard

How to select which GPU to use

Open donkey-donkey opened this issue 1 year ago • 3 comments

We are working with the stable diffusion example. How do we select which GPU device on our system to use for the rendering? thanks.

donkey-donkey avatar Jun 16 '24 19:06 donkey-donkey

When you create the cuda device, you could should be able to choose the device id to use, e.g. Device::new_cuda(0)?.

LaurentMazare avatar Jun 16 '24 19:06 LaurentMazare

Lookup CUDA_VISIBLE_DEVICES environment variable on how to restrict devices visible to your cuda code. Should not require any code changes.

vamsi-juvvi avatar Jun 21 '24 15:06 vamsi-juvvi

thanks. environment var works.

AlpineVibrations avatar Jun 21 '24 19:06 AlpineVibrations