Skip to content

fix(tts): support integrated GPU backends in MagpieTTS and NanoCodec - #60

Open
hsuanguo wants to merge 1 commit into
NVIDIA:mainfrom
hsuanguo:fix/tts-loader-igpu
Open

hsuanguo wants to merge 1 commit into
NVIDIA:mainfrom
hsuanguo:fix/tts-loader-igpu

Conversation

@hsuanguo

@hsuanguo hsuanguo commented Oct 4, 2026

Copy link
Copy Markdown

Got this error:

--lt-backend cuda requires a CUDA ggml backend; current backend is CPU
nemo-speech serve: MagpieTTS synthesis failed

Add an IGPU initialization attempt after discrete-GPU initialization fails, before the existing CPU fallback, in both MagpieTTS and NanoCodec.

@copy-pr-bot

copy-pr-bot Bot commented Oct 4, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/NeMo-Speech.cpp/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 70d0af72-ed24-4bc2-8ab9-f240547c7689
📥 Commits

Reviewing files that changed from the base of the PR and between b809bbb and 864559c.

📒 Files selected for processing (2)
  • src/tts/magpietts/model.cpp
  • src/tts/nanocodec/model.cpp

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Summary

Summary by CodeRabbit

  • Improvements
    • MagpieTTS and NanoCodec now try an integrated GPU when the primary GPU is unavailable, before falling back to CPU.
    • When CPU is forced, GPU initialization is skipped.

Walkthrough

MagpieTTS and NanoCodec now attempt integrated-GPU initialization after GPU initialization fails. The existing CPU fallback remains. The integrated-GPU attempt is skipped when CPU is forced.

Changes

TTS backend fallback

Layer / File(s) Summary
Integrated GPU fallback
src/tts/magpietts/model.cpp, src/tts/nanocodec/model.cpp
When CPU is not forced and GPU initialization fails, both model loaders try the integrated GPU backend before the existing CPU fallback.

Priority: ➖ Normal

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

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 86455

The change adds an integrated-GPU attempt before the existing CPU fallback. No actionable merge-blocking risk is established by the available evidence.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the integrated-GPU backend support added for MagpieTTS and NanoCodec.
Description check ✅ Passed The description explains the reported backend error and the integrated-GPU initialization attempt added before the CPU fallback in both models.
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Signed-off-by: hsuanguo <hsuan.guo@gmail.com>
@hsuanguo
hsuanguo force-pushed the fix/tts-loader-igpu branch from dbaab03 to 864559c Compare October 4, 2026 23:44
@greptile-apps

greptile-apps Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Medium risk] Adds integrated GPU fallback to text-to-speech model loading.

The PR should not merge until an IGPU allocation failure can fall back to CPU without aborting synthesizer creation.

Findings

  1. P1 IGPU allocation prevents CPU fallback ▶

Summary

The PR adds integrated-GPU initialization between discrete-GPU initialization and CPU fallback for MagpieTTS and NanoCodec.

  • Model allocation failure after IGPU initialization does not fall back to CPU.

Reviews (1) · Last reviewed commit: "fixed tts loaders on igpu"

Comment on lines +876 to +877
if (!model.backend) {
model.backend = ggml_backend_init_by_type(GGML_BACKEND_DEVICE_TYPE_IGPU, nullptr);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 IGPU allocation prevents CPU fallback

If an integrated GPU initializes but lacks enough memory for the model tensors, loading returns an error instead of trying the CPU backend. NanoCodec has the same path. Either failure stops synthesizer creation, even though the CPU fallback could have loaded the model. Retry loading on CPU when IGPU allocation fails, or check capacity before selecting the IGPU.

@anand-nv

anand-nv commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

Can I know what is the hw platform you are trying to deploy this on?

@hsuanguo

hsuanguo commented Oct 5, 2026

Copy link
Copy Markdown
Author

Can I know what is the hw platform you are trying to deploy this on?

Hi, it's Jetson Orin on Jetpack 7.2

This branch has not been deployed

No deployments
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