catch insufficient permissions nvidia err (#934)

This commit is contained in:
Bruce MacDonald 2023-10-27 12:42:40 -04:00 committed by GitHub
parent 5c3491f425
commit 6d283882b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)