mirror of
https://github.com/ollama/ollama.git
synced 2025-07-28 12:03:16 +02:00
Build multiple CPU variants and pick the best
This reduces the built-in linux version to not use any vector extensions which enables the resulting builds to run under Rosetta on MacOS in Docker. Then at runtime it checks for the actual CPU vector extensions and loads the best CPU library available
This commit is contained in:
17
llm/llm.go
17
llm/llm.go
@@ -139,7 +139,22 @@ func Init(workdir string) error {
|
||||
}
|
||||
|
||||
func newLlmServer(gpuInfo gpu.GpuInfo, model string, adapters, projectors []string, opts api.Options) (extServer, error) {
|
||||
for _, shim := range getShims(gpuInfo) {
|
||||
shims := getShims(gpuInfo)
|
||||
|
||||
// Check to see if the user has requested a specific library instead of auto-detecting
|
||||
demandLib := os.Getenv("OLLAMA_LLM_LIBRARY")
|
||||
if demandLib != "" {
|
||||
libPath := availableShims[demandLib]
|
||||
if libPath == "" {
|
||||
log.Printf("Invalid OLLAMA_LLM_LIBRARY %s - not found", demandLib)
|
||||
} else {
|
||||
log.Printf("Loading OLLAMA_LLM_LIBRARY=%s", demandLib)
|
||||
shims = []string{libPath}
|
||||
}
|
||||
}
|
||||
|
||||
for _, shim := range shims {
|
||||
// TODO - only applies on Darwin (switch to fully dynamic there too...)
|
||||
if shim == "default" {
|
||||
break
|
||||
}
|
||||
|
Reference in New Issue
Block a user