From e61c32943556142a646e5812654768d9c2ba29c8 Mon Sep 17 00:00:00 2001 From: pufferffish Date: Mon, 23 Sep 2024 18:43:16 +0800 Subject: [PATCH] fix vulkan on windows --- gpu/gpu_windows.go | 5 +++++ llm/generate/gen_windows.ps1 | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/gpu/gpu_windows.go b/gpu/gpu_windows.go index 5491da963..f9afb6ed8 100644 --- a/gpu/gpu_windows.go +++ b/gpu/gpu_windows.go @@ -40,11 +40,16 @@ var OneapiGlobs = []string{ "c:\\Windows\\System32\\DriverStore\\FileRepository\\*\\ze_intel_gpu64.dll", } +var VulkanGlobs = []string{ + "c:\\Windows\\System32\\vulkan-1.dll", +} + var ( CudartMgmtName = "cudart64_*.dll" NvcudaMgmtName = "nvcuda.dll" NvmlMgmtName = "nvml.dll" OneapiMgmtName = "ze_intel_gpu64.dll" + VulkanMgmtName = "vulkan-1.dll" ) func FindLibCapLibs() []string { diff --git a/llm/generate/gen_windows.ps1 b/llm/generate/gen_windows.ps1 index 29ff5ff62..bb92c5121 100644 --- a/llm/generate/gen_windows.ps1 +++ b/llm/generate/gen_windows.ps1 @@ -412,6 +412,21 @@ function build_rocm() { } } +function build_vulkan() { + if (-not "${env:OLLAMA_SKIP_VULKAN_GENERATE}") { + init_vars + $script:buildDir="../build/windows/${script:ARCH}/vulkan" + $script:distDir="$script:DIST_BASE\vulkan" + $script:cmakeDefs += @("-A", "x64", "-DLLAMA_VULKAN=1") + write-host "Building Vulkan" + build + sign + install + } else { + write-host "Skipping Vulkan generation step" + } +} + init_vars if ($($args.count) -eq 0) { git_module_setup @@ -426,6 +441,7 @@ if ($($args.count) -eq 0) { build_cuda build_oneapi build_rocm + build_vulkan } cleanup