mirror of
https://github.com/intel/intel-device-plugins-for-kubernetes.git
synced 2025-06-03 03:59:37 +00:00
gpu_plugin: reduce topology scanning for high shared dev count
For every created device info, a new topology scan is performed in the filesystem. The shared dev count was implemented so that for each shared device, a new device info was created, which resulted in the topology scan happening as many times per Scan-round, as there were shared devs. This fixes the issue by making the device info to be shared among the shared devices. Signed-off-by: Ukri Niemimuukko <ukri.niemimuukko@intel.com>
This commit is contained in:
parent
9bdf3a4def
commit
b2991b94e1
@ -148,11 +148,12 @@ func (dp *devicePlugin) scan() (dpapi.DeviceTree, error) {
|
||||
}
|
||||
|
||||
if len(nodes) > 0 {
|
||||
deviceInfo := dpapi.NewDeviceInfo(pluginapi.Healthy, nodes, nil, nil)
|
||||
for i := 0; i < dp.sharedDevNum; i++ {
|
||||
devID := fmt.Sprintf("%s-%d", f.Name(), i)
|
||||
// Currently only one device type (i915) is supported.
|
||||
// TODO: check model ID to differentiate device models.
|
||||
devTree.AddDevice(deviceType, devID, dpapi.NewDeviceInfo(pluginapi.Healthy, nodes, nil, nil))
|
||||
devTree.AddDevice(deviceType, devID, deviceInfo)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user