Repository navigation
fix(tts): integrated GPU support for MagpieTTS/NanoCodec incl. CUDA local-transformer mirror (extends #60) - #65
Conversation
Signed-off-by: hsuanguo <hsuan.guo@gmail.com>
…r mirror ggml reports unified-memory NVIDIA parts (DGX Spark GB10, Jetson) as GGML_BACKEND_DEVICE_TYPE_IGPU. With the loader fix for MagpieTTS and NanoCodec (NVIDIA#60) the model now gets a CUDA backend on these devices, but magpietts_model_init_local_transformer_copy() still required the discrete GPU type, so --tts.lt-fp32 with --tts.lt-backend cuda (or auto) failed with "cannot create CUDA local-transformer mirror from a non-GPU model". Accept IGPU there too, matching src/runtime/ggml/backend.cpp. Verified on DGX Spark (GB10, CUDA 13.0, sm_121): Magpie v2607 + NanoCodec on CUDA0, local-transformer mirror created on CUDA0 at fp32 (61 tensors), first audio 29-37 ms, RTF 0.05-0.08; previously ~6 s per sentence on CPU. Signed-off-by: Femo <femoalaofin@gmail.com>
for more information, see https://pre-commit.ci
|
|
The CUDA backend in ggml-cuda.cu unconditionally returns GGML_BACKEND_DEVICE_TYPE_GPU from ggml_backend_cuda_device_get_type() (line 4639) — it never reports IGPU for any CUDA device. This is confirmed on both GB10/DGX Spark and Jetson Thor. I'm not sure why this fails for you. |
|
Thanks for looking — I think we're reading two different ggml trees, which explains the disagreement. The unconditional static enum ggml_backend_dev_type ggml_backend_cuda_device_get_type(ggml_backend_dev_t dev) {
...
return prop.integrated ? GGML_BACKEND_DEVICE_TYPE_IGPU : GGML_BACKEND_DEVICE_TYPE_GPU;
}#57 (2026-10-01) dropped the Details from my box, built from
Easy to reproduce on any Spark/Thor with the 0.2.0 release binaries: run |
anand-nv
left a comment
There was a problem hiding this comment.
Verified it works. Issue is due to the ggml version.
fix(tts): integrated GPU support for MagpieTTS / NanoCodec, including the CUDA local-transformer mirror (extends #60)
Problem
On unified-memory NVIDIA parts, ggml enumerates the GPU as
GGML_BACKEND_DEVICE_TYPE_IGPU, not_GPU(
ggml-cuda.cusets the type fromcudaDeviceProp.integrated).nemo-speech doctoron a DGX Spark:The ASR runtime (
src/runtime/ggml/backend.cpp) already accepts both types, but the TTS path only asks for thediscrete type in three places, so Magpie TTS silently runs on the CPU:
src/tts/magpietts/model.cpp—ggml_backend_init_by_type(GPU)returns null → CPU fallback (fixed by fix(tts): support integrated GPU backends in MagpieTTS and NanoCodec #60)src/tts/nanocodec/model.cpp— same (fixed by fix(tts): support integrated GPU backends in MagpieTTS and NanoCodec #60)src/tts/magpietts/lt.cpp—magpietts_model_init_local_transformer_copy()requiresdev_type == GPU, so once1–2 are fixed,
--tts.lt-fp32with--tts.lt-backend cuda/autofails on these devices withcannot create CUDA local-transformer mirror from a non-GPU model(new in this PR)Symptoms on
main(8642eaa) and the 0.2.0 release on a DGX Spark GB10 (CUDA 13.0, sm_121, JetPack-style L4T):and without
--device, synthesis succeeds but takes ~6 s per sentence (CPU) with no warning.Change
Two commits:
864559cby @hsuanguo, cherry-picked unchanged from fix(tts): support integrated GPU backends in MagpieTTS and NanoCodec #60: tryGGML_BACKEND_DEVICE_TYPE_IGPUafter the discreteattempt fails, before the CPU fallback, in the MagpieTTS and NanoCodec loaders.
IGPUinmagpietts_model_init_local_transformer_copy()as well, matching the ASRruntime's check.
#60 has been open since 2026-10-04 without maintainer review; this PR carries it forward with the missing third
site so the fix is complete for the fp32 local-transformer path. Happy to rebase onto #60 if it merges first (only
the
lt.cppcommit would remain).Validation (DGX Spark, GB10, CUDA 13.0,
docker/DockerfilewithCUDA_ARCH=121)Magpie
v2607(frame stacking,stacked_slots=16) + NanoCodec 22 kHz, served throughriva_server:main(CPU fallback, silent)--tts.lt-fp32=true --tts.lt-backend=cudalt.cppL278 rejects any device whose type is not_GPU, and on this hardware it is_IGPU--tts.lt-fp32=true --tts.lt-backend=cudaMagpieTTS local transformer mirror: CUDA0, precision=fp32 (61 tensors)Streaming through the Riva gRPC client (
synthesize_online, LINEAR_PCM 22.05 kHz), 3 runs each, 8–9 s utterances.Running in production for a home assistant on the Spark since 2026-10-11 (SIGKILL/restart tested).
Notes
unchanged from how a discrete GPU OOM is handled today in both loaders, so I left it out of scope here rather than
restructure the loaders; happy to follow up separately if wanted.