Skip to content

Commit

Permalink
ci: support Vulkan build on Windows (#1726)
Browse files Browse the repository at this point in the history
* Fix vulkan build feature on Windows

* Add Windows vulkan build to release.yml. Untested

* Documentation changes

* Fix library name on Windows, leave as is elsewhere

* Update index.mdx

* Update index.mdx

---------

Co-authored-by: Meng Zhang <[email protected]>
  • Loading branch information
vgf89 and wsxiaoys authored Mar 26, 2024
1 parent 07f13f5 commit d4c9908
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
- x86_64-manylinux2014-cuda122
- x86_64-manylinux2014-vulkan
- x86_64-windows-msvc
- x86_64-windows-msvc-vulkan
- x86_64-windows-msvc-cuda117
- x86_64-windows-msvc-cuda122
include:
Expand Down Expand Up @@ -67,6 +68,12 @@ jobs:
binary: x86_64-windows-msvc
build_args: --features prod-db
ext: .exe
- os: windows-latest
target: x86_64-pc-windows-msvc
binary: x86_64-windows-msvc-vulkan
ext: .exe
build_args: --features vulkan,prod-db
vulkan_sdk: '1.3.280.0'
- os: windows-latest
target: x86_64-pc-windows-msvc
binary: x86_64-windows-msvc-cuda117
Expand Down
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ To run Tabby locally with ROCm (AMD):
cargo run --features rocm serve --model TabbyML/StarCoder-1B --device rocm
```

To run Tabby locally with Vulkan:

```
cargo run --features vulkan serve --model TabbyML/StarCoder-1B --device vulkan
```

To run Tabby locally with Metal (Apple M1/M2):

```
Expand Down
8 changes: 6 additions & 2 deletions crates/llama-cpp-bindings/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,14 @@ fn build_llama_cpp() {
}
if cfg!(feature = "vulkan") {
if let Ok(vulkan_sdk_path) = env::var("VULKAN_SDK") {
println!("cargo:rustc-link-search=native={}/lib", vulkan_sdk_path);
println!("cargo:rustc-link-search={}/lib", vulkan_sdk_path);
}
config.define("LLAMA_VULKAN", "ON");
println!("cargo:rustc-link-lib=vulkan");
if cfg!(target_os = "windows") {
println!("cargo:rustc-link-lib=vulkan-1");
} else {
println!("cargo:rustc-link-lib=vulkan");
}
}

// By default, this value is automatically inferred from Rust’s compilation profile.
Expand Down
2 changes: 1 addition & 1 deletion website/docs/installation/windows/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ Open a command prompt or PowerShell window in the directory where you downloaded
You should see the following output if the command runs successfully:
![Windows running output](./status.png)

You can also go to `http://localhost:8080/swagger-ui/` to check the available API endpoints.
You can also go to `http://localhost:8080/swagger-ui/` to check the available API endpoints.

0 comments on commit d4c9908

Please sign in to comment.