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

Method runValidation

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

Source from the content-addressed store, hash-verified

1920}
1921
1922func (v *VGPUDevices) runValidation() error {
1923 nvmdev := nvmdev.New()
1924 vGPUDevices, err := nvmdev.GetAllDevices()
1925 if err != nil {
1926 return fmt.Errorf("error checking for vGPU devices on the host: %w", err)
1927 }
1928
1929 if !withWaitFlag {
1930 numDevices := len(vGPUDevices)
1931 if numDevices == 0 {
1932 return fmt.Errorf("no vGPU devices found")
1933 }
1934
1935 log.Infof("Found %d vGPU devices", numDevices)
1936 return nil
1937 }
1938
1939 for {
1940 numDevices := len(vGPUDevices)
1941 if numDevices > 0 {
1942 log.Infof("Found %d vGPU devices", numDevices)
1943 return nil
1944 }
1945 log.Infof("No vGPU devices found, retrying after %d seconds", sleepIntervalSecondsFlag)
1946 time.Sleep(time.Duration(sleepIntervalSecondsFlag) * time.Second)
1947
1948 vGPUDevices, err = nvmdev.GetAllDevices()
1949 if err != nil {
1950 return fmt.Errorf("error checking for vGPU devices on the host: %w", err)
1951 }
1952 }
1953}

Callers 1

validateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected