Skip to content

Commit 7d3a8a2

Browse files
committed
[validator] address edge case where nvidia-smi on host is empty
Signed-off-by: Christopher Desiniotis <[email protected]>
1 parent 8f81b78 commit 7d3a8a2

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎validator/main.go‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,13 @@ func isDriverManagedByOperator(ctx context.Context) (bool, error) {
693693

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

0 commit comments

Comments
 (0)