(silent bool)
| 743 | } |
| 744 | |
| 745 | func validateHostDriver(silent bool) error { |
| 746 | log.Info("Attempting to validate a pre-installed driver on the host") |
| 747 | if fileInfo, err := os.Lstat(filepath.Join("/host", wslNvidiaSMIPath)); err == nil && fileInfo.Size() != 0 { |
| 748 | log.Infof("WSL2 system detected, assuming driver is pre-installed") |
| 749 | disableDevCharSymlinkCreation = true |
| 750 | return nil |
| 751 | } |
| 752 | fileInfo, err := os.Lstat("/host/usr/bin/nvidia-smi") |
| 753 | if err != nil { |
| 754 | return fmt.Errorf("no 'nvidia-smi' file present on the host: %w", err) |
| 755 | } |
| 756 | if fileInfo.Size() == 0 { |
| 757 | return fmt.Errorf("empty 'nvidia-smi' file found on the host") |
| 758 | } |
| 759 | command := "chroot" |
| 760 | args := []string{"/host", "nvidia-smi"} |
| 761 | |
| 762 | return runCommand(command, args, silent) |
| 763 | } |
| 764 | |
| 765 | func validateDriverContainer(silent bool, driverManagedByOperator bool) error { |
| 766 | if driverManagedByOperator { |
no test coverage detected