@acpfx/tts-pocket 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -6,7 +6,7 @@ Local text-to-speech via Pocket TTS. A lightweight ~100M parameter model that ru
6
6
 
7
7
  This package is a pipeline node for [@acpfx/cli](../orchestrator/README.md). See the CLI package for installation and usage.
8
8
 
9
- The postinstall script downloads a prebuilt binary for your platform. Supported: macOS (Apple Silicon with Metal), Linux (x86_64, optional CUDA).
9
+ The postinstall script downloads a prebuilt binary for your platform. On Linux/Windows with an NVIDIA GPU (Ampere or newer, compute capability 8.0+), a CUDA-accelerated binary is downloaded automatically. Otherwise falls back to CPU (~6x realtime on Apple Silicon).
10
10
 
11
11
  ## Manifest
12
12
 
@@ -31,12 +31,22 @@ nodes:
31
31
  outputs: [player]
32
32
  ```
33
33
 
34
+ ## GPU Acceleration
35
+
36
+ | Platform | Acceleration | Requirement |
37
+ |----------|-------------|-------------|
38
+ | macOS | Metal | Apple Silicon (automatic) |
39
+ | Linux/Windows | CUDA | NVIDIA Ampere+ (RTX 3090, A100, etc.) |
40
+ | All | CPU | Fallback, ~6x realtime on Apple Silicon |
41
+
34
42
  ## Building from Source
35
43
 
36
44
  ```bash
37
45
  cargo build --release -p node-tts-pocket
38
46
  # With Metal (macOS):
39
47
  cargo build --release -p node-tts-pocket --features metal
48
+ # With CUDA (Linux/Windows, requires CUDA toolkit):
49
+ cargo build --release -p node-tts-pocket --features cuda
40
50
  ```
41
51
 
42
52
  ## External Links
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acpfx/tts-pocket",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "Local TTS via Pocket TTS (on-device, Rust/Candle, CPU-capable)",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,12 +13,15 @@ const SUPPORTED_PLATFORMS = {
13
13
  "win32 x64": "tts-pocket-win32-x64.exe",
14
14
  };
15
15
 
16
- function hasNvidiaGpu() {
16
+ function getCudaComputeCap() {
17
17
  try {
18
- require("child_process").execSync("nvidia-smi", { stdio: "ignore" });
19
- return true;
18
+ const output = require("child_process")
19
+ .execSync("nvidia-smi --query-gpu=compute_cap --format=csv,noheader", { stdio: ["pipe", "pipe", "ignore"] })
20
+ .toString().trim();
21
+ // "8.6" -> 86, "7.5" -> 75
22
+ return parseInt(output.replace(".", ""), 10);
20
23
  } catch {
21
- return false;
24
+ return 0;
22
25
  }
23
26
  }
24
27
 
@@ -32,8 +35,8 @@ function getBinaryName() {
32
35
  );
33
36
  }
34
37
 
35
- // Try CUDA variant on Linux/Windows when an NVIDIA GPU is present
36
- if ((process.platform === "linux" || process.platform === "win32") && hasNvidiaGpu()) {
38
+ // Try CUDA variant on Linux/Windows when an NVIDIA Ampere+ GPU is present (compute cap >= 8.0)
39
+ if ((process.platform === "linux" || process.platform === "win32") && getCudaComputeCap() >= 80) {
37
40
  return base.replace(/(\.\w+)?$/, "-cuda$1");
38
41
  }
39
42
  return base;