bark icon indicating copy to clipboard operation
bark copied to clipboard

Select cuda device via API.

Open Ph0rk0z opened this issue 1 year ago • 4 comments

There are extensions using this for text generation, as you know. It would be very nice to be able to select which GPU to use via the API. Right now you are only able to choose GPU or CPU and there is no way to do CUDA_VISIBLE_DEVICES since it does not run stand-alone.

I have 2 GPU and would like to use one for TTS and one for the LLM without having to patch the code manually.

Ph0rk0z avatar May 13 '23 17:05 Ph0rk0z

3f3f3f3

matheus786 avatar May 14 '23 02:05 matheus786

It worked for me:

import torch
torch.cuda.set_device(device_id)

doevent avatar May 15 '23 11:05 doevent

thanks yeah putting it on enhancements list for next version

gkucsko avatar May 18 '23 13:05 gkucsko