From 6d283882b16673e42dbe3c068f65271df010de77 Mon Sep 17 00:00:00 2001 From: Bruce MacDonald Date: Fri, 27 Oct 2023 12:42:40 -0400 Subject: [PATCH] catch insufficient permissions nvidia err (#934) --- llm/llama.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/llm/llama.go b/llm/llama.go index b257f3b8..8e2050c6 100644 --- a/llm/llama.go +++ b/llm/llama.go @@ -212,6 +212,10 @@ func CheckVRAM() (int64, error) { scanner := bufio.NewScanner(&stdout) for scanner.Scan() { line := scanner.Text() + if strings.Contains(line, "[Insufficient Permissions]") { + return 0, fmt.Errorf("GPU support may not enabled, check you have installed GPU drivers and have the necessary permissions to run nvidia-smi") + } + vram, err := strconv.ParseInt(strings.TrimSpace(line), 10, 64) if err != nil { return 0, fmt.Errorf("failed to parse available VRAM: %v", err)