Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,54 @@ sudo apt-get install sox libsox-dev
sudo yum install sox sox-devel
```

Run with AMD GPU

Above env setup is for CUDA. CosyVoice could run on AMD GPU with AMD ROCm. The only difference with the setup of CUDA GPU is to use PyTorch-ROCm to replace the PyTorch-CUDA.
ROCm is be part of PyTorch which could be installed as https://pytorch.org/. The steps are,
1. Install ROCm driver and Runtime.
Rerfer to https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/quick-start.html
2. Create conda env (
- create the env
```shell
conda create -n cosyvoice -y python=3.10
conda activate cosyvoice
```
- Install PyTorch-ROCm to replace the PyTorch-CUDA

```shell
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.3
```

- Install the requirements
You need do some modification about the [requirements.txt](https://github.com/FunAudioLLM/CosyVoice/blob/main/requirements.txt) before installing the depency library.
1. To comments the first two lines of [requirements.txt](https://github.com/FunAudioLLM/CosyVoice/blob/main/requirements.txt)

```shell
# requirements.txt
#--extra-index-url https://download.pytorch.org/whl/cu121
#--extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ # https://github.com/microsoft/onnxruntime/issues/21684
```
2. Force to use onnxruntime

```shell
#onnxruntime-gpu==1.18.0; sys_platform == 'linux'
onnxruntime==1.18.0; sys_platform == 'linux'
```

And then run

```shell
conda install -y -c conda-forge pynini==2.1.5
pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/ --trusted-host=mirrors.aliyun.com

# If you encounter sox compatibility issues
# ubuntu
sudo apt-get install sox libsox-dev
# centos
sudo yum install sox sox-devel
```
You could refer to the tutorial [Play CosyVoice on AMD ROCm GPU](https://medium.com/@alexhe.amd/play-cosyvoice-on-amd-rocm-gpu-459c942f7214) to get the details. This tutorial also provide a ROCm env file to help setuping.

**Model download**

We strongly recommend that you download our pretrained `CosyVoice2-0.5B` `CosyVoice-300M` `CosyVoice-300M-SFT` `CosyVoice-300M-Instruct` model and `CosyVoice-ttsfrd` resource.
Expand Down