From a31671f9511825f7f20f55b01afbd4ddbe723f14 Mon Sep 17 00:00:00 2001 From: Neko Ayaka Date: Wed, 9 Jul 2025 16:37:31 +0800 Subject: [PATCH] feat(ci): try to have CUDA Toolkit for compiling and building --- .github/workflows/release-tamagotchi.yml | 11 +++++++++- apps/stage-tamagotchi/src-tauri/Cargo.toml | 25 +++++++++++++++------- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release-tamagotchi.yml b/.github/workflows/release-tamagotchi.yml index 08478b9fc..a5bade80e 100644 --- a/.github/workflows/release-tamagotchi.yml +++ b/.github/workflows/release-tamagotchi.yml @@ -77,15 +77,24 @@ jobs: sudo apt-get update sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf + - name: Install CUDA Toolkit (Linux and Windows Only) + uses: Jimver/cuda-toolkit@v0.2.24 + if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm' || matrix.os == 'windows-latest' + with: + cuda: 12.5.0 + - name: Install dependencies run: pnpm install --frozen-lockfile - name: Build Dependencies run: pnpm run build:packages - - name: Build Application + - name: Build Application (macOS Only) run: cd apps/stage-tamagotchi && pnpm tauri build --target ${{ matrix.target }} + - name: Build Application (Linux and Windows Only) + run: cd apps/stage-tamagotchi && pnpm tauri build --target ${{ matrix.target }} --features cuda + - name: Rename Artifacts (Nightly) if: ${{ github.event_name == 'schedule' }} run: pnpm run -F @proj-airi/stage-tamagotchi rename-artifacts ${{ matrix.target }} diff --git a/apps/stage-tamagotchi/src-tauri/Cargo.toml b/apps/stage-tamagotchi/src-tauri/Cargo.toml index b9690cf52..bfb296440 100644 --- a/apps/stage-tamagotchi/src-tauri/Cargo.toml +++ b/apps/stage-tamagotchi/src-tauri/Cargo.toml @@ -9,6 +9,15 @@ edition = "2024" rust-version = "1.85.0" publish = false +[features] +default = [] +cuda = [ + "ort/cuda", + "candle-core/cuda", + "candle-nn/cuda", + "candle-transformers/cuda" +] + [lib] name = "app_lib" crate-type = [ @@ -64,16 +73,16 @@ candle-transformers = { version = "0.9.1", features = ["metal"] } [target.'cfg(target_os = "windows")'.dependencies] windows = { version = "0.61.1", features = ["Win32_UI_WindowsAndMessaging", "Win32_Foundation"] } -ort = { version = "2.0.0-rc.10", features = ["ndarray", "directml", "cuda"] } -candle-core = { version = "0.9.1", features = ["cuda"] } -candle-nn = { version = "0.9.1", features = ["cuda"] } -candle-transformers = { version = "0.9.1", features = ["cuda"] } +ort = { version = "2.0.0-rc.10", features = ["ndarray", "directml"] } +candle-core = { version = "0.9.1" } +candle-nn = { version = "0.9.1" } +candle-transformers = { version = "0.9.1" } [target.'cfg(target_os = "linux")'.dependencies] -ort = { version = "2.0.0-rc.10", features = ["ndarray", "cuda"] } -candle-core = { version = "0.9.1", features = ["cuda"] } -candle-nn = { version = "0.9.1", features = ["cuda"] } -candle-transformers = { version = "0.9.1", features = ["cuda"] } +ort = { version = "2.0.0-rc.10", features = ["ndarray"] } +candle-core = { version = "0.9.1" } +candle-nn = { version = "0.9.1" } +candle-transformers = { version = "0.9.1" } [target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies] tauri-plugin-global-shortcut = "2.0.0"