w-okada / voice-changer

リアルタイムボイスチェンジャー Realtime Voice Changer
Other
15.23k stars 1.63k forks source link

[ISSUE]: GPU not utilized for uploaded models #1245

Open FuqNah opened 1 week ago

FuqNah commented 1 week ago

Voice Changer Version

MMVCServerSIO_win_onnxdirectML-cuda_v.1.5.3.18a

Operational System

Windows 10

GPU

RX 5700XT

Read carefully and check the options

Model Type

RVC

Issue Description

All included RVC and Beatrice models run very well. They're clear with no skipping and only a ~500ms delay.

However, every model that I have downloaded and uploaded all run very poorly. There's a long delay, and the voice is inconsistent and choppy. When checking task manager while using a default included model, I can see that the GPU usage is between 10-20%, sometimes a little more. But when I try using an uploaded model, the GPU usage never goes above 2 or 3%, all work is being done by my CPU.

I noticed that the included models only list the model, they seemingly don't have an index, so I tried uploading a model without an index and the issue was the same.

Application Screenshot

Screenshot 2024-06-16 211601

Logs on console

C:\Users\user\Downloads\MMVCServerSIO>MMVCServerSIO.exe -p 18888 --https false --content_vec_500 pretrain/checkpoint_best_legacy_500.pt --content_vec_500_onnx pretrain/content_vec_500.onnx --content_vec_500_onnx_on true --hubert_base pretrain/hubert_base.pt --hubert_base_jp pretrain/rinna_hubert_base_jp.pt --hubert_soft pretrain/hubert/hubert-soft-0d54a1f4.pt --nsf_hifigan pretrain/nsf_hifigan/model --crepe_onnx_full pretrain/crepe_onnx_full.onnx --crepe_onnx_tiny pretrain/crepe_onnx_tiny.onnx --rmvpe pretrain/rmvpe.pt --model_dir model_dir --samples samples.json Booting PHASE :main PYTHON:3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)] Activating the Voice Changer. [Voice Changer] download sample catalog. samples_0004_t.json [Voice Changer] download sample catalog. samples_0004_o.json [Voice Changer] download sample catalog. samples_0004_d.json [Voice Changer] model_dir is already exists. skip download samples. Internal_Port:18888 protocol: HTTP


Please open the following URL in your browser.
http://<IP>:<PORT>/
In many cases, it will launch when you access any of the following URLs.
http://127.0.0.1:18888/

[VCClient] Access http://127.0.0.1:18888/ [VCClient] wait web server...0 http://127.0.0.1:18888/ Booting PHASE :main Booting PHASE :MMVCServerSIO [Voice Changer] VoiceChangerManager initializing... [Voice Changer] model slot is changed -1 -> 6 ................RVC [Voice Changer] [RVCr2] Creating instance VoiceChangerV2 Initialized (GPU_NUM(cuda):0, mps_enabled:False, onnx_device:CPU-DML) [Voice Changer][RVC]: update_settings gpu:0 [Voice Changer][RVCr2] Initializing... gin_channels: 256 self.spk_embed_dim: 109 [Voice Changer] generate new embedder. (no embedder) [Voice Changer] Loading index... Try loading... model_dir\6\added_IVF389_Flat_nprobe_1.index GENERATE INFERENCER<voice_changer.RVC.inferencer.RVCInferencer.RVCInferencer object at 0x000001A6F2E03F70> GENERATE EMBEDDER<voice_changer.RVC.embedder.OnnxContentvec.OnnxContentvec object at 0x000001A72B7F0610> GENERATE PITCH EXTRACTOR<voice_changer.RVC.pitchExtractor.RMVPEOnnxPitchExtractor.RMVPEOnnxPitchExtractor object at 0x000001A72B7F0640> [Voice Changer] [RVC] Initializing... done [Voice Changer][RVC]: update_settings f0Detector:rmvpe_onnx [Voice Changer][RVC]: update_settings serverReadChunkSize:192 [Voice Changer][RVC]: update_settings enableServerAudio:0 [Voice Changer][RVC]: update_settings extraConvertSize:8192 [Voice Changer][RVC]: update_settings modelSlotIndex:1718583141006 [Voice Changer] VoiceChangerManager initializing... done. [Voice Changer] MMVC_Rest initializing... [Voice Changer] MMVC_Rest initializing... done. [Voice Changer] MMVC_SocketIOApp initializing... [Voice Changer] MMVC_SocketIOApp initializing... done. [VCClient] wait web server... done 200 [2024-06-16 21:14:13] connet sid : PJL8cGZVTqtQ0WGxAAAC [2024-06-16 21:14:13] connet sid : ft3bCp0FgtLXTgGJAAAD [Voice Changer] update configuration: modelSlotIndex 1718586880000Beatrice-JVS [Voice Changer] model slot is changed 6 -> Beatrice-JVS ................Beatrice [Voice Changer] [Beatrice] Creating instance VoiceChangerV2 Initialized (GPU_NUM(cuda):0, mps_enabled:False, onnx_device:CPU-DML) Pipeline has been deleted [Voice Changer] [Beatrice] Initializing... [Voice Changer] [Beatrice] Initializing... done [Voice Changer][Beatrice]: update_settings gpu:0 [Voice Changer][Beatrice]: update_settings f0Detector:rmvpe_onnx [Voice Changer][Beatrice]: update_settings serverReadChunkSize:192 [Voice Changer][Beatrice]: update_settings enableServerAudio:0 [Voice Changer][Beatrice]: update_settings extraConvertSize:8192 [Voice Changer][Beatrice]: update_settings modelSlotIndex:1718586880000Beatrice-JVS

KuukoShan commented 1 week ago

The included models are onnx ones. Maybe the model that you are using, that you downloaded, is probably in pth format. There is a button in the software to convert pth voice models into onnx one. Load a pth model and convert it into onnx. Add the onnx file to RVC and use that one instead. Check if the software is now using the GPU properly.