Skip to content

Commit

Permalink
Update driver validation to account for WSL2
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Desiniotis <[email protected]>
  • Loading branch information
cdesiniotis committed Dec 20, 2024
1 parent 4b0b712 commit e83c34a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions validator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,11 @@ func isDriverManagedByOperator(ctx context.Context) (bool, error) {

func validateHostDriver(silent bool) error {
log.Info("Attempting to validate a pre-installed driver on the host")
if fileInfo, err := os.Lstat("/host/usr/lib/wsl/lib/nvidia-smi"); err == nil && fileInfo.Size() != 0 {
log.Infof("WSL2 system detected, assuming driver is pre-installed")
disableDevCharSymlinkCreation = true
return nil
}
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)
Expand Down

0 comments on commit e83c34a

Please sign in to comment.