MCPcopy Create free account
hub / github.com/NVIDIA/gpu-operator / runValidation

Method runValidation

cmd/nvidia-validator/main.go:1674–1691  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1672}
1673
1674func (v *VfioPCI) runValidation() error {
1675 nvpci := nvpci.New()
1676 nvdevices, err := nvpci.GetGPUs()
1677 if err != nil {
1678 return fmt.Errorf("error getting NVIDIA PCI devices: %w", err)
1679 }
1680
1681 for _, dev := range nvdevices {
1682 // TODO: Do not hardcode a list of VFIO driver names. This would be possible if we
1683 // added an API to go-nvlib which returns the most suitable VFIO driver for a GPU,
1684 // using logic similar to https://github.com/NVIDIA/k8s-driver-manager/commit/874c8cd26d775db437f16a42c3e44e74301b3a35
1685 if dev.Driver != "vfio-pci" && dev.Driver != "nvgrace_gpu_vfio_pci" {
1686 return fmt.Errorf("device not bound to 'vfio-pci'; device: %s driver: '%s'", dev.Address, dev.Driver)
1687 }
1688 }
1689
1690 return nil
1691}
1692
1693func (v *VGPUManager) validate() error {
1694 ctx := v.ctx

Callers 1

validateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected