From 0f0cd86dd4f3bb537f96f3a2999da4bb130633af Mon Sep 17 00:00:00 2001 From: Juraj Borza Date: Sun, 24 May 2026 13:32:49 +0200 Subject: [PATCH] Add onnxruntime-gpu installation for Supertonic GPU acceleration - #163 --- README.md | 5 +++++ WINDOWS_INSTALL.bat | 14 ++++++++++++++ pyproject.toml | 8 ++++---- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ddb3f79..02db881 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,8 @@ This method handles everything automatically - installing all dependencies inclu #### OPTION 2: Install using uv First, [install uv](https://docs.astral.sh/uv/getting-started/installation/) if you haven't already. +The CUDA extras install both GPU-accelerated Kokoro (via PyTorch) and Supertonic (via onnxruntime-gpu). + ```bash # For NVIDIA GPUs (CUDA 12.8) - Recommended uv tool install --python 3.12 abogen[cuda] --extra-index-url https://download.pytorch.org/whl/cu128 --index-strategy unsafe-best-match @@ -65,6 +67,9 @@ venv\Scripts\activate # We need to use an older version of PyTorch (2.8.0) until this issue is fixed: https://github.com/pytorch/pytorch/issues/166628 pip install torch==2.8.0+cu128 torchvision==0.23.0+cu128 torchaudio==2.8.0 --index-url https://download.pytorch.org/whl/cu128 +# Also install onnxruntime-gpu for Supertonic GPU acceleration: +pip install onnxruntime-gpu + # For AMD GPUs: # Not supported yet, because ROCm is not available on Windows. Use Linux if you have AMD GPU. diff --git a/WINDOWS_INSTALL.bat b/WINDOWS_INSTALL.bat index d414e87..407b52c 100644 --- a/WINDOWS_INSTALL.bat +++ b/WINDOWS_INSTALL.bat @@ -323,6 +323,13 @@ if /I "%IS_NVIDIA%"=="true" ( pause exit /b ) + echo Installing onnxruntime-gpu for Supertonic GPU acceleration... + %PYTHON_CONSOLE_PATH% -m uv pip install --system onnxruntime-gpu + if errorlevel 1 ( + echo Failed to install onnxruntime-gpu. + pause + exit /b + ) ) else ( echo CUDA is available on NVIDIA GPU. ) @@ -348,6 +355,13 @@ if /I "%IS_NVIDIA%"=="true" ( pause exit /b ) + echo Installing onnxruntime-gpu for Supertonic GPU acceleration... + %PYTHON_CONSOLE_PATH% -m uv pip install --system onnxruntime-gpu + if errorlevel 1 ( + echo Failed to install onnxruntime-gpu. + pause + exit /b + ) ) ) diff --git a/pyproject.toml b/pyproject.toml index 3722fb5..96db015 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,7 +30,7 @@ dependencies = [ "pip", "kokoro>=0.9.4", "misaki[zh]>=0.9.4", - "supertonic>=0.1.0", + "supertonic>=1.3.1", "ebooklib>=0.19", "beautifulsoup4>=4.13.4", "spacy>=3.8.7,<4.0", @@ -111,11 +111,11 @@ filterwarnings = [ [project.optional-dependencies] # NVIDIA GPU (Windows) (CUDA 12.6) # uv tool install abogen[cuda126] -cuda126 = ["torch"] +cuda126 = ["torch", "onnxruntime-gpu>=1.26.0"] # NVIDIA GPU (Windows) (CUDA 12.8) # uv tool install abogen[cuda] -cuda = ["torch"] +cuda = ["torch", "onnxruntime-gpu>=1.26.0"] # NVIDIA GPU (Windows) (CUDA 13.0) # uv tool install abogen[cuda130] -cuda130 = ["torch"] +cuda130 = ["torch", "onnxruntime-gpu>=1.26.0"] # AMD GPU (Linux) (ROCm 6.4) # uv tool install abogen[rocm] rocm = ["torch", "pytorch-triton-rocm"] # Development dependencies # uv tool install abogen[dev]