Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

fix(gpu): tell users when an update needs a newer GPU pack (#2501)

void95fb3758c61f
diff --git a/main.js b/main.js
index 1758196eb..bbde5cb64 100644
--- a/main.js
+++ b/main.js
@@ -301,7 +301,11 @@ const SelectionManager = require("./src/helpers/selectionManager");
const { PermissionGuideManager } = require("./src/helpers/permissionGuideManager");
const WhisperCudaManager = require("./src/helpers/whisperCudaManager");
const WhisperVulkanManager = require("./src/helpers/whisperVulkanManager");
-const { migrateLegacyBinDir, detectOrphanedGpuPacks } = require("./src/helpers/gpuBinaryManager");
+const {
+ migrateLegacyBinDir,
+ detectOrphanedGpuPacks,
+ detectOutdatedGpuPacks,
+} = require("./src/helpers/gpuBinaryManager");
const { resetWhisperGpuFailureOnUpgrade } = require("./src/helpers/whisperGpuUpgradeReset");
const GoogleCalendarManager = require("./src/helpers/googleCalendarManager");
const MicrosoftCalendarManager = require("./src/helpers/microsoftCalendarManager");
@@ -544,14 +548,34 @@ function initializeCoreManagers() {
// notice, leaving those users on a silent CPU fallback: an enabled flag
// with no pack on disk only happens via such data loss. recordOnce gates
// each pack to one notice so a dismissed toast doesn't return every launch.
- const orphanedPacks = detectOrphanedGpuPacks([
- { manager: whisperCudaManager, enabledEnvVar: "WHISPER_CUDA_ENABLED" },
- { manager: whisperVulkanManager, enabledEnvVar: "WHISPER_VULKAN_ENABLED" },
+ const gpuPacks = [
+ { manager: whisperCudaManager, enabledEnvVar: "WHISPER_CUDA_ENABLED", group: "whisper" },
+ { manager: whisperVulkanManager, enabledEnvVar: "WHISPER_VULKAN_ENABLED", group: "whisper" },
{ manager: llamaVulkanManager, enabledEnvVar: "LLAMA_VULKAN_ENABLED" },
- ]);
+ ];
+ const orphanedPacks = detectOrphanedGpuPacks(gpuPacks);
if (orphanedPacks.length > 0) {
require("./src/helpers/gpuPackMigrationNotice").recordOnce(orphanedPacks);
}
+ // A pack an older release installed that this version can't use (#2424)
+ // otherwise looks like a pack that was never downloaded: say so once per
+ // app version, even to a user who already saw the orphan notice for it.
+ // Only whisper packs can be outdated, so only a user on local whisper
+ // (the only mode whose Settings shows the pack) is told.
+ const outdatedPacks = detectOutdatedGpuPacks(gpuPacks);
+ if (outdatedPacks.length > 0) {
+ const whisperInUse = !!process.env.LOCAL_WHISPER_MODEL;
+ debugLogger.info("GPU packs from an older release need re-downloading", {
+ packs: outdatedPacks,
+ notified: whisperInUse,
+ });
+ if (whisperInUse) {
+ require("./src/helpers/gpuPackMigrationNotice").recordOnce(
+ outdatedPacks,
+ `outdated-${app.getVersion()}`
+ );
+ }
+ }
// Lets every server start resolve its GPU backend from installed packs
whisperManager.setGpuBinaryManagers({ cuda: whisperCudaManager, vulkan: whisperVulkanManager });
}
diff --git a/src/components/TranscriptionModelPicker.tsx b/src/components/TranscriptionModelPicker.tsx
index 4f09ee8e6..ec2f8ca3c 100644
--- a/src/components/TranscriptionModelPicker.tsx
+++ b/src/components/TranscriptionModelPicker.tsx
@@ -46,6 +46,7 @@ import { createExternalLinkHandler } from "../utils/externalLinks";
import { API_ENDPOINTS, normalizeBaseUrl } from "../config/constants";
import { GetApiKeyLink } from "./ui/GetApiKeyLink";
import { getCachedPlatform } from "../utils/platform";
+import { pickWhisperGpuBackend } from "../utils/whisperGpuPack";
import logger from "../utils/logger";
import type { ParakeetCheckResult } from "../types/electron";
@@ -376,6 +377,46 @@ function ModeToggle({ useLocalWhisper, onModeChange }: ModeToggleProps) {
);
}
+interface GpuWarningRowProps {
+ title: string;
+ description: string;
+ actionLabel: string;
+ onAction: () => void;
+ onRemove: () => void;
+}
+
+function GpuWarningRow({
+ title,
+ description,
+ actionLabel,
+ onAction,
+ onRemove,
+}: GpuWarningRowProps) {
+ const { t } = useTranslation();
+ return (
+ <div className="flex items-start justify-between gap-3">
+ <div className="flex min-w-0 items-start gap-2">
+ <CircleAlert size={15} className="mt-0.5 shrink-0 text-warning" />
+ <div className="min-w-0">
+ <p className="text-xs font-medium text-foreground">{title}</p>
+ <p className="mt-0.5 text-xs leading-snug text-muted-foreground">{description}</p>
+ <Button onClick={onAction} size="sm" className="mt-2 h-7 px-3 text-xs">
+ {actionLabel}
+ </Button>
+ </div>
+ </div>
+ <Button
+ onClick={onRemove}
+ size="sm"
+ variant="ghost"
+ className="h-6 shrink-0 px-2 text-xs text-muted-foreground hover:text-destructive"
+ >
+ {t("gpu.remove")}
+ </Button>
+ </div>
+ );
+}
+
export default function TranscriptionModelPicker({
transcriptionContext = "dictation",
selectedCloudProvider,
@@ -447,6 +488,14 @@ export default function TranscriptionModelPicker({
const [gpuDismissed, setGpuDismissed] = useState(false);
// The pack fell back to CPU on this machine (persisted by main until retried)
const [gpuFailed, setGpuFailed] = useState(false);
+ // An older release installed the pack and this version can't use it (#2424)
+ const [gpuNeedsUpdate, setGpuNeedsUpdate] = useState(false);
+ // Why the last pack download failed (cleared by the next attempt)
+ const [gpuDownloadError, setGpuDownloadError] = useState<string | null>(null);
+ // The running download was started before Settings was last opened, so no
+ // pending call here will report its end: its status is polled instead
+ const [gpuResumedDownload, setGpuResumedDownload] = useState(false);
+ const gpuDownloadCancelledRef = useRef(false);
// A server reload with the new backend is in flight (Vulkan cold starts are slow)
const [gpuActivating, setGpuActivating] = useState(false);
// Live truth from the running server; "active" is never inferred from a download
@@ -716,20 +765,16 @@ export default function TranscriptionModelPicker({
window.electronAPI?.getCudaWhisperStatus?.(),
window.electronAPI?.getVulkanWhisperStatus?.(),
]);
- // Cards below the CUDA build's kernel floor (e.g. Maxwell) crash at the
- // first kernel launch, so they get the Vulkan pack like AMD/Intel GPUs.
- const cudaEligible = !!cuda?.gpuInfo.hasNvidiaGpu && !!cuda.gpuInfo.cudaSupported;
- // Prefer the pack that's already installed: a working Vulkan setup must
- // not be re-prompted to download the CUDA pack (matches the resolver,
- // which only prefers CUDA when it is actually downloaded).
- if (cudaEligible && (cuda.downloaded || !vulkan?.downloaded)) {
- setGpuBackend("cuda");
- setGpuDownloaded(cuda.downloaded);
- setGpuFailed(!!cuda.gpuFailed);
- } else if (vulkan?.vulkan.available) {
- setGpuBackend("vulkan");
- setGpuDownloaded(vulkan.downloaded);
- setGpuFailed(!!vulkan.gpuFailed);
+ const backend = pickWhisperGpuBackend(cuda, vulkan);
+ const status = backend === "cuda" ? cuda : backend === "vulkan" ? vulkan : null;
+ setGpuBackend(backend);
+ setGpuDownloaded(!!status?.downloaded);
+ setGpuFailed(!!status?.gpuFailed);
+ setGpuNeedsUpdate(!!status?.needsUpdate);
+ // A download this card started before Settings was closed is still running
+ if (status?.downloading) {
+ setGpuDownloading(true);
+ setGpuResumedDownload(true);
}
} catch {}
};
@@ -745,6 +790,25 @@ export default function TranscriptionModelPicker({
return subscribe?.((data) => setGpuProgress(data));
}, [gpuDownloading, gpuBackend]);
+ useEffect(() => {
+ if (!gpuResumedDownload || !gpuBackend) return;
+ const id = setInterval(async () => {
+ try {
+ const status =
+ gpuBackend === "cuda"
+ ? await window.electronAPI?.getCudaWhisperStatus?.()
+ : await window.electronAPI?.getVulkanWhisperStatus?.();
+ if (!status || status.downloading) return;
+ setGpuResumedDownload(false);
+ setGpuDownloading(false);
+ setGpuDownloaded(status.downloaded);
+ setGpuFailed(!!status.gpuFailed);
+ setGpuNeedsUpdate(!!status.needsUpdate);
+ } catch {}
+ }, 1000);
+ return () => clearInterval(id);
+ }, [gpuResumedDownload, gpuBackend]);
+
// Live server state: "GPU acceleration active" reflects what the server is
// actually running on, not just that a pack is on disk (a crashed GPU server
// silently falls back to CPU). Faster poll while an activation is in flight.
@@ -789,6 +853,8 @@ export default function TranscriptionModelPicker({
const handleGpuDownload = async () => {
setGpuDownloading(true);
+ setGpuDownloadError(null);
+ gpuDownloadCancelledRef.current = false;
try {
const result =
gpuBackend === "cuda"
@@ -797,9 +863,12 @@ export default function TranscriptionModelPicker({
if (result?.success) {
setGpuDownloaded(true);
setGpuFailed(false);
+ setGpuNeedsUpdate(false);
// Main reloads the server with the new backend only when one is loaded;
// otherwise the pack simply engages on the next dictation.
setGpuActivating(!!result.willRestart);
+ } else if (result && !gpuDownloadCancelledRef.current) {
+ setGpuDownloadError(result.error ?? "");
}
} finally {
setGpuDownloading(false);
@@ -820,12 +889,15 @@ export default function TranscriptionModelPicker({
if (result?.success) {
setGpuDownloaded(false);
setGpuFailed(false);
+ setGpuNeedsUpdate(false);
+ setGpuDownloadError(null);
setGpuActivating(false);
setGpuActive(false);
}
};
const handleGpuCancel = async () => {
+ gpuDownloadCancelledRef.current = true;
if (gpuBackend === "cuda") await window.electronAPI?.cancelCudaWhisperDownload?.();
else await window.electronAPI?.cancelVulkanWhisperDownload?.();
setGpuDownloading(false);
@@ -1354,41 +1426,20 @@ export default function TranscriptionModelPicker({
gpuBackend && (
<div
className={`rounded-md border p-2.5 ${
- gpuDownloaded && gpuFailed
+ (gpuDownloaded ? gpuFailed : gpuNeedsUpdate)
? "border-warning/40 bg-warning/5"
: "border-border bg-surface-1"
}`}
>
{gpuDownloaded ? (
gpuFailed ? (
- <div className="flex items-start justify-between gap-3">
- <div className="flex min-w-0 items-start gap-2">
- <CircleAlert size={15} className="mt-0.5 shrink-0 text-warning" />
- <div className="min-w-0">
- <p className="text-xs font-medium text-foreground">
- {t("gpu.activationFailed")}
- </p>
- <p className="mt-0.5 text-xs leading-snug text-muted-foreground">
- {t("gpu.activationFailedDescription")}
- </p>
- <Button
- onClick={handleGpuRetry}
- size="sm"
- className="mt-2 h-7 px-3 text-xs"
- >
- {t("gpu.retryActivation")}
- </Button>
- </div>
- </div>
- <Button
- onClick={handleGpuDelete}
- size="sm"
- variant="ghost"
- className="h-6 shrink-0 px-2 text-xs text-muted-foreground hover:text-destructive"
- >
- {t("gpu.remove")}
- </Button>
- </div>
+ <GpuWarningRow
+ title={t("gpu.activationFailed")}
+ description={t("gpu.activationFailedDescription")}
+ actionLabel={t("gpu.retryActivation")}
+ onAction={handleGpuRetry}
+ onRemove={handleGpuDelete}
+ />
) : (
<div className="flex items-center justify-between">
<div className="flex items-center gap-1.5">
@@ -1425,6 +1476,14 @@ export default function TranscriptionModelPicker({
</Button>
</div>
)
+ ) : gpuNeedsUpdate ? (
+ <GpuWarningRow
+ title={t("gpu.redownloadNeeded")}
+ description={t("gpu.redownloadNeededDescription")}
+ actionLabel={t("gpu.redownloadButton")}
+ onAction={handleGpuDownload}
+ onRemove={handleGpuDelete}
+ />
) : (
<div className="flex items-start gap-2.5">
<Zap size={13} className="text-primary shrink-0 mt-0.5" />
@@ -1451,6 +1510,12 @@ export default function TranscriptionModelPicker({
</div>
</div>
)}
+ {!gpuDownloaded && gpuDownloadError !== null && (
+ <p className="mt-2 text-xs leading-snug text-destructive">
+ {t("gpu.downloadFailed")}
+ {gpuDownloadError && ` ${gpuDownloadError}`}
+ </p>
+ )}
</div>
)}
diff --git a/src/helpers/gpuBinaryManager.js b/src/helpers/gpuBinaryManager.js
index 1230f1d66..3d0f8e3ca 100644
--- a/src/helpers/gpuBinaryManager.js
+++ b/src/helpers/gpuBinaryManager.js
@@ -94,6 +94,23 @@ class GpuBinaryManager {
return this.getBinaryPath() !== null;
}
+ // The binary is on disk but a library this version requires is missing: a
+ // pack installed by an older release (1.10.0 started requiring the MSVC
+ // runtime in Windows whisper packs), not a pack that was never downloaded.
+ // See #2424.
+ needsUpdate() {
+ const assetConfig = this._getAssetConfig();
+ if (!assetConfig) return false;
+ try {
+ return (
+ fs.existsSync(path.join(this.binDir, assetConfig.outputName)) &&
+ getMissingRequiredLibraries(this.binDir, assetConfig).length > 0
+ );
+ } catch {
+ return false;
+ }
+ }
+
isDownloading() {
return this._downloading;
}
@@ -340,7 +357,26 @@ function detectOrphanedGpuPacks(packs) {
return packs
.filter(
({ manager, enabledEnvVar }) =>
- process.env[enabledEnvVar] === "true" && manager.isSupported() && !manager.isDownloaded()
+ process.env[enabledEnvVar] === "true" &&
+ manager.isSupported() &&
+ !manager.isDownloaded() &&
+ !manager.needsUpdate()
+ )
+ .map(({ manager }) => manager.config.name);
+}
+
+// Packs an older release installed that this version can't use (needsUpdate).
+// A pack on disk implies the user wants it, unless its flag says "false".
+// Packs sharing a `group` are alternatives for one engine (whisper CUDA and
+// Vulkan): while one of them works, the other is never used and Settings
+// shows only the working one, so an outdated sibling isn't worth a notice.
+function detectOutdatedGpuPacks(packs) {
+ return packs
+ .filter(
+ ({ manager, enabledEnvVar, group }) =>
+ (process.env[enabledEnvVar] || "").toLowerCase() !== "false" &&
+ manager.needsUpdate() &&
+ !packs.some((other) => group && other.group === group && other.manager.isDownloaded())
)
.map(({ manager }) => manager.config.name);
}
@@ -348,3 +384,4 @@ function detectOrphanedGpuPacks(packs) {
module.exports = GpuBinaryManager;
module.exports.migrateLegacyBinDir = migrateLegacyBinDir;
module.exports.detectOrphanedGpuPacks = detectOrphanedGpuPacks;
+module.exports.detectOutdatedGpuPacks = detectOutdatedGpuPacks;
diff --git a/src/helpers/gpuPackMigrationNotice.js b/src/helpers/gpuPackMigrationNotice.js
index 4fe7b548d..3f616972c 100644
--- a/src/helpers/gpuPackMigrationNotice.js
+++ b/src/helpers/gpuPackMigrationNotice.js
@@ -43,17 +43,23 @@ function read() {
}
}
-function recordOnce(packNames) {
+// `occasion` scopes the "once": a pack an update made unusable is noticed once
+// per occasion (e.g. per app version), apart from its one orphan notice.
+function recordOnce(packNames, occasion = "") {
let flagged = [];
try {
const { packs } = JSON.parse(fs.readFileSync(getFlaggedPath(), "utf8"));
if (Array.isArray(packs)) flagged = packs;
} catch {}
- const unseen = (packNames || []).filter((name) => !flagged.includes(name));
+ const flagOf = (name) => (occasion ? `${name}@${occasion}` : name);
+ const unseen = (packNames || []).filter((name) => !flagged.includes(flagOf(name)));
if (unseen.length === 0) return;
record(unseen);
try {
- fs.writeFileSync(getFlaggedPath(), JSON.stringify({ packs: [...flagged, ...unseen] }));
+ fs.writeFileSync(
+ getFlaggedPath(),
+ JSON.stringify({ packs: [...flagged, ...unseen.map(flagOf)] })
+ );
} catch {
// Best-effort: the user may be notified again next launch.
}
diff --git a/src/helpers/ipcHandlers.js b/src/helpers/ipcHandlers.js
index 284919aa5..1d776733f 100644
--- a/src/helpers/ipcHandlers.js
+++ b/src/helpers/ipcHandlers.js
@@ -3432,10 +3432,11 @@ class IPCHandlers {
const { detectNvidiaGpu } = require("../utils/gpuDetection");
const gpuInfo = await detectNvidiaGpu();
if (!this.whisperCudaManager) {
- return { downloaded: false, downloading: false, path: null, gpuInfo };
+ return { downloaded: false, needsUpdate: false, downloading: false, path: null, gpuInfo };
}
return {
downloaded: this.whisperCudaManager.isDownloaded(),
+ needsUpdate: this.whisperCudaManager.needsUpdate(),
downloading: this.whisperCudaManager.isDownloading(),
path: this.whisperCudaManager.getCudaBinaryPath(),
gpuInfo,
@@ -3498,6 +3499,7 @@ class IPCHandlers {
const [vulkan, gpuInfo] = await Promise.all([detectVulkanGpu(), detectNvidiaGpu()]);
return {
downloaded: this.whisperVulkanManager?.isDownloaded() ?? false,
+ needsUpdate: this.whisperVulkanManager?.needsUpdate() ?? false,
downloading: this.whisperVulkanManager?.isDownloading() ?? false,
vulkan,
hasNvidiaGpu: gpuInfo.hasNvidiaGpu,
diff --git a/src/locales/ar/translation.json b/src/locales/ar/translation.json
index 0968f28b6..22d2b54cd 100644
--- a/src/locales/ar/translation.json
+++ b/src/locales/ar/translation.json
@@ -1835,7 +1835,7 @@
},
"gpuPackMigration": {
"title": "تحتاج حزمة GPU إلى إعادة التنزيل",
- "description": "أزال التحديث تثبيت حزمة GPU قديمة ({{packs}}). أعد تنزيلها في الإعدادات لاستعادة تسريع GPU."
+ "description": "لا يمكن لهذا الإصدار استخدام حزمة GPU السابقة ({{packs}}). أعد تنزيلها من الإعدادات لإعادة تشغيل تسريع GPU."
},
"cleanupFailed": {
"title": "فشل التنقيح",
@@ -4744,6 +4744,10 @@
"activationFailedDescription": "انتقل OpenWhispr إلى استخدام وحدة المعالجة المركزية (CPU) للتفريغ الصوتي.",
"reasoningActivationFailedDescription": "انتقل OpenWhispr إلى استخدام وحدة المعالجة المركزية (CPU) للمعالجة.",
"retryActivation": "إعادة محاولة تفعيل GPU",
+ "redownloadNeeded": "تحتاج حزمة GPU إلى إعادة التنزيل",
+ "redownloadNeededDescription": "لا يمكن لهذا الإصدار من OpenWhispr استخدام حزمة GPU المثبتة. أعد تنزيلها لإعادة تشغيل تسريع GPU.",
+ "redownloadButton": "إعادة تنزيل حزمة GPU",
+ "downloadFailed": "تعذّر تنزيل حزمة GPU.",
"remove": "إزالة",
"dismiss": "ليس الآن",
"cancel": "إلغاء"
diff --git a/src/locales/de/translation.json b/src/locales/de/translation.json
index 2acf0d27a..18cce80a9 100644
--- a/src/locales/de/translation.json
+++ b/src/locales/de/translation.json
@@ -3835,6 +3835,10 @@
"activationFailedDescription": "OpenWhispr verwendet die CPU-Transkription.",
"reasoningActivationFailedDescription": "OpenWhispr verwendet die CPU-Verarbeitung.",
"retryActivation": "GPU-Beschleunigung erneut versuchen",
+ "redownloadNeeded": "GPU-Paket muss erneut heruntergeladen werden",
+ "redownloadNeededDescription": "Diese Version von OpenWhispr kann dein installiertes GPU-Paket nicht verwenden. Lade es erneut herunter, um die GPU-Beschleunigung wieder einzuschalten.",
+ "redownloadButton": "GPU-Paket erneut herunterladen",
+ "downloadFailed": "Das GPU-Paket konnte nicht heruntergeladen werden.",
"remove": "Entfernen",
"dismiss": "Nicht jetzt",
"cancel": "Abbrechen"
@@ -3862,7 +3866,7 @@
},
"gpuPackMigration": {
"title": "GPU-Paket muss erneut heruntergeladen werden",
- "description": "Ein Update hat eine veraltete GPU-Paket-Installation entfernt ({{packs}}). Lade es in den Einstellungen erneut herunter, um die GPU-Beschleunigung wiederherzustellen."
+ "description": "Diese Version kann dein bisheriges GPU-Paket ({{packs}}) nicht verwenden. Lade es in den Einstellungen erneut herunter, um die GPU-Beschleunigung wieder einzuschalten."
},
"cleanupFailed": {
"title": "Bereinigung fehlgeschlagen",
diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json
index 69a1b3b34..ba9d25514 100644
--- a/src/locales/en/translation.json
+++ b/src/locales/en/translation.json
@@ -3835,6 +3835,10 @@
"activationFailedDescription": "OpenWhispr switched to CPU transcription.",
"reasoningActivationFailedDescription": "OpenWhispr switched to CPU processing.",
"retryActivation": "Retry GPU acceleration",
+ "redownloadNeeded": "GPU pack needs re-downloading",
+ "redownloadNeededDescription": "This version of OpenWhispr can't use your installed GPU pack. Download it again to turn GPU acceleration back on.",
+ "redownloadButton": "Re-download GPU pack",
+ "downloadFailed": "Couldn't download the GPU pack.",
"remove": "Remove",
"dismiss": "Not now",
"cancel": "Cancel"
@@ -3862,7 +3866,7 @@
},
"gpuPackMigration": {
"title": "GPU pack needs re-downloading",
- "description": "An update removed an outdated GPU pack installation ({{packs}}). Re-download it in Settings to restore GPU acceleration."
+ "description": "This version can't use your earlier GPU pack ({{packs}}). Download it again in Settings to turn GPU acceleration back on."
},
"cleanupFailed": {
"title": "Cleanup failed",
diff --git a/src/locales/es/translation.json b/src/locales/es/translation.json
index 23123202d..557dece95 100644
--- a/src/locales/es/translation.json
+++ b/src/locales/es/translation.json
@@ -3717,6 +3717,10 @@
"activationFailedDescription": "OpenWhispr cambió a la transcripción por CPU.",
"reasoningActivationFailedDescription": "OpenWhispr cambió al procesamiento por CPU.",
"retryActivation": "Reintentar aceleración GPU",
+ "redownloadNeeded": "Es necesario volver a descargar el paquete GPU",
+ "redownloadNeededDescription": "Esta versión de OpenWhispr no puede usar tu paquete GPU instalado. Vuelve a descargarlo para volver a activar la aceleración GPU.",
+ "redownloadButton": "Volver a descargar el paquete GPU",
+ "downloadFailed": "No se pudo descargar el paquete GPU.",
"remove": "Eliminar",
"dismiss": "Ahora no",
"cancel": "Cancelar"
@@ -3744,7 +3748,7 @@
},
"gpuPackMigration": {
"title": "Es necesario volver a descargar el paquete GPU",
- "description": "Una actualización eliminó una instalación obsoleta del paquete GPU ({{packs}}). Vuelve a descargarlo en Configuración para restaurar la aceleración GPU."
+ "description": "Esta versión no puede usar tu paquete GPU anterior ({{packs}}). Vuelve a descargarlo en Configuración para volver a activar la aceleración GPU."
},
"cleanupFailed": {
"title": "Limpieza fallida",
diff --git a/src/locales/fr/translation.json b/src/locales/fr/translation.json
index 06f465a51..9f437ce99 100644
--- a/src/locales/fr/translation.json
+++ b/src/locales/fr/translation.json
@@ -3835,6 +3835,10 @@
"activationFailedDescription": "OpenWhispr est passé à la transcription par CPU.",
"reasoningActivationFailedDescription": "OpenWhispr est passé au traitement par CPU.",
"retryActivation": "Réessayer l'accélération GPU",
+ "redownloadNeeded": "Le pack GPU doit être retéléchargé",
+ "redownloadNeededDescription": "Cette version d'OpenWhispr ne peut pas utiliser votre pack GPU installé. Retéléchargez-le pour réactiver l'accélération GPU.",
+ "redownloadButton": "Retélécharger le pack GPU",
+ "downloadFailed": "Impossible de télécharger le pack GPU.",
"remove": "Supprimer",
"dismiss": "Pas maintenant",
"cancel": "Annuler"
@@ -3862,7 +3866,7 @@
},
"gpuPackMigration": {
"title": "Le pack GPU doit être retéléchargé",
- "description": "Une mise à jour a supprimé une installation obsolète du pack GPU ({{packs}}). Retéléchargez-le dans les paramètres pour rétablir l'accélération GPU."
+ "description": "Cette version ne peut pas utiliser votre ancien pack GPU ({{packs}}). Retéléchargez-le dans les paramètres pour réactiver l'accélération GPU."
},
"cleanupFailed": {
"title": "Échec du nettoyage",
diff --git a/src/locales/it/translation.json b/src/locales/it/translation.json
index 1aaa40234..f561a10f2 100644
--- a/src/locales/it/translation.json
+++ b/src/locales/it/translation.json
@@ -3664,6 +3664,10 @@
"activationFailedDescription": "OpenWhispr sta usando la trascrizione CPU.",
"reasoningActivationFailedDescription": "OpenWhispr sta usando l'elaborazione CPU.",
"retryActivation": "Riprova l'accelerazione GPU",
+ "redownloadNeeded": "Il pacchetto GPU deve essere scaricato di nuovo",
+ "redownloadNeededDescription": "Questa versione di OpenWhispr non può usare il pacchetto GPU installato. Scaricalo di nuovo per riattivare l'accelerazione GPU.",
+ "redownloadButton": "Scarica di nuovo il pacchetto GPU",
+ "downloadFailed": "Impossibile scaricare il pacchetto GPU.",
"remove": "Rimuovi",
"dismiss": "Non ora",
"cancel": "Annulla"
@@ -3691,7 +3695,7 @@
},
"gpuPackMigration": {
"title": "Il pacchetto GPU deve essere scaricato di nuovo",
- "description": "Un aggiornamento ha rimosso un'installazione obsoleta del pacchetto GPU ({{packs}}). Scaricalo di nuovo nelle Impostazioni per ripristinare l'accelerazione GPU."
+ "description": "Questa versione non può usare il pacchetto GPU precedente ({{packs}}). Scaricalo di nuovo nelle Impostazioni per riattivare l'accelerazione GPU."
},
"cleanupFailed": {
"title": "Pulizia non riuscita",
diff --git a/src/locales/ja/translation.json b/src/locales/ja/translation.json
index 1587add62..563b11f02 100644
--- a/src/locales/ja/translation.json
+++ b/src/locales/ja/translation.json
@@ -3664,6 +3664,10 @@
"activationFailedDescription": "OpenWhispr は CPU 文字起こしに切り替えました。",
"reasoningActivationFailedDescription": "OpenWhispr は CPU 処理に切り替えました。",
"retryActivation": "GPU アクセラレーションを再試行",
+ "redownloadNeeded": "GPU パックの再ダウンロードが必要です",
+ "redownloadNeededDescription": "このバージョンの OpenWhispr はインストール済みの GPU パックを使用できません。再ダウンロードすると GPU アクセラレーションが再び有効になります。",
+ "redownloadButton": "GPU パックを再ダウンロード",
+ "downloadFailed": "GPU パックをダウンロードできませんでした。",
"remove": "削除",
"dismiss": "後で",
"cancel": "キャンセル"
@@ -3691,7 +3695,7 @@
},
"gpuPackMigration": {
"title": "GPU パックの再ダウンロードが必要です",
- "description": "アップデートにより古い GPU パックのインストール({{packs}})が削除されました。設定から再ダウンロードすると GPU アクセラレーションが復元されます。"
+ "description": "このバージョンでは以前の GPU パック({{packs}})を使用できません。設定から再ダウンロードすると GPU アクセラレーションが再び有効になります。"
},
"cleanupFailed": {
"title": "クリーンアップに失敗しました",
diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.json
index 0684d88af..d5aa5e416 100644
--- a/src/locales/pt/translation.json
+++ b/src/locales/pt/translation.json
@@ -3664,6 +3664,10 @@
"activationFailedDescription": "OpenWhispr mudou para a transcrição por CPU.",
"reasoningActivationFailedDescription": "OpenWhispr mudou para o processamento por CPU.",
"retryActivation": "Tentar aceleração por GPU novamente",
+ "redownloadNeeded": "O pacote GPU precisa ser baixado novamente",
+ "redownloadNeededDescription": "Esta versão do OpenWhispr não consegue usar o pacote GPU instalado. Baixe-o novamente para reativar a aceleração GPU.",
+ "redownloadButton": "Baixar o pacote GPU novamente",
+ "downloadFailed": "Não foi possível baixar o pacote GPU.",
"remove": "Remover",
"dismiss": "Agora não",
"cancel": "Cancelar"
@@ -3691,7 +3695,7 @@
},
"gpuPackMigration": {
"title": "O pacote GPU precisa ser baixado novamente",
- "description": "Uma atualização removeu uma instalação desatualizada do pacote GPU ({{packs}}). Baixe-o novamente nas Configurações para restaurar a aceleração GPU."
+ "description": "Esta versão não consegue usar o pacote GPU anterior ({{packs}}). Baixe-o novamente nas Configurações para reativar a aceleração GPU."
},
"cleanupFailed": {
"title": "Falha na limpeza",
diff --git a/src/locales/ru/translation.json b/src/locales/ru/translation.json
index ea030a8f7..c530dbd9b 100644
--- a/src/locales/ru/translation.json
+++ b/src/locales/ru/translation.json
@@ -3708,6 +3708,10 @@
"activationFailedDescription": "OpenWhispr переключился на транскрипцию на CPU.",
"reasoningActivationFailedDescription": "OpenWhispr переключился на обработку на CPU.",
"retryActivation": "Повторить ускорение GPU",
+ "redownloadNeeded": "Требуется повторная загрузка GPU-пакета",
+ "redownloadNeededDescription": "Эта версия OpenWhispr не может использовать установленный GPU-пакет. Загрузите его заново, чтобы снова включить ускорение GPU.",
+ "redownloadButton": "Загрузить GPU-пакет заново",
+ "downloadFailed": "Не удалось загрузить GPU-пакет.",
"remove": "Удалить",
"dismiss": "Не сейчас",
"cancel": "Отмена"
@@ -3735,7 +3739,7 @@
},
"gpuPackMigration": {
"title": "Требуется повторная загрузка GPU-пакета",
- "description": "Обновление удалило устаревшую установку GPU-пакета ({{packs}}). Загрузите его заново в настройках, чтобы восстановить ускорение GPU."
+ "description": "Эта версия не может использовать прежний GPU-пакет ({{packs}}). Загрузите его заново в настройках, чтобы снова включить ускорение GPU."
},
"cleanupFailed": {
"title": "Не удалось выполнить очистку",
diff --git a/src/locales/zh-CN/translation.json b/src/locales/zh-CN/translation.json
index facad0808..11f3babf7 100644
--- a/src/locales/zh-CN/translation.json
+++ b/src/locales/zh-CN/translation.json
@@ -3664,6 +3664,10 @@
"activationFailedDescription": "OpenWhispr 已切换为 CPU 转录。",
"reasoningActivationFailedDescription": "OpenWhispr 已切换为 CPU 处理。",
"retryActivation": "重试 GPU 加速",
+ "redownloadNeeded": "需要重新下载 GPU 加速包",
+ "redownloadNeededDescription": "此版本的 OpenWhispr 无法使用已安装的 GPU 加速包。请重新下载以重新启用 GPU 加速。",
+ "redownloadButton": "重新下载 GPU 加速包",
+ "downloadFailed": "无法下载 GPU 加速包。",
"remove": "移除",
"dismiss": "暂不启用",
"cancel": "取消"
@@ -3691,7 +3695,7 @@
},
"gpuPackMigration": {
"title": "需要重新下载 GPU 加速包",
- "description": "更新移除了过时的 GPU 加速包安装({{packs}})。请在设置中重新下载以恢复 GPU 加速。"
+ "description": "此版本无法使用之前的 GPU 加速包({{packs}})。请在设置中重新下载以重新启用 GPU 加速。"
},
"cleanupFailed": {
"title": "清理失败",
diff --git a/src/locales/zh-TW/translation.json b/src/locales/zh-TW/translation.json
index b19ec76bc..d9ab5f5c1 100644
--- a/src/locales/zh-TW/translation.json
+++ b/src/locales/zh-TW/translation.json
@@ -3664,6 +3664,10 @@
"activationFailedDescription": "OpenWhispr 已切換為 CPU 轉錄。",
"reasoningActivationFailedDescription": "OpenWhispr 已切換為 CPU 處理。",
"retryActivation": "重試 GPU 加速",
+ "redownloadNeeded": "需要重新下載 GPU 加速包",
+ "redownloadNeededDescription": "此版本的 OpenWhispr 無法使用已安裝的 GPU 加速包。請重新下載以重新啟用 GPU 加速。",
+ "redownloadButton": "重新下載 GPU 加速包",
+ "downloadFailed": "無法下載 GPU 加速包。",
"remove": "移除",
"dismiss": "暫時不要",
"cancel": "取消"
@@ -3691,7 +3695,7 @@
},
"gpuPackMigration": {
"title": "需要重新下載 GPU 加速包",
- "description": "更新移除了過時的 GPU 加速包安裝({{packs}})。請在設定中重新下載以恢復 GPU 加速。"
+ "description": "此版本無法使用先前的 GPU 加速包({{packs}})。請在設定中重新下載以重新啟用 GPU 加速。"
},
"cleanupFailed": {
"title": "清理失敗",
diff --git a/src/types/electron.ts b/src/types/electron.ts
index 68524f713..ada25ccc6 100644
--- a/src/types/electron.ts
+++ b/src/types/electron.ts
@@ -755,6 +755,8 @@ export interface CudaWhisperStatus {
gpuInfo: GpuInfo;
/** CUDA fell back to CPU on this machine and stays off until retried. */
gpuFailed?: boolean;
+ /** An older release installed the pack and this version can't use it. */
+ needsUpdate?: boolean;
}
export interface VulkanWhisperStatus {
@@ -764,6 +766,8 @@ export interface VulkanWhisperStatus {
hasNvidiaGpu: boolean;
/** Vulkan fell back to CPU on this machine and stays off until retried. */
gpuFailed?: boolean;
+ /** An older release installed the pack and this version can't use it. */
+ needsUpdate?: boolean;
}
export interface WhisperServerStatus {
diff --git a/src/utils/whisperGpuPack.ts b/src/utils/whisperGpuPack.ts
new file mode 100644
index 000000000..e5c5790cc
--- /dev/null
+++ b/src/utils/whisperGpuPack.ts
@@ -0,0 +1,28 @@
+import type { CudaWhisperStatus, VulkanWhisperStatus } from "../types/electron";
+
+export type WhisperGpuBackend = "cuda" | "vulkan";
+
+// Which pack the transcription GPU card describes. A working pack comes first,
+// CUDA before Vulkan as the resolver prefers it, so a working Vulkan setup is
+// never re-prompted to download the CUDA pack. Next comes a pack an older
+// release installed that this version can't use (#2424): the startup notice
+// names it, so the card offers its re-download even when GPU detection no
+// longer sees the GPU (RDP, a VM, a failed nvidia-smi). Last, a first-time
+// offer. Cards below the CUDA build's kernel floor (e.g. Maxwell) crash at the
+// first kernel launch, so they are never offered the CUDA pack and get the
+// Vulkan pack like AMD/Intel GPUs.
+export function pickWhisperGpuBackend(
+ cuda: CudaWhisperStatus | null | undefined,
+ vulkan: VulkanWhisperStatus | null | undefined
+): WhisperGpuBackend | null {
+ const cudaEligible = !!cuda?.gpuInfo.hasNvidiaGpu && !!cuda.gpuInfo.cudaSupported;
+ const cudaBelowFloor = !!cuda?.gpuInfo.hasNvidiaGpu && !cuda.gpuInfo.cudaSupported;
+ const vulkanAvailable = !!vulkan?.vulkan.available;
+ if (cudaEligible && cuda?.downloaded) return "cuda";
+ if (vulkanAvailable && vulkan?.downloaded) return "vulkan";
+ if (cuda?.needsUpdate && !cudaBelowFloor) return "cuda";
+ if (vulkan?.needsUpdate) return "vulkan";
+ if (cudaEligible) return "cuda";
+ if (vulkanAvailable) return "vulkan";
+ return null;
+}
diff --git a/test/helpers/gpuBinaryManager.test.js b/test/helpers/gpuBinaryManager.test.js
index d20493579..085ca24d5 100644
--- a/test/helpers/gpuBinaryManager.test.js
+++ b/test/helpers/gpuBinaryManager.test.js
@@ -468,6 +468,39 @@ test("Windows whisper GPU packs require every app-local MSVC runtime library", (
}
});
+test("needs update: a binary without the libraries this version requires is outdated, not missing", () => {
+ const manager = requiredLibrariesManager();
+ assert.equal(manager.needsUpdate(), false, "nothing on disk is a pack never downloaded");
+
+ const packDir = seedPack("test-pack", ["server-out"]);
+ assert.equal(manager.needsUpdate(), true);
+ assert.equal(manager.isDownloaded(), false);
+
+ fs.writeFileSync(path.join(packDir, "msvcp140.dll"), "runtime");
+ fs.writeFileSync(path.join(packDir, "vcruntime140.dll"), "runtime");
+ assert.equal(manager.needsUpdate(), false);
+ assert.equal(manager.isDownloaded(), true);
+});
+
+test("needs update: a 1.9.x Windows CUDA pack (whisper.cpp 0.0.9, no MSVC runtime) is outdated (#2424)", () => {
+ const manager = useWindowsAsset(new WhisperCudaManager());
+ seedPack(manager.config.dirName, [
+ "whisper-server-win32-x64-cuda.exe",
+ "cublas64_12.dll",
+ "cublasLt64_12.dll",
+ "cudart64_12.dll",
+ ]);
+ assert.equal(manager.isDownloaded(), false);
+ assert.equal(manager.needsUpdate(), true);
+});
+
+test("needs update: a pack with no required libraries is never outdated", () => {
+ seedPack("whisper-cuda", ["whisper-server-linux-x64-cuda"]);
+ const manager = new WhisperCudaManager();
+ assert.equal(manager.isDownloaded(), true);
+ assert.equal(manager.needsUpdate(), false);
+});
+
test("Windows whisper Vulkan installs the MSVC runtime libraries from its release archive", async () => {
const manager = useWindowsAsset(new WhisperVulkanManager());
manager.config.expectedDigests = undefined;
@@ -603,6 +636,58 @@ test("orphan detection: enabled flag with no pack on disk is reported for the no
}
});
+test("outdated detection: an outdated pack is reported apart from orphans, unless opted out", () => {
+ const { detectOrphanedGpuPacks, detectOutdatedGpuPacks } = GpuBinaryManager;
+ const cuda = useWindowsAsset(new WhisperCudaManager());
+ const packs = [{ manager: cuda, enabledEnvVar: "WHISPER_CUDA_ENABLED" }];
+ seedPack(cuda.config.dirName, ["whisper-server-win32-x64-cuda.exe"]);
+
+ try {
+ process.env.WHISPER_CUDA_ENABLED = "true";
+ assert.deepEqual(detectOutdatedGpuPacks(packs), ["CUDA whisper"]);
+ assert.deepEqual(detectOrphanedGpuPacks(packs), [], "on disk, so not an orphan");
+
+ // A pack on disk is wanted even when the .env flag was lost (#1340)
+ delete process.env.WHISPER_CUDA_ENABLED;
+ assert.deepEqual(detectOutdatedGpuPacks(packs), ["CUDA whisper"]);
+
+ process.env.WHISPER_CUDA_ENABLED = "FALSE";
+ assert.deepEqual(detectOutdatedGpuPacks(packs), []);
+ } finally {
+ delete process.env.WHISPER_CUDA_ENABLED;
+ }
+});
+
+test("outdated detection: an outdated pack beside a working one for the same engine is not reported", () => {
+ const { detectOutdatedGpuPacks } = GpuBinaryManager;
+ const cuda = useWindowsAsset(new WhisperCudaManager());
+ const vulkan = useWindowsAsset(new WhisperVulkanManager());
+ const ungrouped = [
+ { manager: cuda, enabledEnvVar: "WHISPER_CUDA_ENABLED" },
+ { manager: vulkan, enabledEnvVar: "WHISPER_VULKAN_ENABLED" },
+ ];
+ const grouped = ungrouped.map((pack) => ({ ...pack, group: "whisper" }));
+
+ // CUDA re-downloaded, the Vulkan pack from 1.9.x left behind
+ seedPack(cuda.config.dirName, [
+ "whisper-server-win32-x64-cuda.exe",
+ ...WINDOWS_MSVC_RUNTIME_LIBRARIES,
+ ]);
+ seedPack(vulkan.config.dirName, ["whisper-server-win32-x64-vulkan.exe"]);
+ assert.deepEqual(detectOutdatedGpuPacks(grouped), []);
+ assert.deepEqual(detectOutdatedGpuPacks(ungrouped), ["Vulkan whisper"]);
+
+ // Both outdated: both are reported
+ fs.rmSync(path.join(cuda.binDir, "vcruntime140.dll"));
+ assert.deepEqual(detectOutdatedGpuPacks(grouped), ["CUDA whisper", "Vulkan whisper"]);
+
+ // And the mirror: Vulkan re-downloaded, CUDA left behind
+ for (const library of WINDOWS_MSVC_RUNTIME_LIBRARIES) {
+ fs.writeFileSync(path.join(vulkan.binDir, library), "x");
+ }
+ assert.deepEqual(detectOutdatedGpuPacks(grouped), []);
+});
+
test("getStatus reflects supported/downloaded/downloading", async () => {
const manager = new WhisperVulkanManager();
assert.deepEqual(manager.getStatus(), {
diff --git a/test/helpers/gpuPackMigrationNotice.test.js b/test/helpers/gpuPackMigrationNotice.test.js
index aac42dc6c..3c1b0940e 100644
--- a/test/helpers/gpuPackMigrationNotice.test.js
+++ b/test/helpers/gpuPackMigrationNotice.test.js
@@ -62,6 +62,30 @@ test("recordOnce does not re-record a pack already noticed via record", () => {
assert.equal(notice.read(), null);
});
+test("recordOnce with an occasion notices again per occasion, apart from the orphan notice", () => {
+ // Already told once as an orphan (e.g. by the 1.8.3 migration)
+ notice.recordOnce(["CUDA whisper"]);
+ notice.clear();
+
+ // An update makes the pack unusable: that still gets its notice
+ notice.recordOnce(["CUDA whisper"], "outdated-1.10.0");
+ assert.deepEqual(notice.read(), { packs: ["CUDA whisper"] });
+
+ // Once per occasion, surviving a dismissal
+ notice.clear();
+ notice.recordOnce(["CUDA whisper"], "outdated-1.10.0");
+ assert.equal(notice.read(), null);
+
+ // The next version tells the user again while the pack is still unusable
+ notice.recordOnce(["CUDA whisper"], "outdated-1.10.1");
+ assert.deepEqual(notice.read(), { packs: ["CUDA whisper"] });
+
+ // The plain orphan notice keeps its own once
+ notice.clear();
+ notice.recordOnce(["CUDA whisper"]);
+ assert.equal(notice.read(), null);
+});
+
test("empty recordings and corrupt sentinels read as no notice", () => {
notice.record([]);
assert.equal(notice.read(), null);
diff --git a/test/utils/whisperGpuPack.test.js b/test/utils/whisperGpuPack.test.js
new file mode 100644
index 000000000..65982902d
--- /dev/null
+++ b/test/utils/whisperGpuPack.test.js
@@ -0,0 +1,75 @@
+const test = require("node:test");
+const assert = require("node:assert/strict");
+
+const load = () => import("../../src/utils/whisperGpuPack.ts");
+
+const NVIDIA = { hasNvidiaGpu: true, cudaSupported: true };
+const BELOW_FLOOR = { hasNvidiaGpu: true, cudaSupported: false };
+const NO_NVIDIA = { hasNvidiaGpu: false, cudaSupported: false };
+
+const cuda = (gpuInfo, pack = {}) => ({
+ downloaded: false,
+ downloading: false,
+ path: null,
+ gpuInfo,
+ ...pack,
+});
+const vulkan = (available, pack = {}) => ({
+ downloaded: false,
+ downloading: false,
+ vulkan: { available },
+ hasNvidiaGpu: false,
+ ...pack,
+});
+const DOWNLOADED = { downloaded: true };
+const OUTDATED = { needsUpdate: true };
+
+test("packs that aren't outdated keep the card's earlier choice", async () => {
+ const { pickWhisperGpuBackend } = await load();
+ const cases = [
+ [cuda(NVIDIA, DOWNLOADED), vulkan(true, DOWNLOADED), "cuda"],
+ [cuda(NVIDIA), vulkan(true, DOWNLOADED), "vulkan"],
+ [cuda(NVIDIA), vulkan(true), "cuda"],
+ [cuda(NVIDIA), vulkan(false), "cuda"],
+ [cuda(BELOW_FLOOR), vulkan(true), "vulkan"],
+ [cuda(NO_NVIDIA), vulkan(true, DOWNLOADED), "vulkan"],
+ [cuda(NO_NVIDIA), vulkan(false), null],
+ [null, null, null],
+ ];
+ for (const [cudaStatus, vulkanStatus, expected] of cases) {
+ assert.equal(
+ pickWhisperGpuBackend(cudaStatus, vulkanStatus),
+ expected,
+ JSON.stringify({ cudaStatus, vulkanStatus })
+ );
+ }
+});
+
+test("a working pack wins over an outdated one", async () => {
+ const { pickWhisperGpuBackend } = await load();
+ assert.equal(pickWhisperGpuBackend(cuda(NVIDIA, DOWNLOADED), vulkan(true, OUTDATED)), "cuda");
+ assert.equal(pickWhisperGpuBackend(cuda(NVIDIA, OUTDATED), vulkan(true, DOWNLOADED)), "vulkan");
+});
+
+test("an outdated pack wins over a first-time offer (#2424)", async () => {
+ const { pickWhisperGpuBackend } = await load();
+ assert.equal(pickWhisperGpuBackend(cuda(NVIDIA), vulkan(true, OUTDATED)), "vulkan");
+ assert.equal(pickWhisperGpuBackend(cuda(NVIDIA, OUTDATED), vulkan(true, OUTDATED)), "cuda");
+ assert.equal(pickWhisperGpuBackend(cuda(NO_NVIDIA, OUTDATED), vulkan(true)), "cuda");
+});
+
+test("an outdated pack is offered even when GPU detection no longer sees the GPU", async () => {
+ const { pickWhisperGpuBackend } = await load();
+ // NVIDIA card, but Chromium reports no Vulkan GPU (RDP, a VM, software rendering)
+ assert.equal(pickWhisperGpuBackend(cuda(NVIDIA), vulkan(false, OUTDATED)), "vulkan");
+ // nvidia-smi failed and there is no Vulkan GPU either
+ assert.equal(pickWhisperGpuBackend(cuda(NO_NVIDIA, OUTDATED), vulkan(false)), "cuda");
+ // Once that Vulkan pack is re-downloaded the card still has something to show
+ assert.equal(pickWhisperGpuBackend(cuda(NVIDIA), vulkan(false, DOWNLOADED)), "cuda");
+});
+
+test("a card below the CUDA kernel floor is never offered the CUDA pack", async () => {
+ const { pickWhisperGpuBackend } = await load();
+ assert.equal(pickWhisperGpuBackend(cuda(BELOW_FLOOR, OUTDATED), vulkan(true)), "vulkan");
+ assert.equal(pickWhisperGpuBackend(cuda(BELOW_FLOOR, OUTDATED), vulkan(false)), null);
+});