From 8c50f9f18ff5946e292f82a6672af84779e10f79 Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Sat, 25 Mar 2023 18:48:56 +0000 Subject: [PATCH] Fix bug in heuristic for which MIG profiles to skip Signed-off-by: Kevin Klues --- pkg/nvlib/device/device.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/nvlib/device/device.go b/pkg/nvlib/device/device.go index 4136527..e2603cf 100644 --- a/pkg/nvlib/device/device.go +++ b/pkg/nvlib/device/device.go @@ -212,7 +212,10 @@ func (d *device) VisitMigProfiles(visit func(MigProfile) error) error { // physically constructed. In the future we should do this via // NVML once a proper API for this exists. pi := p.GetInfo() - if (pi.C * 2) > (pi.G + 1) { + if pi.C > pi.G { + continue + } + if (pi.C < pi.G) && ((pi.C * 2) > (pi.G + 1)) { continue }