mirror of
https://github.com/intel/intel-device-plugins-for-kubernetes.git
synced 2025-06-03 03:59:37 +00:00
fix gpu nfdhook numa labeling
Numa labeling only worked when card numbering started from 0. Signed-off-by: Ukri Niemimuukko <ukri.niemimuukko@intel.com>
This commit is contained in:
parent
183675e16b
commit
e199f8d181
@ -463,7 +463,7 @@ func createNumaNodeMappingLabel(mapping map[int][]string) string {
|
||||
|
||||
sort.Ints(numas)
|
||||
|
||||
for numaNode := range numas {
|
||||
for _, numaNode := range numas {
|
||||
gpus := mapping[numaNode]
|
||||
numaString := strconv.FormatInt(int64(numaNode), 10)
|
||||
gpusString := strings.Join(gpus, ".")
|
||||
|
@ -537,6 +537,42 @@ func getTestCases() []testcase {
|
||||
"gpu.intel.com/numa-gpu-map": "0-0_1-1",
|
||||
},
|
||||
},
|
||||
{
|
||||
sysfsdirs: []string{
|
||||
"card0/device/drm/card0",
|
||||
"card1/device/drm/card1",
|
||||
"card1/gt/gt0",
|
||||
},
|
||||
sysfsfiles: map[string][]byte{
|
||||
"card0/device/vendor": []byte("0xfefe"),
|
||||
"card0/device/numa_node": []byte("0"),
|
||||
"card1/device/vendor": []byte("0x8086"),
|
||||
"card1/lmem_total_bytes": []byte("8000"),
|
||||
"card1/device/numa_node": []byte("1"),
|
||||
},
|
||||
name: "successful labeling with one 0x8086 card and numa node info",
|
||||
memoryOverride: 16000000000,
|
||||
capabilityFile: map[string][]byte{
|
||||
"1/i915_capabilities": []byte(
|
||||
"platform: newnew\n" +
|
||||
"gen: 9"),
|
||||
},
|
||||
expectedRetval: nil,
|
||||
expectedLabels: labelMap{
|
||||
"gpu.intel.com/graphics_version": "9",
|
||||
"gpu.intel.com/media_version": "9",
|
||||
"gpu.intel.com/millicores": "1000",
|
||||
"gpu.intel.com/memory.max": "8000",
|
||||
"gpu.intel.com/platform_newnew.count": "1",
|
||||
"gpu.intel.com/platform_newnew.present": "true",
|
||||
"gpu.intel.com/platform_newnew.tiles": "1",
|
||||
"gpu.intel.com/platform_gen": "9",
|
||||
"gpu.intel.com/gpu-numbers": "1",
|
||||
"gpu.intel.com/cards": "card1",
|
||||
"gpu.intel.com/tiles": "1",
|
||||
"gpu.intel.com/numa-gpu-map": "1-1",
|
||||
},
|
||||
},
|
||||
{
|
||||
sysfsdirs: []string{
|
||||
"card0/device/drm/card0",
|
||||
|
Loading…
Reference in New Issue
Block a user