The following is a super quick mnod of facebookresearch/audiocraft to reliably install PyTorch with Cuda support on Windows, which the original repo does not document, and that slowed me down quite a bit. I wasted time so you don't have to! I am too lazy to create a proper fork and PR, but I'm sure someone else can do that if motivated.
I have included both virtualenv and conda methods.
Install Python, Git, and Cuda, if not already present. From a PowerShell terminal:
winget install Python.Python.3.10
winget install git.git
winget install Nvidia.CUDA
Change to a project folder with 10-20 GB space free. Clone the repo:
git clone https://github.com/facebookresearch/audiocraft
Download one of the requirements files and place it in the audiocraft folder.
Filename | Environment |
---|---|
requirements-win.txt | virtualenv |
requirements.yml | conda |
If unsure, just grab the txt file. The below documents the steps only for virtualenv. Conda users -- I'm sure you can figure it out. I believe in you.
Next, create your virtualenv:
python -m venv venv
Activate the new environment
./venv/scripts/activate.ps1
Install Pytorch using the requirements-win.txt file in this gist. This must be done prior to the main reqwuirements, or you'll have torch without Cuda, and no access to use your GPU from within Python. (Note that Conda avoids this issue and setup can be completed in one step.)
pip install -r requirements-win.txt
Install remaining dependencies
pip install -r requirements.txt
That's it!
P.S. you could smash all of the preceding lines into a script and do it in one shot.
Lastly, start the web UI with the following command:
python app.py