Show the GPU-backed setting only if it is available

Signed-off-by: Dorin Geman <dorin.geman@docker.com>
This commit is contained in:
Dorin Geman 2025-04-17 12:11:13 +03:00 committed by Piotr Stankiewicz
parent eb0dba0cc8
commit 75f963a112
2 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,7 @@
//go:build !windows
package llamacpp
import "context"
func CanUseGPU(context.Context, string) (bool, error) { return false, nil }

View File

@ -55,3 +55,7 @@ func hasCUDA11CapableGPU(ctx context.Context, nvGPUInfoBin string) (bool, error)
}
return false, nil
}
func CanUseGPU(ctx context.Context, nvGPUInfoBin string) (bool, error) {
return hasCUDA11CapableGPU(ctx, nvGPUInfoBin)
}