Skip to content

Commit

Permalink
Merge pull request #813 from NVIDIA/update-nvidia-smi-check
Browse files Browse the repository at this point in the history
[validator] address edge case where nvidia-smi on host is empty
  • Loading branch information
cdesiniotis authored Jul 11, 2024
2 parents f928335 + 7d3a8a2 commit 58ec152
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions validator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,13 @@ func isDriverManagedByOperator(ctx context.Context) (bool, error) {

func validateHostDriver(silent bool) error {
log.Info("Attempting to validate a pre-installed driver on the host")
fileInfo, err := os.Lstat("/host/usr/bin/nvidia-smi")
if err != nil {
return fmt.Errorf("no 'nvidia-smi' file present on the host: %w", err)
}
if fileInfo.Size() == 0 {
return fmt.Errorf("empty 'nvidia-smi' file found on the host")
}
command := "chroot"
args := []string{"/host", "nvidia-smi"}

Expand Down

0 comments on commit 58ec152

Please sign in to comment.