Skip to content

run rvc-python with zluda (amd gpu's on windows with gpu acceleration) #37

@patientx

Description

@patientx

I used my zluda.py from my own fork of comfyui. after installing rvc-python with the default setup,

  • install hip 5.7 , check paths , find libraries and put them

            *use my guide on my comfyui-zluda readme (https://github.com/patientx/ComfyUI-Zluda)
    

Install HIP SDK 5.7.1 from HERE the correct version, "Windows 10 & 11 5.7.1 HIP SDK"

*** (*** this app installs zluda for 5.7.1 by default, if you want to use 6.1 or 6.2 you have to get the latest zluda link from lshyqqtiger's ZLUDA Fork then you can use patchzluda2.bat, run it paste the link via right click (a correct link would be like this, https://github.com/lshqqytiger/ZLUDA/releases/download/rel.d60bddbc870827566b3d2d417e00e1d2d8acc026/ZLUDA-windows-rocm6-amd64.zip press enter and it would patch that zluda into comfy for you. Of course this also would mean you have to change the variables below from "5.7" to "6.x" where needed) ***

Add the system variable HIP_PATH, value: C:\Program Files\AMD\ROCm\5.7\ (This is the default folder, if you have installed it on another drive, change if necessary)

Check the variables on the lower part (System Variables), there should be a variable called: HIP_PATH.
Also check the variables on the lower part (System Variables), there should be a variable called: "Path". Double-click it and click "New" add this: C:\Program Files\AMD\ROCm\5.7\bin
If you have an AMD GPU below 6800 (6700,6600 etc.), download the recommended library files for your gpu from Brknsoul Repository

Go to folder "C:\Program Files\AMD\ROCm\5.7\bin\rocblas", there would be a "library" folder, backup the files inside to somewhere else.
Open your downloaded optimized library archive and put them inside the library folder (overwriting if necessary): "C:\Program Files\AMD\ROCm\5.7\bin\rocblas\library"
Reboot your system.

  • you need to install torch etc for gpu

             * activate venv  :  venv\scripts\activate
             * run these
             pip uninstall torch torchvision torchaudio
             pip install torch==2.3.0 torchvision==0.18.0 torchaudio==2.3.0 --index-url https://download.pytorch.org/whl/cu118
    
  • download the files I attached, one is for patching zluda , the other is zluda.py , the actual fix., put them into main folder of rvc-python.

zludafilesforrvcpython.zip

  • run the app like this :
    * activate venv : venv\scripts\activate
    * run app.py with python but with zluda in front like this : zluda\zluda.exe -- python -m rvc_python api -p 5050 -l -de cuda:0

here is a batch file you can use , paste them into a .bat file, change the folder for rvc-python of course.

cd /d D:\sd\rvc-python
call venv\Scripts\activate
zluda\zluda.exe -- python -m rvc_python api -p 5050 -l -de cuda:0"

run the batch. on my pc it works with rx 6600. but it should work with almost any amd gpu from apu's to to the latest.

before anyone asks if you are getting a caffe2.. error , then you didn't set the path's right.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions