@@ -20,12 +20,12 @@ import (
2020 "fmt"
2121 "slices"
2222 "strconv"
23- "strings"
2423
2524 "tags.cncf.io/container-device-interface/pkg/cdi"
2625 "tags.cncf.io/container-device-interface/specs-go"
2726
2827 "github.com/NVIDIA/go-nvlib/pkg/nvlib/device"
28+ "github.com/NVIDIA/go-nvlib/pkg/nvlib/info"
2929 "github.com/NVIDIA/go-nvml/pkg/nvml"
3030 "github.com/google/uuid"
3131
@@ -308,7 +308,7 @@ func isIntegratedGPU(d nvml.Device) (bool, error) {
308308 if ret != nvml .SUCCESS {
309309 return false , fmt .Errorf ("failed to get device name: %v" , ret )
310310 }
311- return isIntegratedGPUName (name ), nil
311+ return info . IsIntegratedGPUName (name ), nil
312312 }
313313 if ret != nvml .SUCCESS {
314314 return false , fmt .Errorf ("failed to get PCI info: %v" , ret )
@@ -322,18 +322,3 @@ func isIntegratedGPU(d nvml.Device) (bool, error) {
322322 }
323323 return pciInfo .Device == 0 , nil
324324}
325-
326- // isIntegratedGPUName returns true if the specified device name is associated
327- // with a known iGPU.
328- //
329- // TODO: Consider making go-nvlib/pkg/nvlib/info/isIntegratedGPUName public
330- // instead.
331- func isIntegratedGPUName (name string ) bool {
332- if strings .Contains (name , "(nvgpu)" ) {
333- return true
334- }
335- if strings .Contains (name , "NVIDIA Thor" ) {
336- return true
337- }
338- return false
339- }
0 commit comments