LoginSignup
3
1

voicevox_core python binding w/GPU

Last updated at Posted at 2023-08-26

※2023/8/27現在
github のvoicevox_core のインストラクション通りにやっても動かなかったのでメモ。WSL2のUbuntu20で動かしていますが、特にWSL依存な部分は無いと思う。
以下のCPUバージョンのインストール方法をもとに少し変えました。
https://zenn.dev/hosyan/articles/d38d47c310057d

# reference: https://zenn.dev/hosyan/articles/d38d47c310057d

curl -sSfL https://raw.githubusercontent.com/VOICEVOX/voicevox_core/8cf307df4412dc0db0b03c6957b83b032770c31a/scripts/downloads/download.sh > download.sh
bash download.sh --device cuda

python -m venv voicevox
source voicevox/bin/activate
wget https://github.com/VOICEVOX/voicevox_core/releases/download/0.14.4/voicevox_core-0.14.4+cuda-cp38-abi3-linux_x86_64.whl
pip install voicevox_core-0.14.4+cuda-cp38-abi3-linux_x86_64.whl
pip install nvidia-cuda-runtime-cu11
export LD_LIBRARY_PATH=${VIRTUAL_ENV}/lib/python3.10/site-packages/nvidia/cuda_runtime/lib:$LD_LIBRARY_PATH

cd voicevox_core
wget https://raw.githubusercontent.com/VOICEVOX/voicevox_core/406f6c41408836840b9a38489d0f670fb960f412/example/python/run.py

python run.py --mode GPU --text "テストです" --speaker-id 1

nvidia-cuda-runtime-cu11 を入れているのは、CUDA を/usr/local とかに入れたくなかったためです。CUDA11 が入っていれば不要だと思います。LD_LIBRARY_PATHのところ、"python3.10" の部分は自分の環境に合わせて修正してください。
voicevox すごいですね。とてもありがたいです。

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1