mirror of
https://github.com/ollama/ollama.git
synced 2026-05-13 14:27:00 +00:00
Merge 09274c44b7 into 3af1a008e2
This commit is contained in:
commit
4e60af7a89
1 changed files with 12 additions and 2 deletions
|
|
@ -304,7 +304,12 @@ func GPUDevices(ctx context.Context, runners []ml.FilteredRunnerDiscovery) []ml.
|
|||
|
||||
// Typical refresh on existing runner is ~500ms but allow longer if the system
|
||||
// is under stress before giving up and using stale data.
|
||||
ctx, cancel := context.WithTimeout(ctx, 3*time.Second)
|
||||
refreshTimeout := 3 * time.Second
|
||||
if envconfig.HsaOverrideGfxVersion() != "" {
|
||||
slog.Debug("HSA_OVERRIDE_GFX_VERSION detected, increasing existing runner refresh timeout")
|
||||
refreshTimeout = 10 * time.Second
|
||||
}
|
||||
ctx, cancel := context.WithTimeout(ctx, refreshTimeout)
|
||||
defer cancel()
|
||||
start := time.Now()
|
||||
updatedDevices := runner.GetDeviceInfos(ctx)
|
||||
|
|
@ -328,7 +333,12 @@ func GPUDevices(ctx context.Context, runners []ml.FilteredRunnerDiscovery) []ml.
|
|||
|
||||
// Bootstrapping may take longer in some cases (AMD windows), but we
|
||||
// would rather use stale free data to get the model running sooner
|
||||
ctx, cancel := context.WithTimeout(ctx, 3*time.Second)
|
||||
bootstrapTimeout := 3 * time.Second
|
||||
if envconfig.HsaOverrideGfxVersion() != "" {
|
||||
slog.Debug("HSA_OVERRIDE_GFX_VERSION detected, increasing bootstrap refresh timeout")
|
||||
bootstrapTimeout = 10 * time.Second
|
||||
}
|
||||
ctx, cancel := context.WithTimeout(ctx, bootstrapTimeout)
|
||||
defer cancel()
|
||||
|
||||
// Apply any dev filters to avoid re-discovering unsupported devices, and get IDs correct
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue