Skip to content

Commit fe21688

Browse files
braden-wBraden Wong
authored andcommitted
fix(windows): bundle vulkan-1.dll to fix startup crash
Windows users without the Vulkan runtime installed were experiencing "vulkan-1.dll not found" errors that prevented the app from starting. This affected systems without dedicated GPUs, VMs, and clean Windows installations. The fix bundles vulkan-1.dll from the Vulkan SDK during CI builds. Since Tauri places resources in a subdirectory rather than next to the exe, NSIS installer hooks move the DLL to the correct location after install. Once the DLL is present, whisper.cpp gracefully falls back to CPU transcription on systems without GPU/Vulkan drivers. Fixes #829, fixes #840
1 parent 087b8dd commit fe21688

File tree

5 files changed

+61
-0
lines changed

5 files changed

+61
-0
lines changed

.github/workflows/pr-preview-builds.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,18 @@ jobs:
9494
version: 1.4.309.0
9595
cache: true
9696

97+
# Bundle Vulkan DLL for Windows users without Vulkan runtime
98+
- name: Bundle Vulkan DLL (Windows)
99+
if: matrix.platform == 'windows-latest'
100+
shell: pwsh
101+
run: |
102+
$vulkanDll = "$env:VULKAN_SDK\Bin\vulkan-1.dll"
103+
$destination = "apps/whispering/src-tauri/vulkan-1.dll"
104+
Write-Host "Copying Vulkan DLL from: $vulkanDll"
105+
Write-Host "Copying Vulkan DLL to: $destination"
106+
Copy-Item $vulkanDll $destination
107+
Write-Host "Vulkan DLL bundled successfully"
108+
97109
- name: setup node
98110
uses: actions/setup-node@v4
99111
with:

.github/workflows/publish-tauri-releases.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,20 @@ jobs:
125125
version: 1.4.309.0
126126
cache: true
127127

128+
# Bundle Vulkan DLL for Windows users without Vulkan runtime
129+
# The DLL is placed in src-tauri where tauri.conf.json resources config picks it up
130+
# This fixes the "vulkan-1.dll not found" error on Windows systems without GPU/Vulkan drivers
131+
- name: Bundle Vulkan DLL (Windows)
132+
if: matrix.platform == 'windows-latest'
133+
shell: pwsh
134+
run: |
135+
$vulkanDll = "$env:VULKAN_SDK\Bin\vulkan-1.dll"
136+
$destination = "apps/whispering/src-tauri/vulkan-1.dll"
137+
Write-Host "Copying Vulkan DLL from: $vulkanDll"
138+
Write-Host "Copying Vulkan DLL to: $destination"
139+
Copy-Item $vulkanDll $destination
140+
Write-Host "Vulkan DLL bundled successfully"
141+
128142
# Setup Node.js for compatibility
129143
- name: setup node
130144
uses: actions/setup-node@v4

apps/whispering/src-tauri/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@
99
# Environment variables
1010
.env
1111
.env.local
12+
13+
# Vulkan DLL copied during CI build (not committed, generated from VULKAN_SDK)
14+
vulkan-1.dll
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
; Whispering NSIS Installer Hooks
2+
; This file is included by the Tauri NSIS installer to handle custom installation tasks
3+
4+
; NSIS_HOOK_POSTINSTALL
5+
; Called after all files are installed to $INSTDIR
6+
; We need to move vulkan-1.dll from resources/ to the exe directory
7+
; because Windows needs DLLs next to the executable for load-time linking
8+
!macro NSIS_HOOK_POSTINSTALL
9+
; Check if the DLL exists in resources and copy it to exe directory
10+
${If} ${FileExists} "$INSTDIR\resources\vulkan-1.dll"
11+
CopyFiles /SILENT "$INSTDIR\resources\vulkan-1.dll" "$INSTDIR\vulkan-1.dll"
12+
Delete "$INSTDIR\resources\vulkan-1.dll"
13+
${EndIf}
14+
!macroend
15+
16+
; NSIS_HOOK_POSTUNINSTALL
17+
; Called after uninstallation to clean up any remaining files
18+
!macro NSIS_HOOK_POSTUNINSTALL
19+
; Clean up the DLL if it exists
20+
Delete "$INSTDIR\vulkan-1.dll"
21+
!macroend
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://schema.tauri.app/config/2",
3+
"bundle": {
4+
"resources": ["vulkan-1.dll"],
5+
"windows": {
6+
"nsis": {
7+
"installerHooks": "nsis/installer-hooks.nsh"
8+
}
9+
}
10+
}
11+
}

0 commit comments

Comments
 (0)