Skip to content

Commit

Permalink
fix: dynamic link msvc with cuda. for knf-rs + ort
Browse files Browse the repository at this point in the history
  • Loading branch information
thewh1teagle committed Aug 11, 2024
1 parent f6fabe1 commit 3a02898
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ glob = "0.3.1"
default = []
coreml = ["whisper-rs/coreml", "pyannote-rs/coreml"]
directml = ["pyannote-rs/directml"]
cuda = ["whisper-rs/cuda"]
cuda = ["whisper-rs/cuda", "pyannote-rs/load-dynamic"]
opencl = ["whisper-rs/opencl"]
openblas = ["whisper-rs/openblas"]
metal = ["whisper-rs/metal"]
Expand Down
8 changes: 8 additions & 0 deletions scripts/pre_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ if (!process.env.GITHUB_ENV) {
}
if (hasFeature('cuda')) {
console.log(`$env:CUDA_PATH = "${cudaPath}"`)
console.log(`$env:KNF_STATIC_CRT = "0"`)
}
if (hasFeature('opencl')) {
console.log(`$env:CLBlast_DIR = "${exports.clblast}"`)
Expand Down Expand Up @@ -294,6 +295,13 @@ if (process.env.GITHUB_ENV) {
await fs.appendFile(process.env.GITHUB_ENV, cmakeBuildType)
}

if (hasFeature('cuda')) {
// link msvc dynamic
const staticCrt = 'KNF_STATIC_CRT=0\n'
console.log('Adding ENV', staticCrt)
await fs.appendFile(process.env.GITHUB_ENV, staticCrt)
}

if (hasFeature('older-cpu')) {
await fs.appendFile(process.env.GITHUB_ENV, `WHISPER_NO_AVX=ON\n`)
await fs.appendFile(process.env.GITHUB_ENV, `WHISPER_NO_AVX2=ON\n`)
Expand Down

0 comments on commit 3a02898

Please sign in to comment.