From e83c34a67bacb2debd3d1e6f855141adf969e4b3 Mon Sep 17 00:00:00 2001 From: Christopher Desiniotis Date: Thu, 19 Dec 2024 16:23:23 -0800 Subject: [PATCH 1/2] Update driver validation to account for WSL2 Signed-off-by: Christopher Desiniotis --- validator/main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/validator/main.go b/validator/main.go index df92cd4d4..0e7a58a45 100644 --- a/validator/main.go +++ b/validator/main.go @@ -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) From 2d8f12090f47ae8918baa6eb881bc1dccc531834 Mon Sep 17 00:00:00 2001 From: Christopher Desiniotis Date: Thu, 19 Dec 2024 16:35:36 -0800 Subject: [PATCH 2/2] Mount all of /sys in GFD instead of just /sys/class/dmi/id directory This change is motivated by WSL2 where the /sys/class/dmi directory does not exist. Mount all of /sys as read-only is a safe approach to account for systems where this directory does not exist. Signed-off-by: Christopher Desiniotis --- assets/gpu-feature-discovery/0500_daemonset.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/gpu-feature-discovery/0500_daemonset.yaml b/assets/gpu-feature-discovery/0500_daemonset.yaml index 40df1c193..7efc1b342 100644 --- a/assets/gpu-feature-discovery/0500_daemonset.yaml +++ b/assets/gpu-feature-discovery/0500_daemonset.yaml @@ -127,8 +127,8 @@ spec: volumeMounts: - name: output-dir mountPath: "/etc/kubernetes/node-feature-discovery/features.d" - - name: dmi-info-dir - mountPath: "/sys/class/dmi/id" + - name: host-sys + mountPath: /sys readOnly: true - name: config mountPath: /config @@ -169,9 +169,9 @@ spec: - name: output-dir hostPath: path: "/etc/kubernetes/node-feature-discovery/features.d" - - name: dmi-info-dir + - name: host-sys hostPath: - path: "/sys/class/dmi/id" + path: /sys - name: run-nvidia-validations hostPath: path: "/run/nvidia/validations"