From 8010b89923183f079b38b288eb56b25610a5e7f4 Mon Sep 17 00:00:00 2001 From: thewh1teagle <61390950+thewh1teagle@users.noreply.github.com> Date: Mon, 19 Aug 2024 12:22:42 +0300 Subject: [PATCH 1/5] add test whisper action --- .github/workflows/test_whisper.yml | 70 ++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/test_whisper.yml diff --git a/.github/workflows/test_whisper.yml b/.github/workflows/test_whisper.yml new file mode 100644 index 0000000..a5c92da --- /dev/null +++ b/.github/workflows/test_whisper.yml @@ -0,0 +1,70 @@ +name: Test whisper + +on: + workflow_dispatch: +jobs: + test: + permissions: + contents: write + strategy: + fail-fast: false + matrix: + include: + - platform: "macos-latest" # for Arm based macs (M1 and above). + name: "MacOS (Arm) - aarch64" + + - platform: "ubuntu-24.04" # Ubuntu x86_64 + name: "Ubuntu 24.04 - x86_64" + + - platform: "windows-latest" # Windows x86_64 + name: "Windows - x86_64" + + runs-on: ${{ matrix.platform }} + name: ${{ matrix.name }} + steps: + - uses: actions/checkout@v4 + with: + repository: 'ggerganov/whisper.cpp' + ref: 'fe36c909715e6751277ddb020e7892c7670b61d4' + + - name: Prepare Vulkan SDK for Windows + run: | + C:\msys64\usr\bin\wget.exe https://sdk.lunarg.com/sdk/download/1.3.290.0/windows/VulkanSDK-1.3.290.0-Installer.exe -O vulkan.exe + .\vulkan.exe --root C:\vulkan --accept-licenses --default-answer --confirm-command install + echo "VULKAN_SDK=C:\vulkan" >> $env:GITHUB_ENV + if: contains(matrix.platform, 'windows') + + - name: Prepare Vulkan SDK for Linux + run: | + wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc + sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-noble.list http://packages.lunarg.com/vulkan/lunarg-vulkan-noble.list + sudo apt update + sudo apt install vulkan-sdk -y + if: contains(matrix.platform, 'ubuntu') + + - name: Download assets on Windows + if: contains(matrix.platform, 'windows') + run: | + C:\msys64\usr\bin\wget.exe https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-tiny.bin + C:\msys64\usr\bin\wget.exe https://github.com/thewh1teagle/vibe/raw/main/samples/short.wav + + - name: Download assets on Linux + if: contains(matrix.platform, 'windows') == false + run: | + wget https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-tiny.bin + wget https://github.com/thewh1teagle/vibe/raw/main/samples/short.wav + + - name: Build + run: | + cmake -B build -DGGML_VULKAN=ON -DGGML_CCACHE=OFF -DCMAKE_BUILD_TYPE=Release -DGGML_STATIC=ON + cmake --build build --config Release + + - name: Test Windows + if: contains(matrix.platform, 'windows') + run: | + .\build\bin\Release\main -m ggml-tiny.ggml -f short.wav + + - name: Test Unix + if: ${{ contains(matrix.platform, 'ubuntu') || contains(matrix.platform, 'macos') }} + run: | + ./build/bin/main -m ggml-tiny.ggml -f short.wav From 3e6f43aedac650e40b6fd3d10b8c8a5c04ba98ef Mon Sep 17 00:00:00 2001 From: thewh1teagle <61390950+thewh1teagle@users.noreply.github.com> Date: Thu, 22 Aug 2024 05:08:38 +0300 Subject: [PATCH 2/5] misc --- BUILDING.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/BUILDING.md b/BUILDING.md index 58f6029..5c60790 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -26,6 +26,12 @@ sudo apt-get install -y pkg-config build-essential libglib2.0-dev libgtk-3-dev l sudo apt-get install -y libavutil-dev libavformat-dev libavfilter-dev libavdevice-dev # ffmpeg ``` +_Vulkan_ + +```console +sudo apt-get install -y mesa-vulkan-drivers +``` + ## Build Install dependencies from `desktop` folder From 3fb8581d3eff0ced1b1fc097435913b1cd0f92e3 Mon Sep 17 00:00:00 2001 From: thewh1teagle <61390950+thewh1teagle@users.noreply.github.com> Date: Thu, 22 Aug 2024 05:08:44 +0300 Subject: [PATCH 3/5] misc --- .vscode/extensions.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 12fcabc..42c23bd 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -7,6 +7,7 @@ "dbaeumer.vscode-eslint", // Integrates ESLint JavaScript into VS Code "esbenp.prettier-vscode", // Code formatter using prettier, "lokalise.i18n-ally", - "svelte.svelte-vscode" // i18n-ally is an all-in-one i18n (internationalization) extension for VS Code + "svelte.svelte-vscode", + "tamasfe.even-better-toml" // i18n-ally is an all-in-one i18n (internationalization) extension for VS Code ] } From 7a242a216812da4a5da12c353be054bbc397f637 Mon Sep 17 00:00:00 2001 From: thewh1teagle <61390950+thewh1teagle@users.noreply.github.com> Date: Thu, 22 Aug 2024 05:08:51 +0300 Subject: [PATCH 4/5] update whisper --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6e509b5..4bef7c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2682,7 +2682,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -6590,7 +6590,7 @@ dependencies = [ [[package]] name = "whisper-rs" version = "0.13.0" -source = "git+https://github.com/thewh1teagle/whisper-rs.git?branch=v1.6.3-beta.0#fb2301b7ae71a036680362c484525fedb2b37a0e" +source = "git+https://github.com/thewh1teagle/whisper-rs.git?branch=v1.6.3-beta.0#2ccf3362745da2ba6c613b157591a609508c4c74" dependencies = [ "tracing", "whisper-rs-sys", @@ -6599,7 +6599,7 @@ dependencies = [ [[package]] name = "whisper-rs-sys" version = "0.11.0" -source = "git+https://github.com/thewh1teagle/whisper-rs.git?branch=v1.6.3-beta.0#fb2301b7ae71a036680362c484525fedb2b37a0e" +source = "git+https://github.com/thewh1teagle/whisper-rs.git?branch=v1.6.3-beta.0#2ccf3362745da2ba6c613b157591a609508c4c74" dependencies = [ "bindgen", "cfg-if", From 1ba474da92a5d50d44dd779e87975ca967538129 Mon Sep 17 00:00:00 2001 From: thewh1teagle <61390950+thewh1teagle@users.noreply.github.com> Date: Thu, 22 Aug 2024 05:19:23 +0300 Subject: [PATCH 5/5] install vulkan manually --- .github/workflows/linux_special.yml | 25 +++++++++++++++++-------- .github/workflows/release.yml | 23 ++++++++++++++++------- .github/workflows/windows_special.yml | 23 ++++++++++++++++------- 3 files changed, 49 insertions(+), 22 deletions(-) diff --git a/.github/workflows/linux_special.yml b/.github/workflows/linux_special.yml index ca3aee8..e5b6543 100644 --- a/.github/workflows/linux_special.yml +++ b/.github/workflows/linux_special.yml @@ -76,13 +76,22 @@ jobs: docker-images: true swap-storage: true - - name: Prepare Vulkan SDK - uses: humbletim/setup-vulkan-sdk@v1.2.0 - with: - vulkan-query-version: 1.3.290.0 - vulkan-components: Vulkan-Headers, Vulkan-Loader - vulkan-use-cache: true - if: contains(matrix.args, 'vulkan') + - name: Prepare Vulkan SDK for Windows + run: | + C:\msys64\usr\bin\wget.exe https://sdk.lunarg.com/sdk/download/1.3.290.0/windows/VulkanSDK-1.3.290.0-Installer.exe -O vulkan.exe + .\vulkan.exe --root C:\vulkan --accept-licenses --default-answer --confirm-command install + echo "VULKAN_SDK=C:\vulkan" >> $env:GITHUB_ENV + Copy-Item -Path "C:\vulkan\Bin\*.dll" -Destination "." -Recurse + if: ${{ contains(matrix.platform, 'windows') && contains(matrix.args, 'vulkan') }} + + - name: Prepare Vulkan SDK for Linux + run: | + wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc + sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-noble.list http://packages.lunarg.com/vulkan/lunarg-vulkan-noble.list + sudo apt update + sudo apt install vulkan-sdk -y + sudo apt-get install -y mesa-vulkan-drivers + if: ${{ contains(matrix.platform, 'ubuntu') && contains(matrix.args, 'vulkan') }} - name: Install rocm if: contains(matrix.args, 'rocm') @@ -169,4 +178,4 @@ jobs: bun scripts/publish.js target/release/bundle/deb/*.deb bun scripts/publish.js target/release/bundle/rpm/*.rpm env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5d7c15c..507c04d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,13 +45,22 @@ jobs: run: bun install working-directory: ./desktop - - name: Prepare Vulkan SDK - uses: humbletim/setup-vulkan-sdk@v1.2.0 - with: - vulkan-query-version: 1.3.290.0 - vulkan-components: Vulkan-Headers, Vulkan-Loader - vulkan-use-cache: true - if: contains(matrix.args, 'vulkan') + - name: Prepare Vulkan SDK for Windows + run: | + C:\msys64\usr\bin\wget.exe https://sdk.lunarg.com/sdk/download/1.3.290.0/windows/VulkanSDK-1.3.290.0-Installer.exe -O vulkan.exe + .\vulkan.exe --root C:\vulkan --accept-licenses --default-answer --confirm-command install + echo "VULKAN_SDK=C:\vulkan" >> $env:GITHUB_ENV + Copy-Item -Path "C:\vulkan\Bin\*.dll" -Destination "." -Recurse + if: ${{ contains(matrix.platform, 'windows') && contains(matrix.args, 'vulkan') }} + + - name: Prepare Vulkan SDK for Linux + run: | + wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc + sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-noble.list http://packages.lunarg.com/vulkan/lunarg-vulkan-noble.list + sudo apt update + sudo apt install vulkan-sdk -y + sudo apt-get install -y mesa-vulkan-drivers + if: ${{ contains(matrix.platform, 'ubuntu') && contains(matrix.args, 'vulkan') }} # Run pre build - name: Run pre_build.js on ${{ matrix.platform }} diff --git a/.github/workflows/windows_special.yml b/.github/workflows/windows_special.yml index 60567b4..da822fb 100644 --- a/.github/workflows/windows_special.yml +++ b/.github/workflows/windows_special.yml @@ -57,13 +57,22 @@ jobs: - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v2 - - name: Prepare Vulkan SDK - uses: humbletim/setup-vulkan-sdk@v1.2.0 - with: - vulkan-query-version: 1.3.290.0 - vulkan-components: Vulkan-Headers, Vulkan-Loader - vulkan-use-cache: true - if: contains(matrix.args, 'vulkan') + - name: Prepare Vulkan SDK for Windows + run: | + C:\msys64\usr\bin\wget.exe https://sdk.lunarg.com/sdk/download/1.3.290.0/windows/VulkanSDK-1.3.290.0-Installer.exe -O vulkan.exe + .\vulkan.exe --root C:\vulkan --accept-licenses --default-answer --confirm-command install + echo "VULKAN_SDK=C:\vulkan" >> $env:GITHUB_ENV + Copy-Item -Path "C:\vulkan\Bin\*.dll" -Destination "." -Recurse + if: ${{ contains(matrix.platform, 'windows') && contains(matrix.args, 'vulkan') }} + + - name: Prepare Vulkan SDK for Linux + run: | + wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc + sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-noble.list http://packages.lunarg.com/vulkan/lunarg-vulkan-noble.list + sudo apt update + sudo apt install vulkan-sdk -y + sudo apt-get install -y mesa-vulkan-drivers + if: ${{ contains(matrix.platform, 'ubuntu') && contains(matrix.args, 'vulkan') }} - name: Setup CUDA Toolkit if: contains(matrix.args, 'cuda')