From a9efb491dc53ad58485bb009586c48c3c9bab279 Mon Sep 17 00:00:00 2001 From: hsuanguo Date: Sun, 4 Oct 2026 20:12:52 +0100 Subject: [PATCH 1/3] fixed tts loaders on igpu Signed-off-by: hsuanguo --- src/tts/magpietts/model.cpp | 3 +++ src/tts/nanocodec/model.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/tts/magpietts/model.cpp b/src/tts/magpietts/model.cpp index 0b9561d..32d273c 100644 --- a/src/tts/magpietts/model.cpp +++ b/src/tts/magpietts/model.cpp @@ -873,6 +873,9 @@ magpietts_model_load_impl( ggml_backend_load_all(); if (!force_cpu) { model.backend = ggml_backend_init_by_type(GGML_BACKEND_DEVICE_TYPE_GPU, nullptr); + if (!model.backend) { + model.backend = ggml_backend_init_by_type(GGML_BACKEND_DEVICE_TYPE_IGPU, nullptr); + } } if (!model.backend) { model.backend = ggml_backend_init_by_type(GGML_BACKEND_DEVICE_TYPE_CPU, nullptr); diff --git a/src/tts/nanocodec/model.cpp b/src/tts/nanocodec/model.cpp index 13beff3..adafafa 100644 --- a/src/tts/nanocodec/model.cpp +++ b/src/tts/nanocodec/model.cpp @@ -639,6 +639,9 @@ nc_model_load( ggml_backend_load_all(); if (!force_cpu) { model.backend = ggml_backend_init_by_type(GGML_BACKEND_DEVICE_TYPE_GPU, nullptr); + if (!model.backend) { + model.backend = ggml_backend_init_by_type(GGML_BACKEND_DEVICE_TYPE_IGPU, nullptr); + } } if (!model.backend || force_cpu) { model.backend = ggml_backend_init_by_type(GGML_BACKEND_DEVICE_TYPE_CPU, nullptr); From 12f10aa6ee3aa52a725efe34ac1a6eba64335c4a Mon Sep 17 00:00:00 2001 From: Femo Date: Sun, 11 Oct 2026 00:57:38 -0500 Subject: [PATCH 2/3] fix(tts): accept integrated GPU devices for the CUDA local-transformer 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 (#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 --- src/tts/magpietts/lt.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tts/magpietts/lt.cpp b/src/tts/magpietts/lt.cpp index cc826bf..d032714 100644 --- a/src/tts/magpietts/lt.cpp +++ b/src/tts/magpietts/lt.cpp @@ -275,7 +275,8 @@ magpietts_model_init_local_transformer_copy( if (use_cuda) { ggml_backend_dev_t device = ggml_backend_get_device(src.backend); - if (!device || ggml_backend_dev_type(device) != GGML_BACKEND_DEVICE_TYPE_GPU) { + const auto dev_type = device ? ggml_backend_dev_type(device) : GGML_BACKEND_DEVICE_TYPE_CPU; + if (!device || (dev_type != GGML_BACKEND_DEVICE_TYPE_GPU && dev_type != GGML_BACKEND_DEVICE_TYPE_IGPU)) { fprintf(stderr, "cannot create CUDA local-transformer mirror from a non-GPU model\n"); return false; } From d3a5097ab79e1787ba370b84c6c3670077bc44de Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 11 Oct 2026 06:00:05 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/tts/magpietts/lt.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tts/magpietts/lt.cpp b/src/tts/magpietts/lt.cpp index d032714..5de564b 100644 --- a/src/tts/magpietts/lt.cpp +++ b/src/tts/magpietts/lt.cpp @@ -276,7 +276,8 @@ magpietts_model_init_local_transformer_copy( if (use_cuda) { ggml_backend_dev_t device = ggml_backend_get_device(src.backend); const auto dev_type = device ? ggml_backend_dev_type(device) : GGML_BACKEND_DEVICE_TYPE_CPU; - if (!device || (dev_type != GGML_BACKEND_DEVICE_TYPE_GPU && dev_type != GGML_BACKEND_DEVICE_TYPE_IGPU)) { + if (!device || (dev_type != GGML_BACKEND_DEVICE_TYPE_GPU && + dev_type != GGML_BACKEND_DEVICE_TYPE_IGPU)) { fprintf(stderr, "cannot create CUDA local-transformer mirror from a non-GPU model\n"); return false; }