Skip to content

Commit

Permalink
feat: special builds with vulkan
Browse files Browse the repository at this point in the history
  • Loading branch information
thewh1teagle committed Aug 22, 2024
1 parent 9c032a8 commit 4bfa360
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 46 deletions.
32 changes: 12 additions & 20 deletions .github/workflows/linux_special.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,13 @@ jobs:
rust-version: "stable"
name: "ubuntu-22.04"

# Ubuntu 24.04
- platform: "ubuntu-24.04"
args: '--features "vulkan"'
pre-build-args: "--vulkan"
rust-version: "stable"
name: "ubuntu-24.04"


# Ubuntu 22.04 cuda
- platform: "ubuntu-22.04"
args: '--features "cuda"'
pre-build-args: "--cuda"
rust-version: "stable"
cuda-version: "12.4.1"
name: "ubuntu-22.04-nvidia-12"
# - platform: "ubuntu-22.04"
# args: '--features "cuda"'
# pre-build-args: "--cuda"
# rust-version: "stable"
# cuda-version: "12.4.1"
# name: "ubuntu-22.04-nvidia-12"

# Ubuntu 24.04 cuda
# https://github.com/Jimver/cuda-toolkit/issues/365
Expand All @@ -48,12 +40,12 @@ jobs:
# name: "ubuntu-24.04-nvidia-12"

# Ubuntu 22.04 rocm
- platform: "ubuntu-22.04"
args: '--features "rocm"'
rocm-version: "6.1.2"
pre-build-args: "--rocm"
rust-version: "stable"
name: "ubuntu-24.04-rocm-6.1.2"
# - platform: "ubuntu-22.04"
# args: '--features "rocm"'
# rocm-version: "6.1.2"
# pre-build-args: "--rocm"
# rust-version: "stable"
# name: "ubuntu-24.04-rocm-6.1.2"

runs-on: ${{ matrix.platform }}
steps:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ jobs:
args: "--target aarch64-apple-darwin"
- platform: "macos-latest" # for Intel based macs.
args: "--target x86_64-apple-darwin"
- platform: "ubuntu-24.04" # Ubuntu x86_64
- platform: "ubuntu-24.04" # Ubuntu 24.04 x86_64
args: '--features "vulkan"'
pre-build-args: "--vulkan"
- platform: "ubuntu-22.04" # Ubuntu 22.04 x86_64
args: '--features "vulkan"'
pre-build-args: "--vulkan"
- platform: "windows-latest" # Windows x86_64
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/windows_special.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ jobs:
name: "older-cpu"
rust-version: "stable"

# Windows cuda 12.5.0
- platform: "windows-latest"
args: '--features="cuda"'
pre-build-args: "--cuda"
name: 'nvidia-12.5.0'
cuda-verison: '12.5.0'
rust-version: "stable"
# # Windows cuda 12.5.0
# - platform: "windows-latest"
# args: '--features="cuda"'
# pre-build-args: "--cuda"
# name: 'nvidia-12.5.0'
# cuda-verison: '12.5.0'
# rust-version: "stable"

# Windows cuda 11.8.0
- platform: "windows-latest"
args: '--features="cuda"'
pre-build-args: "--cuda"
name: 'nvidia-11.8.0'
cuda-verison: '11.8.0'
rust-version: "stable"
# - platform: "windows-latest"
# args: '--features="cuda"'
# pre-build-args: "--cuda"
# name: 'nvidia-11.8.0'
# cuda-verison: '11.8.0'
# rust-version: "stable"

# Windows portable
- platform: "windows-latest" # Windows x86_64
Expand Down
2 changes: 1 addition & 1 deletion desktop/src-tauri/src/cmd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ pub async fn load_model(app_handle: tauri::AppHandle, model_path: String, gpu_de

#[tauri::command]
pub fn is_portable() -> bool {
!env!("WINDOWS_PORTABLE").is_empty()
env!("WINDOWS_PORTABLE") == "1"
}

#[tauri::command]
Expand Down
21 changes: 10 additions & 11 deletions scripts/pre_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ if (!process.env.GITHUB_ENV) {
console.log(`$env:ROCM_VERSION = "6.1.2"`)
console.log(`$env:ROCM_PATH = "${rocmPath}"`)
}

if (hasFeature('portable')) {
console.log('$env:WINDOWS_PORTABLE=1')
}
}
if (platform == 'macos') {
console.log(`export FFMPEG_DIR="${exports.ffmpeg}"`)
Expand Down Expand Up @@ -270,23 +274,18 @@ if (process.env.GITHUB_ENV) {
console.log('Adding ENV', openblas)
await fs.appendFile(process.env.GITHUB_ENV, openblas)

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

const whisperStaticMsvc = 'WHISPER_USE_STATIC_MSVC=0\n'
console.log('Adding ENV', whisperStaticMsvc)
await fs.appendFile(process.env.GITHUB_ENV, whisperStaticMsvc)
}

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`)
await fs.appendFile(process.env.GITHUB_ENV, `WHISPER_NO_FMA=ON\n`)
await fs.appendFile(process.env.GITHUB_ENV, `WHISPER_NO_F16C=ON\n`)
}

if (hasFeature('portable')) {
const windowsPortable = 'WINDOWS_PORTABLE=1\n'
console.log('Adding ENV', windowsPortable)
await fs.appendFile(process.env.GITHUB_ENV, windowsPortable)
}
}
}

Expand Down

0 comments on commit 4bfa360

Please sign in to comment.