Skip to content

fix(cuda): add Linux x86_64 CUDA backend build and platform-aware download#561

Open
smendola wants to merge 2 commits intojamiepine:mainfrom
smendola:linux-cuda-download-fix
Open

fix(cuda): add Linux x86_64 CUDA backend build and platform-aware download#561
smendola wants to merge 2 commits intojamiepine:mainfrom
smendola:linux-cuda-download-fix

Conversation

@smendola
Copy link
Copy Markdown

@smendola smendola commented Apr 25, 2026

Problem

The "Download CUDA Backend" feature downloads voicebox-server-cuda.tar.gz on all platforms, but only a Windows binary is published in releases. Linux users silently download and extract a Windows .exe, which is unusable, leaving them on the CPU backend with no explanation.

Fix

Platform-aware archive names (backend/services/cuda.py)

Archive names now include the platform:

  • Linux: voicebox-server-cuda-linux-x86_64.tar.gz / cuda-libs-cu128-v1-linux-x86_64.tar.gz
  • Windows: voicebox-server-cuda-windows-x86_64.tar.gz / cuda-libs-cu128-v1-windows-x86_64.tar.gz

Packaging script (scripts/package_cuda.py)

Added a required --platform argument that stamps the platform identifier into all output archive and checksum filenames.

Linux CI build job (.github/workflows/release.yml)

Added build-cuda-linux on ubuntu-latest that:

  1. Installs torch==2.7.0+cu128 from the PyTorch cu128 index
  2. Builds the CUDA server binary with PyInstaller (build_binary.py --cuda)
  3. Packages with --platform linux-x86_64
  4. Uploads Linux archives to the release draft

No GPU is required in CI — PyInstaller bundles the CUDA .so libraries from the pip-installed nvidia-* packages at build time, the same way the Windows job bundles .dlls on a runner with no GPU.

The existing Windows job is updated to pass --platform windows-x86_64 to match the new naming scheme.

Notes

  • cuda-libs archives are platform-specific (Windows .dll vs Linux .so)
  • The cuda-libs.json manifest now includes a platform field
  • macOS is unaffected (no CUDA backend on macOS)

Summary by CodeRabbit

  • New Features

    • Added automated Linux CUDA package builds to the release pipeline
    • Platform-specific CUDA release packages now available for Windows and Linux
    • Release artifacts uploaded per-platform and Linux onedir uploaded as a workflow artifact
  • Improvements

    • Backend now selects platform-appropriate CUDA artifacts for downloads
    • Package checksums and manifest entries updated to match platform-specific naming
  • Chores

    • Ignore generated Linux schema JSON from source control

…nload

The CUDA backend download previously used a single archive name
(voicebox-server-cuda.tar.gz) for all platforms. Only a Windows binary
was published in releases, so Linux users silently downloaded and
extracted a Windows .exe, which was unusable.

Changes:
- backend/services/cuda.py: derive archive names from sys.platform so
  Linux downloads voicebox-server-cuda-linux-x86_64.tar.gz and Windows
  downloads voicebox-server-cuda-windows-x86_64.tar.gz (same for
  cuda-libs archives)
- scripts/package_cuda.py: add required --platform argument that stamps
  the platform identifier into all output archive and checksum filenames
- .github/workflows/release.yml: pass --platform windows-x86_64 to the
  existing Windows job; add build-cuda-linux job on ubuntu-latest that
  installs torch cu128, builds with PyInstaller, packages with
  --platform linux-x86_64, and uploads the Linux archives to the release

No GPU is required in CI — PyInstaller bundles the CUDA .so libraries
from the pip-installed nvidia-* packages at build time.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ac44c919-121a-4d0e-8e33-f3b4fa929cea

📥 Commits

Reviewing files that changed from the base of the PR and between 57e7836 and aa8bb8b.

📒 Files selected for processing (1)
  • .gitignore
✅ Files skipped from review due to trivial changes (1)
  • .gitignore

📝 Walkthrough

Walkthrough

Adds platform-specific CUDA packaging and artifact naming; introduces a Linux CUDA build job in the release workflow; and makes the runtime CUDA download select platform-suffixed release artifacts.

Changes

Cohort / File(s) Summary
Release Workflow
.github/workflows/release.yml
Adds build-cuda-linux job (Ubuntu, Python 3.12, PyTorch+cu128, Qwen3-TTS), passes --platform for packaging, and uploads platform-specific archives and artifacts; Windows packaging now uses --platform windows-x86_64.
CUDA Packaging Script
scripts/package_cuda.py
Requires --platform argument; package() signature now accepts platform: str; archive and .sha256 filenames include -{platform}; cuda-libs.json manifest gains a platform field.
CUDA Backend Download
backend/services/cuda.py
Derives platform string from sys.platform and selects platform-suffixed server-core and CUDA-libs release asset filenames/URLs for download.
Ignore List
.gitignore
Adds tauri/src-tauri/gen/schemas/linux-schema.json to ignored files.

Sequence Diagram(s)

sequenceDiagram
    participant CI as GitHub Actions (build-cuda-linux / release)
    participant Pkg as scripts/package_cuda.py
    participant GH as GitHub Releases (assets)
    participant Runtime as App backend (`backend/services/cuda.py`)
    CI->>Pkg: run packaging with `--platform linux-x86_64`
    Pkg->>GH: upload `server-core-{platform}.tar.gz`, `cuda-libs-{platform}.tar.gz` and `.sha256`
    CI->>GH: attach workflow artifact (onedir)
    Runtime->>GH: query latest release assets
    Runtime->>Runtime: derive platform from `sys.platform`
    Runtime->>GH: download platform-suffixed assets
    Note right of GH: Assets named with `-{platform}` suffix
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I hopped through builds and artifact trails,

renaming tarballs and threading new rails.
Linux and Windows, each gets its name,
now downloads find the right CUDA game.
A carrot-sized release — hop, hop, acclaim! 🥕✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the two primary changes: adding Linux x86_64 CUDA backend build support and implementing platform-aware downloads.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/package_cuda.py (1)

218-223: ⚠️ Potential issue | 🟡 Minor

--torch-compat help text disagrees with the actual default.

default=">=2.7.0,<2.11.0" but help="...(default: >=2.6.0,<2.11.0)". Update the help string (or the default) so --help doesn’t mislead.

🩹 Suggested fix
     parser.add_argument(
         "--torch-compat",
         type=str,
         default=">=2.7.0,<2.11.0",
-        help="Torch version compatibility range (default: >=2.6.0,<2.11.0)",
+        help="Torch version compatibility range (default: >=2.7.0,<2.11.0)",
     )
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/package_cuda.py` around lines 218 - 223, The help text for the
"--torch-compat" argument is inconsistent with its default: parser.add_argument
sets default=">=2.7.0,<2.11.0" but help says default is ">=2.6.0,<2.11.0";
update one to match the other — either set default to ">=2.6.0,<2.11.0" or
change the help string to say "(default: >=2.7.0,<2.11.0)" — edit the
parser.add_argument call for "--torch-compat" to make the default and help
message consistent.
🧹 Nitpick comments (5)
backend/services/cuda.py (2)

343-346: Local cuda-libs.json manifest no longer matches what the packaging script writes.

scripts/package_cuda.py now writes a manifest with version, platform, torch_compat, archive, and sha256, but this local write keeps just {"version": ...}. Not a functional bug today (only version is read back via get_installed_cuda_libs_version), but it makes the on-disk manifest diverge from the release artifact and forecloses easy platform/sha checks later (e.g., detecting that a user’s cached libs were extracted on a different OS after a re-image or shared profile).

♻️ Optional: persist platform alongside version
-                # Write local cuda-libs.json manifest
-                manifest = {"version": CUDA_LIBS_VERSION}
+                # Write local cuda-libs.json manifest
+                manifest = {"version": CUDA_LIBS_VERSION, "platform": _plat}
                 get_cuda_libs_manifest_path().write_text(json.dumps(manifest, indent=2) + "\n")
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@backend/services/cuda.py` around lines 343 - 346, The local manifest write
only emits {"version": ...}; change the write in the block that calls
get_cuda_libs_manifest_path() so it emits the same manifest shape that
scripts/package_cuda.py produces (keys: version, platform, torch_compat,
archive, sha256) — populate platform with the runtime platform (e.g.,
platform.system()/platform.platform()), copy or compute torch_compat from the
same source used elsewhere (or set to None/"" if unknown), and set archive and
sha256 to the appropriate values or empty strings; keep the same json.dumps(...,
indent=2) + "\n" formatting and ensure get_installed_cuda_libs_version still
reads version as before.

4-12: Module docstring is now stale.

The header still names voicebox-server-cuda.tar.gz and cuda-libs-{version}.tar.gz; both archive names now carry a -{platform} suffix. Worth a one-line update so future readers don’t look for the old names on Releases.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@backend/services/cuda.py` around lines 4 - 12, Update the stale module-level
docstring in the cuda module to reflect the new archive naming: change
references to voicebox-server-cuda.tar.gz and cuda-libs-{version}.tar.gz to
include the platform suffix (e.g., voicebox-server-cuda-{platform}.tar.gz and
cuda-libs-{version}-{platform}.tar.gz) so the docstring at the top of
backend.services.cuda (module-level docstring) accurately describes the
downloaded archive names.
.github/workflows/release.yml (2)

392-403: cuda-libs.json is uploaded by Windows only.

scripts/package_cuda.py now writes a platform field into the manifest, so per-platform manifests are inherently per-platform. The Windows job still uploads cuda-libs.json (line 330) but the Linux job does not — meaning the release will only ever expose the Windows manifest, and if you later add cuda-libs.json to the Linux upload list both jobs will race on the same release-asset filename. Either drop it from the Windows job (the downloader writes its own manifest locally and never fetches this file) or upload it under platform-suffixed names from both jobs.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release.yml around lines 392 - 403, The Windows release
job is uploading a platform-specific manifest (cuda-libs.json) which is written
per-platform by scripts/package_cuda.py, causing the release to only expose the
Windows manifest and creating a race if Linux also uploads the same filename;
update the "Upload archives to GitHub Release" step in the Windows job to stop
uploading cuda-libs.json (or alternatively change both Windows and Linux upload
steps to upload platform-suffixed manifest filenames) so each platform either
omits the manifest from the release or uses unique names, and ensure references
to cuda-libs.json in that step are removed or renamed accordingly.

364-368: Optional: align torch pin between Windows and Linux jobs.

Linux pins torch==2.7.0+cu128 torchaudio==2.7.0+cu128, while Windows (lines 293–294) installs unpinned torch/torchaudio from the cu128 index. Both archives end up under the same cuda-libs-cu128-v1-{platform}.tar.gz version key in the downloader, but they may bundle different torch minor versions, which can produce per-platform behavior differences for the same release tag. Consider pinning Windows to match (or reading both pins from a shared variable).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release.yml around lines 364 - 368, The Linux job step
named "Install PyTorch with CUDA 12.8" pins torch==2.7.0+cu128 and
torchaudio==2.7.0+cu128 but the Windows job installs unpinned torch/torchaudio;
update the Windows install step to pin the same versions (torch==2.7.0+cu128 and
torchaudio==2.7.0+cu128) or extract these pins into a shared workflow variable
(e.g., PYTORCH_VERSION) and use that variable in both the "Install PyTorch with
CUDA 12.8" Linux step and the corresponding Windows install step so both
platforms use identical torch/torchaudio versions.
scripts/package_cuda.py (1)

1-13: Update the module docstring to reflect platform-suffixed archive names.

Lines 5–6 still describe the outputs as voicebox-server-cuda.tar.gz and cuda-libs-cu128.tar.gz, but the script now produces voicebox-server-cuda-{platform}.tar.gz and cuda-libs-{version}-{platform}.tar.gz. The Usage block also lacks a --platform example, which is now a required argument.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/package_cuda.py` around lines 1 - 13, The module docstring in
scripts/package_cuda.py still lists old archive names and an outdated Usage
example; update the docstring so the outputs are described as
voicebox-server-cuda-{platform}.tar.gz and cuda-libs-{version}-{platform}.tar.gz
(replace the current voicebox-server-cuda.tar.gz and cuda-libs-cu128.tar.gz
text) and add a Usage example showing the required --platform argument (e.g.,
--platform linux-x86_64) along with the existing --output and
--cuda-libs-version options; ensure the explanatory lines and examples reference
the new {version} and {platform} placeholders consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/release.yml:
- Around line 374-375: The Windows CUDA job "build-cuda-windows" is missing the
same Qwen3-TTS installation step present in the Linux CUDA job ("Install
Qwen3-TTS" which runs pip install --no-deps
git+https://github.com/QwenLM/Qwen3-TTS.git), causing feature parity drift;
either add the same pip install line to the Windows job alongside the existing
requirements.txt/chatterbox-tts/hume-tada installs, or if the omission is
intentional, add an inline comment in the "build-cuda-windows" job explaining
the incompatibility so the asymmetry is documented.
- Around line 342-381: The build-cuda-linux job lacks disk-space preparation and
a timeout; before the "Setup Python" step add the same free-disk-space action
used in the release job (jlumbroso/free-disk-space) to increase available disk
space for large CUDA .so files, and add a job-level timeout-minutes (match the
Ubuntu timeout used elsewhere, e.g., 30) to prevent silent hangs; also verify
parity with other CUDA jobs: confirm whether installing Qwen3-TTS in
build-cuda-linux (and not in build-cuda-windows) is intentional and whether
cuda-libs.json should be uploaded from build-cuda-linux similar to
build-cuda-windows, and if required add the upload step to the job.

In `@backend/services/cuda.py`:
- Around line 289-291: _current code computes _plat with a two-way ternary which
maps every non-win32 platform to "linux-x86_64", causing incorrect downloads on
macOS and ARM; change the platform resolution in backend/services/cuda.py so it
explicitly handles known platforms and raises a clear error for unsupported
ones: inspect sys.platform (and platform.machine() if you want to distinguish
x86_64 vs aarch64) and set _plat only for accepted values (e.g.,
"windows-x86_64" for "win32", "linux-x86_64" for linux x86_64, and optionally
"linux-aarch64" for aarch64), and if the platform is unknown (darwin, other
BSDs, or mismatched arch) raise a descriptive exception before computing
server_archive and libs_archive; update any uses in download_cuda_binary and
check_and_update_cuda_binary to rely on this guard.

---

Outside diff comments:
In `@scripts/package_cuda.py`:
- Around line 218-223: The help text for the "--torch-compat" argument is
inconsistent with its default: parser.add_argument sets
default=">=2.7.0,<2.11.0" but help says default is ">=2.6.0,<2.11.0"; update one
to match the other — either set default to ">=2.6.0,<2.11.0" or change the help
string to say "(default: >=2.7.0,<2.11.0)" — edit the parser.add_argument call
for "--torch-compat" to make the default and help message consistent.

---

Nitpick comments:
In @.github/workflows/release.yml:
- Around line 392-403: The Windows release job is uploading a platform-specific
manifest (cuda-libs.json) which is written per-platform by
scripts/package_cuda.py, causing the release to only expose the Windows manifest
and creating a race if Linux also uploads the same filename; update the "Upload
archives to GitHub Release" step in the Windows job to stop uploading
cuda-libs.json (or alternatively change both Windows and Linux upload steps to
upload platform-suffixed manifest filenames) so each platform either omits the
manifest from the release or uses unique names, and ensure references to
cuda-libs.json in that step are removed or renamed accordingly.
- Around line 364-368: The Linux job step named "Install PyTorch with CUDA 12.8"
pins torch==2.7.0+cu128 and torchaudio==2.7.0+cu128 but the Windows job installs
unpinned torch/torchaudio; update the Windows install step to pin the same
versions (torch==2.7.0+cu128 and torchaudio==2.7.0+cu128) or extract these pins
into a shared workflow variable (e.g., PYTORCH_VERSION) and use that variable in
both the "Install PyTorch with CUDA 12.8" Linux step and the corresponding
Windows install step so both platforms use identical torch/torchaudio versions.

In `@backend/services/cuda.py`:
- Around line 343-346: The local manifest write only emits {"version": ...};
change the write in the block that calls get_cuda_libs_manifest_path() so it
emits the same manifest shape that scripts/package_cuda.py produces (keys:
version, platform, torch_compat, archive, sha256) — populate platform with the
runtime platform (e.g., platform.system()/platform.platform()), copy or compute
torch_compat from the same source used elsewhere (or set to None/"" if unknown),
and set archive and sha256 to the appropriate values or empty strings; keep the
same json.dumps(..., indent=2) + "\n" formatting and ensure
get_installed_cuda_libs_version still reads version as before.
- Around line 4-12: Update the stale module-level docstring in the cuda module
to reflect the new archive naming: change references to
voicebox-server-cuda.tar.gz and cuda-libs-{version}.tar.gz to include the
platform suffix (e.g., voicebox-server-cuda-{platform}.tar.gz and
cuda-libs-{version}-{platform}.tar.gz) so the docstring at the top of
backend.services.cuda (module-level docstring) accurately describes the
downloaded archive names.

In `@scripts/package_cuda.py`:
- Around line 1-13: The module docstring in scripts/package_cuda.py still lists
old archive names and an outdated Usage example; update the docstring so the
outputs are described as voicebox-server-cuda-{platform}.tar.gz and
cuda-libs-{version}-{platform}.tar.gz (replace the current
voicebox-server-cuda.tar.gz and cuda-libs-cu128.tar.gz text) and add a Usage
example showing the required --platform argument (e.g., --platform linux-x86_64)
along with the existing --output and --cuda-libs-version options; ensure the
explanatory lines and examples reference the new {version} and {platform}
placeholders consistently.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 44db7131-8fc7-4627-bfb8-486d2d852e42

📥 Commits

Reviewing files that changed from the base of the PR and between ed2eec5 and 57e7836.

📒 Files selected for processing (3)
  • .github/workflows/release.yml
  • backend/services/cuda.py
  • scripts/package_cuda.py

Comment on lines +342 to +381
build-cuda-linux:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
pip install -r backend/requirements.txt
pip install --no-deps chatterbox-tts
pip install --no-deps hume-tada

- name: Install PyTorch with CUDA 12.8
run: |
pip install torch==2.7.0+cu128 torchaudio==2.7.0+cu128 \
--index-url https://download.pytorch.org/whl/cu128 \
--force-reinstall --no-deps

- name: Verify CUDA libraries are present
run: |
python -c "import torch; print(f'torch: {torch.__version__}'); print(f'CUDA version: {torch.version.cuda}')"

- name: Install Qwen3-TTS
run: pip install --no-deps git+https://github.com/QwenLM/Qwen3-TTS.git

- name: Build CUDA server binary (onedir)
working-directory: backend
env:
TORCH_CUDA_ARCH_LIST: "8.0;8.6;8.9;9.0;12.0+PTX"
run: python build_binary.py --cuda
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

Does PyInstaller require patchelf on Linux for onedir builds with shared libraries (e.g., torch CUDA .so files)?

💡 Result:

No. PyInstaller does not require you to have patchelf installed on Linux for onedir builds that include shared libraries (including large frameworks like torch CUDA .so files). What PyInstaller does do is: 1) Collect shared libraries and their dependencies into the onedir directory (or onefile archive) via its dependency analysis. 2) At runtime, adjust the dynamic library search path using LD_LIBRARY_PATH (its bootloader prepends the app’s top-level directory / sys._MEIPASS) so the collected .so files are found. The sources also show that missing or incorrect handling of .so dependencies is addressed by collecting the right libraries / fixing packaging (e.g., torch-related .so collection), not by requiring patchelf for onedir. Practical note: Some tools or workflows that post-process binaries may use patchelf, but that’s separate from PyInstaller’s core onedir packaging requirement. If you’re getting runtime errors about missing torch CUDA .so files, the fix is typically to ensure those libraries are actually collected into the frozen app (e.g., via hooks/spec adjustments), and to verify runtime search-path behavior, rather than installing patchelf.

Citations:


🏁 Script executed:

# Check if the main 'release' job has free-disk-space step
rg -A 5 "free-disk-space" .github/workflows/release.yml

Repository: jamiepine/voicebox

Length of output: 256


🏁 Script executed:

# Check the build-cuda-windows job for Qwen3-TTS and cuda-libs.json
rg -B 5 -A 20 "build-cuda-windows:" .github/workflows/release.yml | head -80

Repository: jamiepine/voicebox

Length of output: 768


🏁 Script executed:

# Check for timeout-minutes in release job
rg "timeout-minutes" .github/workflows/release.yml

Repository: jamiepine/voicebox

Length of output: 186


🏁 Script executed:

# Search for cuda-libs.json upload references
rg "cuda-libs.json" .github/workflows/release.yml

Repository: jamiepine/voicebox

Length of output: 104


🏁 Script executed:

# Get the full build-cuda-windows job
sed -n '318,340p' .github/workflows/release.yml

Repository: jamiepine/voicebox

Length of output: 971


🏁 Script executed:

# Get the full build-cuda-linux job
sed -n '342,410p' .github/workflows/release.yml

Repository: jamiepine/voicebox

Length of output: 2439


🏁 Script executed:

# Find which job uploads cuda-libs.json with context
rg -B 10 "cuda-libs.json" .github/workflows/release.yml

Repository: jamiepine/voicebox

Length of output: 570


build-cuda-linux is missing disk-space prep and timeout-minutes.

This job will hit two reproducible issues on ubuntu-latest:

  1. Disk space. The main release job explicitly uses jlumbroso/free-disk-space because CUDA torch + PyInstaller --onedir builds easily exceed ubuntu-latest's ~14 GB free space. This new job is larger (cu128 .so files) and needs the same prep.

  2. Timeout protection. The main release job sets timeout-minutes (30 min for Ubuntu). This new job has no timeout, risking silent hangs.

Also note:

  • build-cuda-linux includes Qwen3-TTS, but build-cuda-windows does not. Confirm this is intentional.
  • build-cuda-windows uploads cuda-libs.json to the release; build-cuda-linux does not. This may be intentional (manifest platform tagging) or an omission.
Suggested additions before "Setup Python"
  build-cuda-linux:
    runs-on: ubuntu-latest
    permissions:
      contents: write
+   timeout-minutes: 30

    steps:
      - uses: actions/checkout@v4

+     - name: Free up disk space
+       uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be
+       with:
+         tool-cache: false
+         android: true
+         dotnet: true
+         haskell: true
+         large-packages: false
+         swap-storage: true
+
      - name: Setup Python
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release.yml around lines 342 - 381, The build-cuda-linux
job lacks disk-space preparation and a timeout; before the "Setup Python" step
add the same free-disk-space action used in the release job
(jlumbroso/free-disk-space) to increase available disk space for large CUDA .so
files, and add a job-level timeout-minutes (match the Ubuntu timeout used
elsewhere, e.g., 30) to prevent silent hangs; also verify parity with other CUDA
jobs: confirm whether installing Qwen3-TTS in build-cuda-linux (and not in
build-cuda-windows) is intentional and whether cuda-libs.json should be uploaded
from build-cuda-linux similar to build-cuda-windows, and if required add the
upload step to the job.

Comment on lines +374 to +375
- name: Install Qwen3-TTS
run: pip install --no-deps git+https://github.com/QwenLM/Qwen3-TTS.git
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Qwen3-TTS is installed on Linux but not in build-cuda-windows — feature parity drift.

The Windows CUDA job (lines 283–289) only installs requirements.txt + chatterbox-tts + hume-tada, while this Linux job additionally pulls git+https://github.com/QwenLM/Qwen3-TTS.git. After this PR, the Linux CUDA build will support Qwen3-TTS and the Windows CUDA build will not, leading to silent backend capability differences depending on which platform a user downloads from.

If the omission on Windows is deliberate (e.g., known build incompatibility), please add a comment so the asymmetry is documented; otherwise install Qwen3-TTS in both jobs.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release.yml around lines 374 - 375, The Windows CUDA job
"build-cuda-windows" is missing the same Qwen3-TTS installation step present in
the Linux CUDA job ("Install Qwen3-TTS" which runs pip install --no-deps
git+https://github.com/QwenLM/Qwen3-TTS.git), causing feature parity drift;
either add the same pip install line to the Windows job alongside the existing
requirements.txt/chatterbox-tts/hume-tada installs, or if the omission is
intentional, add an inline comment in the "build-cuda-windows" job explaining
the incompatibility so the asymmetry is documented.

Comment thread backend/services/cuda.py
Comment on lines +289 to +291
_plat = "windows-x86_64" if sys.platform == "win32" else "linux-x86_64"
server_archive = f"voicebox-server-cuda-{_plat}.tar.gz"
libs_archive = f"cuda-libs-{CUDA_LIBS_VERSION}-{_plat}.tar.gz"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Non-Windows platforms silently resolve to linux-x86_64.

The ternary maps any sys.platform != "win32" (including darwin, ARM Linux, FreeBSD, etc.) to linux-x86_64. The PR description notes macOS is unaffected, but download_cuda_binary is reachable from the manual HTTP endpoint and from check_and_update_cuda_binary on startup; on a macOS host with a stale cuda-libs.json it would attempt to fetch …-linux-x86_64.tar.gz and either 404 or extract Linux .so files into the wrong tree. ARM64 Linux would silently get x86_64 binaries.

A small guard makes the intent explicit and produces a sensible error rather than a confusing 404.

🛡️ Suggested defensive guard
-    _plat = "windows-x86_64" if sys.platform == "win32" else "linux-x86_64"
+    import platform as _platform
+    machine = _platform.machine().lower()
+    if sys.platform == "win32" and machine in ("amd64", "x86_64"):
+        _plat = "windows-x86_64"
+    elif sys.platform.startswith("linux") and machine in ("amd64", "x86_64"):
+        _plat = "linux-x86_64"
+    else:
+        raise RuntimeError(
+            f"CUDA backend is not available for {sys.platform}/{machine}"
+        )
     server_archive = f"voicebox-server-cuda-{_plat}.tar.gz"
     libs_archive = f"cuda-libs-{CUDA_LIBS_VERSION}-{_plat}.tar.gz"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
_plat = "windows-x86_64" if sys.platform == "win32" else "linux-x86_64"
server_archive = f"voicebox-server-cuda-{_plat}.tar.gz"
libs_archive = f"cuda-libs-{CUDA_LIBS_VERSION}-{_plat}.tar.gz"
import platform as _platform
machine = _platform.machine().lower()
if sys.platform == "win32" and machine in ("amd64", "x86_64"):
_plat = "windows-x86_64"
elif sys.platform.startswith("linux") and machine in ("amd64", "x86_64"):
_plat = "linux-x86_64"
else:
raise RuntimeError(
f"CUDA backend is not available for {sys.platform}/{machine}"
)
server_archive = f"voicebox-server-cuda-{_plat}.tar.gz"
libs_archive = f"cuda-libs-{CUDA_LIBS_VERSION}-{_plat}.tar.gz"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@backend/services/cuda.py` around lines 289 - 291, _current code computes
_plat with a two-way ternary which maps every non-win32 platform to
"linux-x86_64", causing incorrect downloads on macOS and ARM; change the
platform resolution in backend/services/cuda.py so it explicitly handles known
platforms and raises a clear error for unsupported ones: inspect sys.platform
(and platform.machine() if you want to distinguish x86_64 vs aarch64) and set
_plat only for accepted values (e.g., "windows-x86_64" for "win32",
"linux-x86_64" for linux x86_64, and optionally "linux-aarch64" for aarch64),
and if the platform is unknown (darwin, other BSDs, or mismatched arch) raise a
descriptive exception before computing server_archive and libs_archive; update
any uses in download_cuda_binary and check_and_update_cuda_binary to rely on
this guard.

tauri/src-tauri/gen/schemas/linux-schema.json is auto-generated by
Tauri on Linux during dev/build and is not meant to be committed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants