Skip to content

Commit 4f468a6

Browse files
committed
fix(getLlamaGpuTypes): fix edge case
1 parent 69b4e1b commit 4f468a6

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/bindings/utils/getLlamaGpuTypes.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,18 @@ import {getPlatform} from "./getPlatform.js";
1515
* as some of them are inadvisable for the current machine (like CUDA on an x64 Mac machine).
1616
*/
1717
export async function getLlamaGpuTypes(include: "supported" | "allValid"): Promise<LlamaGpuType[]> {
18-
if (include === "supported")
19-
return await getGpuTypesToUseForOption("auto");
20-
2118
const platform = getPlatform();
2219
const arch = process.arch;
2320

21+
if (include === "supported") {
22+
const gpuTypes = new Set(await getGpuTypesToUseForOption("auto"));
23+
24+
if (platform === "win" && arch !== "x64")
25+
gpuTypes.delete("vulkan"); // no Vulkan prebuilt binary yet due to incomplete support for arm64
26+
27+
return [...gpuTypes];
28+
}
29+
2430
const res: LlamaGpuType[] = [];
2531

2632
// Metal is not properly supported by llama.cpp on x64 Mac machines

0 commit comments

Comments
 (0)