INNER CODE UNIT · Go

resolveHostNvidiaSMI

NVIDIA/gpu-operator · cmd/nvidia-validator/main.go:747

func resolveHostNvidiaSMI(hostRootCtrPath string) (string, error) {
	for _, nvidiaSMIPath := range hostNvidiaSMISearchPaths {
		f, err := pathrs.OpenInRoot(hostRootCtrPath, nvidiaSMIPath)
		if err != nil {
			log.Debugf("failed to open '%s' on the host: %v", nvidiaSMIPath, err)
			continue
		}

		fileInfo, err := f.Stat()
		_ = f.Close()
		if err != nil {
			log.Debugf("failed to stat '%s' on the host: %v", nvidiaSMIPath, err)
			continue
		}

		if !fileInfo.Mode().IsRegular() || fileInfo.Size() == 0 || fileInfo.Mode().Perm()&0o111 == 0 {
			log.Debugf("skipping '%s' on the host: not a non-empty executable regular file", nvidiaSMIPath)
			continue

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…