Skip to content

fix: CUDA and Vulkan binary download failures on Windows#379

Merged
gabrielste1n merged 3 commits intoOpenWhispr:mainfrom
egsok:fix/cuda-vulkan-download-windows
Mar 11, 2026
Merged

fix: CUDA and Vulkan binary download failures on Windows#379
gabrielste1n merged 3 commits intoOpenWhispr:mainfrom
egsok:fix/cuda-vulkan-download-windows

Conversation

@egsok
Copy link
Copy Markdown
Contributor

@egsok egsok commented Mar 6, 2026

Summary

Fixes CUDA and Vulkan GPU acceleration binaries failing to download/activate on Windows systems where the PowerShell Microsoft.PowerShell.Archive module cannot load.

Root cause: Expand-Archive relies on Microsoft.PowerShell.Archive which fails to auto-load on some Windows configurations, silently breaking all zip extraction in both WhisperCudaManager and LlamaVulkanManager.

Additional issues fixed:

  • After successful CUDA/Vulkan download, the running whisper/llama server was not restarted, so the CPU binary continued to be used until app restart
  • CUDA downloads had no concurrent download guard, allowing multiple parallel downloads from rapid UI clicks
  • CUDA download errors were silently swallowed with no logging

Changes

src/helpers/whisperCudaManager.js

  • Replace Expand-Archive with tar.exe (built into Windows 10+), falling back to PowerShell if tar is unavailable
  • Add recursive _findFile()/_findFiles() for binary search in extracted archives (matches existing LlamaVulkanManager pattern)
  • Add _downloading flag to prevent concurrent downloads
  • Restructure try/finally so the download flag resets on any error

src/helpers/llamaVulkanManager.js

  • Replace Expand-Archive with tar.exe + PowerShell fallback (same fix)

src/helpers/ipcHandlers.js

  • Restart whisper-server after CUDA binary download/delete
  • Restart llama-server after Vulkan binary download
  • Add error logging for CUDA and Vulkan download failures
  • Add downloading state to CUDA status IPC response

Test plan

  • Download CUDA binary on Windows — verify extraction succeeds and GPU acceleration activates immediately
  • Download Vulkan binary on Windows — verify extraction succeeds and GPU acceleration activates immediately
  • Click download button rapidly — verify only one download runs at a time
  • Delete CUDA/Vulkan binary — verify server falls back to CPU binary
  • Cancel mid-download — verify clean state recovery
  • Verify Linux extraction (unzip) still works unchanged

🤖 Generated with Claude Code

egsok and others added 3 commits March 6, 2026 17:46
- Replace PowerShell Expand-Archive with tar.exe for zip extraction
  (fallback to Expand-Archive if tar unavailable). Fixes systems where
  Microsoft.PowerShell.Archive module fails to load.
- Add recursive file search (_findFile/_findFiles) in CUDA manager
  to handle nested archive structures, matching LlamaVulkanManager pattern.
- Add concurrent download guard (_downloading flag) to prevent
  parallel CUDA downloads from multiple UI clicks.
- Restart whisper-server after CUDA download/delete so the correct
  binary is used without requiring app restart.
- Restart llama-server after Vulkan download so GPU acceleration
  activates immediately.
- Add error logging for CUDA and Vulkan download failures.
- Expose downloading state in CUDA status IPC response.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tion and ordering

- Move tar→PowerShell fallback extraction and recursive file search into
  downloadUtils.js to eliminate duplication across whisperCudaManager and
  llamaVulkanManager
- Convert sync readdirSync file search to async fsPromises.readdir
- Add isDownloading() getter to WhisperCudaManager instead of exposing
  _downloading directly
- Fix Vulkan download handler to persist env file before restarting server
@gabrielste1n gabrielste1n self-requested a review March 11, 2026 23:53
@gabrielste1n gabrielste1n merged commit d086e10 into OpenWhispr:main Mar 11, 2026
@gabrielste1n
Copy link
Copy Markdown
Collaborator

thank you sir @egsok !!

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