[GH-ISSUE #42] How to enable GPU or CPU? #31

Closed
opened 2026-10-20 09:53:17 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @juangea on GitHub (Aug 26, 2024).
Original GitHub issue: https://github.com/RVC-Project/Retrieval-based-Voice-Conversion/issues/42

Hi there.

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

Originally created by @juangea on GitHub (Aug 26, 2024). Original GitHub issue: https://github.com/RVC-Project/Retrieval-based-Voice-Conversion/issues/42 Hi there. How can I define the device to use? I'm using it as a library with Python.
Author
Owner

@alcoftTAO commented on GitHub (Aug 26, 2024):

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.

<!-- gh-comment-id:2310985176 --> @alcoftTAO commented on GitHub (Aug 26, 2024): ```python 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.
Author
Owner

@juangea commented on GitHub (Aug 27, 2024):

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

<!-- gh-comment-id:2311853326 --> @juangea commented on GitHub (Aug 27, 2024): 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
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
RVC-Project/Retrieval-based-Voice-Conversion#31
No description provided.