From bc27e5ceb491f91aab351d000a2d0295a78a085c Mon Sep 17 00:00:00 2001 From: Jeff MAURY Date: Thu, 15 Aug 2024 09:42:12 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20wrong=20VMtype=20returned=20by=20Podman?= =?UTF-8?q?=20Desktop=20causes=20inference=20servers=E2=80=A6=20(#1549)=20?= =?UTF-8?q?(#1550)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: wrong VMtype returned by Podman Desktop causes inference servers start failure * fix: fix failing unit tests --------- Signed-off-by: Jeff MAURY --- packages/backend/src/managers/podmanConnection.ts | 2 +- packages/backend/src/workers/provider/LlamaCppPython.ts | 6 ++---- packages/shared/src/models/IPodman.ts | 2 ++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/backend/src/managers/podmanConnection.ts b/packages/backend/src/managers/podmanConnection.ts index fec927b87..552c3d782 100644 --- a/packages/backend/src/managers/podmanConnection.ts +++ b/packages/backend/src/managers/podmanConnection.ts @@ -156,7 +156,7 @@ export class PodmanConnection extends Publisher s === vmtype); if (type === undefined) { return VMType.UNKNOWN; } diff --git a/packages/backend/src/workers/provider/LlamaCppPython.ts b/packages/backend/src/workers/provider/LlamaCppPython.ts index 183a6c621..56bda2b68 100644 --- a/packages/backend/src/workers/provider/LlamaCppPython.ts +++ b/packages/backend/src/workers/provider/LlamaCppPython.ts @@ -250,12 +250,10 @@ export class LlamaCppPython extends InferenceProvider { case VMType.WSL: return gpu?.vendor === GPUVendor.NVIDIA ? llamacpp.cuda : llamacpp.default; case VMType.LIBKRUN: + case VMType.LIBKRUN_LABEL: return gpu ? llamacpp.vulkan : llamacpp.default; // no GPU support - case VMType.QEMU: - case VMType.APPLEHV: - case VMType.HYPERV: - case VMType.UNKNOWN: + default: return llamacpp.default; } } diff --git a/packages/shared/src/models/IPodman.ts b/packages/shared/src/models/IPodman.ts index 9879f1ba3..2212eb749 100644 --- a/packages/shared/src/models/IPodman.ts +++ b/packages/shared/src/models/IPodman.ts @@ -19,8 +19,10 @@ export enum VMType { WSL = 'wsl', LIBKRUN = 'libkrun', + LIBKRUN_LABEL = 'GPU enabled (LibKrun)', QEMU = 'qemu', APPLEHV = 'applehv', + APPLEHV_LABEL = 'default (Apple HyperVisor)', HYPERV = 'hyperv', UNKNOWN = 'unknown', }