Skip to content

Commit

Permalink
Merge branch 'main' of github.com:karaokenerds/python-audio-separator
Browse files Browse the repository at this point in the history
  • Loading branch information
beveradb committed Feb 20, 2024
2 parents da5788b + 4b438c9 commit 00f790d
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,25 @@ In theory, all you should need to do to get `audio-separator` working with a GPU

However, sometimes getting both PyTorch and ONNX Runtime working with CUDA support can be a bit tricky so it may not work that easily.

You may need to reinstall both packages directly, allowing pip to calculate the right versions for your platform:
You may need to reinstall both packages directly, allowing pip to calculate the right versions for your platform, for example:

- `pip uninstall torch onnxruntime`
- `pip cache purge`
- `pip install --force-reinstall torch torchvision torchaudio`
- `pip install --force-reinstall onnxruntime-gpu`

Depending on your hardware, you may get better performance with the optimum version of onnxruntime:
- `pip install --force-reinstall "optimum[onnxruntime-gpu]"`
I generally recommend installing the latest version of PyTorch for your environment using the command recommended by the wizard here:
https://pytorch.org/get-started/locally/

Depending on your CUDA version and hardware, you may need to install torch from the `cu118` index instead:
- `pip install --force-reinstall torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118`
### Multiple CUDA library versions may be needed
Depending on your CUDA version and environment, you may need to install specific version(s) of CUDA libraries for ONNX Runtime to use your GPU.

🧪 Google Colab, for example, now uses CUDA 12 by default, but ONNX Runtime still needs CUDA 11 libraries to work.

If you see the error `Failed to load library` or `cannot open shared object file` when you run `audio-separator`, this is likely the issue.

You can install the CUDA 11 libraries _alongside_ CUDA 12 like so:
- `apt update; apt install nvidia-cuda-toolkit`

> Note: if anyone knows how to make this cleaner so we can support both different platform-specific dependencies for hardware acceleration without a separate installation process for each, please let me know or raise a PR!
Expand Down

0 comments on commit 00f790d

Please sign in to comment.