Skip to content

Commit

Permalink
Windows builds should compile for CUDA (#21)
Browse files Browse the repository at this point in the history
* Windows builds should compile for CUDA

* CUDA toolkit

* Disable CUDA on Linux
  • Loading branch information
clarkmcc authored Jul 31, 2023
1 parent 4635672 commit 102fa2d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: Build
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
release:
Expand Down Expand Up @@ -51,6 +48,21 @@ jobs:
# If you don't have `beforeBuildCommand` configured you may want to build your frontend here too.
run: yarn install # Change this to npm, yarn or pnpm.

# CUDA
- uses: Jimver/cuda-toolkit@v0.2.11
if: matrix.platform == 'windows-latest'
id: cuda-toolkit
with:
cuda: '12.1.0'
- if: matrix.platform == 'windows-latest'
run: |
echo "Installed cuda version is: ${{steps.cuda-toolkit.outputs.cuda}}"
- if: matrix.platform == 'windows-latest'
run: |
echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}"
- if: matrix.platform == 'windows-latest'
run: nvcc -V

- name: Build
if: inputs.release == false
uses: tauri-apps/tauri-action@v0
Expand Down
6 changes: 5 additions & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ pdf-extract = "0.6.5"
llm = { git = "https://github.com/rustformers/llm", branch = "main", features = ["metal"] }
cocoa = "0.24.1"

[target.'cfg(not(target_os = "macos"))'.dependencies]
[target.'cfg(target_os = "windows")'.dependencies]
llm = { git = "https://github.com/rustformers/llm", branch = "main", features = ["cublas"] }

# TODO: Support CUDA on Linux
[target.'cfg(any(not(target_os = "macos"), not(target_os = "windows")))'.dependencies]
llm = { git = "https://github.com/rustformers/llm", branch = "main", features = [] }

[features]
Expand Down

0 comments on commit 102fa2d

Please sign in to comment.