Skip to content

Commit

Permalink
fix: the mismatch between gpu-manager pick up and gpu-admission predi…
Browse files Browse the repository at this point in the history
…cate
  • Loading branch information
HeroBcat committed Mar 5, 2021
1 parent 1d0955c commit edf52aa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/device/nvidia/sort.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ package nvidia

import (
"sort"

"tkestack.io/gpu-manager/pkg/types"
)

//LessFunc represents funcion to compare two NvidiaNode
Expand Down Expand Up @@ -57,7 +59,7 @@ var (

//ByAllocatableMemory compares two NvidiaNode by available memory
ByAllocatableMemory = func(p1, p2 *NvidiaNode) bool {
return p1.AllocatableMeta.Memory < p2.AllocatableMeta.Memory
return p1.AllocatableMeta.Memory/types.MemoryBlockSize < p2.AllocatableMeta.Memory/types.MemoryBlockSize
}

//PrintSorter is used to sort nodes when printing them out
Expand Down

0 comments on commit edf52aa

Please sign in to comment.