Skip to content

Commit 6068dd2

Browse files
ci(windows-cuda): build with -CpuArch avx2 to match upstream's 'balance' profile
Without an explicit -CpuArch, windows-cuda-release defaults to native CPU codegen tuned to the GitHub Actions runner, which can differ from the target machine (e.g. Ryzen 5700X: Zen 3, AVX2-only, no AVX512) and crash at startup. avx2 matches package_windows_prebuilt.ps1's own 'balance' profile, the recommended default for broad compatibility.
1 parent f5c5a15 commit 6068dd2

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/windows-cuda-build.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,20 @@ jobs:
7373
"CUDA_ARCHITECTURES=$arch" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
7474
Write-Host "Building for CUDA architectures: $arch"
7575
76+
# CpuArch avx2 = the "balance" profile from package_windows_prebuilt.ps1's
77+
# own definitions: AVX2-class CPU kernels, no native/AVX512 tuning to the
78+
# GitHub runner's specific CPU. Without this, the preset defaults to
79+
# native (-march=native on the RUNNER), which can bake in instructions
80+
# (e.g. AVX512) the target machine's CPU (Ryzen 5700X: Zen 3, AVX2-only,
81+
# no AVX512) doesn't have, causing an illegal-instruction crash at
82+
# startup instead of just being slower.
7683
- name: Build audiocpp_cli
7784
shell: pwsh
7885
run: |
7986
.\scripts\build_windows.ps1 `
8087
-Preset windows-cuda-release `
8188
-CudaArchitectures $env:CUDA_ARCHITECTURES `
89+
-CpuArch avx2 `
8290
-Target audiocpp_cli
8391
8492
- name: Build audiocpp_server
@@ -87,6 +95,7 @@ jobs:
8795
.\scripts\build_windows.ps1 `
8896
-Preset windows-cuda-release `
8997
-CudaArchitectures $env:CUDA_ARCHITECTURES `
98+
-CpuArch avx2 `
9099
-Target audiocpp_server
91100
92101
- name: Build audiocpp_gguf
@@ -95,6 +104,7 @@ jobs:
95104
.\scripts\build_windows.ps1 `
96105
-Preset windows-cuda-release `
97106
-CudaArchitectures $env:CUDA_ARCHITECTURES `
107+
-CpuArch avx2 `
98108
-Target audiocpp_gguf
99109
100110
- name: Collect binaries

0 commit comments

Comments
 (0)