Skip to content

feat(linux): add CUDA backend build recipe - #1044

Open
Fulminao wants to merge 1 commit into
jamiepine:mainfrom
Fulminao:feat/linux-cuda-build
Open

feat(linux): add CUDA backend build recipe#1044
Fulminao wants to merge 1 commit into
jamiepine:mainfrom
Fulminao:feat/linux-cuda-build

Conversation

@Fulminao

@Fulminao Fulminao commented Aug 13, 2026

Copy link
Copy Markdown

Adds a Linux implementation of the existing build-server-cuda recipe.

The Python builder already supports --cuda cross-platform, but the justfile only exposed the CUDA build/install flow on Windows. This adds the equivalent Linux path and installs the generated backend into the app data directory under XDG_DATA_HOME (falling back to ~/.local/share).

Tested successfully on:

  • LMDE 6 / Debian 12, Python 3.11, NVIDIA GTX 1660 SUPER
    • CUDA backend built successfully
    • Voicebox detected and launched the locally built backend
    • Qwen3-TTS 0.6B ran successfully with CUDA
  • Linux Mint 22.3 / Ubuntu 24.04 base, Python 3.12, NVIDIA MX110
    • CUDA backend build completed successfully
    • PyTorch CUDA environment was detected correctly
    • Runtime inference was not tested on the MX110 because current PyTorch cu128 does not support its sm_50 compute capability

This keeps the Linux behavior aligned with the existing Windows build-server-cuda recipe.

Summary by CodeRabbit

  • New Features
    • Added a Linux build command for creating the CUDA-enabled server.
    • Automatically prepares the required backend data and executable permissions.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The Linux justfile now includes a build-server-cuda target. The target builds the CUDA server, replaces the CUDA backend directory, copies the generated files, and sets the server executable permission.

Changes

CUDA server build

Layer / File(s) Summary
Build and stage CUDA server
justfile
The build-server-cuda target builds the CUDA binary, recreates the application CUDA backend directory, copies the build output, and marks the server executable.

Estimated code review effort: 2 (Simple) | ~5 minutes

Mergeability Score: 🔵 Low · up to f7cdc

The new Linux CUDA installation flow can remove the working backend before the replacement is fully installed, so an interrupted or failed update may leave CUDA unavailable until rebuilt. Stage the replacement before swapping it in; also confirm the Python executable is safely quoted.

Possibly related PRs

  • jamiepine/voicebox#770: Addresses a platform-specific CUDA binary download issue related to the new Linux CUDA build target.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the Linux CUDA backend build recipe added by the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ 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.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@justfile`:
- Around line 250-253: Update the CUDA backend installation flow around the rm,
mkdir, cp, and chmod commands to stage the complete onedir tree in a temporary
sibling directory first. Apply permissions to the staged voicebox-server-cuda,
then atomically replace the existing backends/cuda directory only after staging
succeeds, preserving the current backend until replacement is ready.
🪄 Autofix

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 Plus

Run ID: 94d2df58-a910-447e-89a7-3fdad53a5207

📥 Commits

Reviewing files that changed from the base of the PR and between 51f49de and f7cdca0.

📒 Files selected for processing (1)
  • justfile

Comment thread justfile
Comment on lines +250 to +253
rm -rf "${XDG_DATA_HOME:-$HOME/.local/share}/sh.voicebox.app/backends/cuda"
mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}/sh.voicebox.app/backends/cuda"
cp -a backend/dist/voicebox-server-cuda/. "${XDG_DATA_HOME:-$HOME/.local/share}/sh.voicebox.app/backends/cuda/"
chmod +x "${XDG_DATA_HOME:-$HOME/.local/share}/sh.voicebox.app/backends/cuda/voicebox-server-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.

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Stage the replacement before deleting the current backend.

Line 250 deletes the installed CUDA backend before the copy and permission update complete. If staging fails or is interrupted, the target leaves no usable CUDA backend. Copy into a temporary sibling directory, set the executable bit there, and replace backends/cuda only after the complete onedir tree is ready.

Proposed staging change
-    rm -rf "${XDG_DATA_HOME:-$HOME/.local/share}/sh.voicebox.app/backends/cuda"
-    mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}/sh.voicebox.app/backends/cuda"
-    cp -a backend/dist/voicebox-server-cuda/. "${XDG_DATA_HOME:-$HOME/.local/share}/sh.voicebox.app/backends/cuda/"
-    chmod +x "${XDG_DATA_HOME:-$HOME/.local/share}/sh.voicebox.app/backends/cuda/voicebox-server-cuda"
+    set -eu; \
+    dest="${XDG_DATA_HOME:-$HOME/.local/share}/sh.voicebox.app/backends"; \
+    mkdir -p "$dest"; \
+    tmp="$(mktemp -d "$dest/.cuda.XXXXXX")"; \
+    trap 'rm -rf "$tmp"' 0; \
+    cp -a backend/dist/voicebox-server-cuda/. "$tmp/"; \
+    chmod +x "$tmp/voicebox-server-cuda"; \
+    rm -rf "$dest/cuda"; \
+    mv "$tmp" "$dest/cuda"
📝 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
rm -rf "${XDG_DATA_HOME:-$HOME/.local/share}/sh.voicebox.app/backends/cuda"
mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}/sh.voicebox.app/backends/cuda"
cp -a backend/dist/voicebox-server-cuda/. "${XDG_DATA_HOME:-$HOME/.local/share}/sh.voicebox.app/backends/cuda/"
chmod +x "${XDG_DATA_HOME:-$HOME/.local/share}/sh.voicebox.app/backends/cuda/voicebox-server-cuda"
set -eu; \
dest="${XDG_DATA_HOME:-$HOME/.local/share}/sh.voicebox.app/backends"; \
mkdir -p "$dest"; \
tmp="$(mktemp -d "$dest/.cuda.XXXXXX")"; \
trap 'rm -rf "$tmp"' 0; \
cp -a backend/dist/voicebox-server-cuda/. "$tmp/"; \
chmod +x "$tmp/voicebox-server-cuda"; \
rm -rf "$dest/cuda"; \
mv "$tmp" "$dest/cuda"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@justfile` around lines 250 - 253, Update the CUDA backend installation flow
around the rm, mkdir, cp, and chmod commands to stage the complete onedir tree
in a temporary sibling directory first. Apply permissions to the staged
voicebox-server-cuda, then atomically replace the existing backends/cuda
directory only after staging succeeds, preserving the current backend until
replacement is ready.

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.

1 participant