(silent bool)
| 808 | } |
| 809 | |
| 810 | func (d *Driver) runValidation(silent bool) (driverInfo, error) { |
| 811 | err := validateHostDriver(silent) |
| 812 | if err == nil { |
| 813 | log.Info("Detected a pre-installed driver on the host") |
| 814 | return getDriverInfo(true, hostRootFlag, hostRootFlag, "/host"), nil |
| 815 | } |
| 816 | |
| 817 | log.Infof("No pre-installed driver detected on the host: %v", err) |
| 818 | |
| 819 | log.Info("Validating containerized driver installation") |
| 820 | |
| 821 | driverManagedByOperator, err := isDriverManagedByOperator(d.ctx) |
| 822 | if err != nil { |
| 823 | return driverInfo{}, fmt.Errorf("error checking if driver is managed by GPU Operator: %w", err) |
| 824 | } |
| 825 | |
| 826 | err = validateDriverContainer(silent, driverManagedByOperator) |
| 827 | if err != nil { |
| 828 | return driverInfo{}, err |
| 829 | } |
| 830 | |
| 831 | if driverManagedByOperator { |
| 832 | err = validateAdditionalDriverComponents(d.ctx, driverContainerStatusFilePath) |
| 833 | if err != nil { |
| 834 | return driverInfo{}, err |
| 835 | } |
| 836 | } |
| 837 | return getDriverInfo(false, hostRootFlag, driverInstallDirFlag, driverInstallDirCtrPathFlag), nil |
| 838 | } |
| 839 | |
| 840 | // validateAdditionalDriverComponents validates additional driver components such as |
| 841 | // gdrcopy, gds, nvidia-peermem(rdma) if they are enabled. |
no test coverage detected