From 4b6269a4f0344a549a076706ee14b2394a1bb6f0 Mon Sep 17 00:00:00 2001 From: Louis Date: Mon, 4 Aug 2025 15:54:21 +0700 Subject: [PATCH] fix: add missing cuda backend support --- extensions/llamacpp-extension/src/backend.ts | 28 +++++++++++++++++--- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/extensions/llamacpp-extension/src/backend.ts b/extensions/llamacpp-extension/src/backend.ts index c8a531333..e8068f63b 100644 --- a/extensions/llamacpp-extension/src/backend.ts +++ b/extensions/llamacpp-extension/src/backend.ts @@ -27,8 +27,18 @@ export async function listSupportedBackends(): Promise< if (features.avx) supportedBackends.push('win-avx-x64') if (features.avx2) supportedBackends.push('win-avx2-x64') if (features.avx512) supportedBackends.push('win-avx512-x64') - if (features.cuda11) supportedBackends.push('win-avx2-cuda-cu11.7-x64') - if (features.cuda12) supportedBackends.push('win-avx2-cuda-cu12.0-x64') + if (features.cuda11) { + if (features.avx512) supportedBackends.push('win-avx512-cuda-cu11.7-x64') + else if (features.avx2) supportedBackends.push('win-avx2-cuda-cu11.7-x64') + else if (features.avx) supportedBackends.push('win-avx-cuda-cu11.7-x64') + else supportedBackends.push('win-noavx-cuda-cu11.7-x64') + } + if (features.cuda12) { + if (features.avx512) supportedBackends.push('win-avx512-cuda-cu12.0-x64') + else if (features.avx2) supportedBackends.push('win-avx2-cuda-cu12.0-x64') + else if (features.avx) supportedBackends.push('win-avx-cuda-cu12.0-x64') + else supportedBackends.push('win-noavx-cuda-cu12.0-x64') + } if (features.vulkan) supportedBackends.push('win-vulkan-x64') } // not available yet, placeholder for future @@ -39,8 +49,18 @@ export async function listSupportedBackends(): Promise< if (features.avx) supportedBackends.push('linux-avx-x64') if (features.avx2) supportedBackends.push('linux-avx2-x64') if (features.avx512) supportedBackends.push('linux-avx512-x64') - if (features.cuda11) supportedBackends.push('linux-avx2-cuda-cu11.7-x64') - if (features.cuda12) supportedBackends.push('linux-avx2-cuda-cu12.0-x64') + if (features.cuda11) { + if (features.avx512) supportedBackends.push('linux-avx512-cuda-cu11.7-x64') + else if (features.avx2) supportedBackends.push('linux-avx2-cuda-cu11.7-x64') + else if (features.avx) supportedBackends.push('linux-avx-cuda-cu11.7-x64') + else supportedBackends.push('linux-noavx-cuda-cu11.7-x64') + } + if (features.cuda12) { + if (features.avx512) supportedBackends.push('linux-avx512-cuda-cu12.0-x64') + else if (features.avx2) supportedBackends.push('linux-avx2-cuda-cu12.0-x64') + else if (features.avx) supportedBackends.push('linux-avx-cuda-cu12.0-x64') + else supportedBackends.push('linux-noavx-cuda-cu12.0-x64') + } if (features.vulkan) supportedBackends.push('linux-vulkan-x64') } // not available yet, placeholder for future