Skip to content

Get up and running with Kimi, GLM, MiniMax, DeepSeek, gpt-oss, Qwen, Gemma and other models.

win: avoid ID mixups on refresh (#12869)

Daniel Hiltgendb973c8fc257
diff --git a/discover/runner.go b/discover/runner.go
index e74050d09..caaef222e 100644
--- a/discover/runner.go
+++ b/discover/runner.go
@@ -335,11 +335,14 @@ func GPUDevices(ctx context.Context, runners []ml.FilteredRunnerDiscovery) []ml.
ctx, cancel := context.WithTimeout(ctx, 3*time.Second)
defer cancel()
+ // Apply any dev filters to avoid re-discovering unsupported devices, and get IDs correct
+ devFilter := ml.GetVisibleDevicesEnv(devices)
+
for dir := range libDirs {
- updatedDevices := bootstrapDevices(ctx, []string{LibOllamaPath, dir}, nil)
+ updatedDevices := bootstrapDevices(ctx, []string{LibOllamaPath, dir}, devFilter)
for _, u := range updatedDevices {
for i := range devices {
- if u.DeviceID == devices[i].DeviceID {
+ if u.DeviceID == devices[i].DeviceID && u.PCIID == devices[i].PCIID {
updated[i] = true
devices[i].FreeMemory = u.FreeMemory
break