RVC-Project / Retrieval-based-Voice-Conversion

in preparation...
MIT License
294 stars 45 forks source link

How to enable GPU or CPU? #42

Closed juangea closed 2 months ago

juangea commented 2 months ago

Hi there.

How can I define the device to use? I'm using it as a library with Python.

alcoftTAO commented 2 months ago
vc = VC()

vc.config.use_cuda()     # For GPU using CUDA
vc.config.use_cpu()      # For CPU

vc.get_vc(model_path)

I've also tested this code on AMD GPUs and it doesn't work, make sure you have an NVIDIA GPU and you have it's drivers and CUDA installed.

juangea commented 2 months ago

Thanks!

I also noticed that it automatically uses the GPU if Torch for CUDA is installed, I was unsure about it being installed or not in this project, that's why I was unsure about the GPU.

But your answer is very useful! :D