Skip to content

Commit

Permalink
Fix regression with supporting operator managed drivers
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Klues <[email protected]>
  • Loading branch information
klueska committed Oct 29, 2024
1 parent 6c94abc commit 6308d36
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions demo/clusters/kind/install-dra-driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ kubectl label node -l node-role.x-k8s.io/worker --overwrite nvidia.com/gpu.prese
deviceClasses=${1:-"gpu,mig,imex"}
helm upgrade -i --create-namespace --namespace nvidia nvidia-dra-driver ${PROJECT_DIR}/deployments/helm/k8s-dra-driver \
--set deviceClasses="{${deviceClasses}}" \
${NVIDIA_CTK_PATH:+--set nvidiaCtkPath=${NVIDIA_CTK_PATH}} \
${NVIDIA_DRIVER_ROOT:+--set nvidiaDriverRoot=${NVIDIA_DRIVER_ROOT}} \
--wait

Expand Down
15 changes: 12 additions & 3 deletions deployments/helm/k8s-dra-driver/templates/kubeletplugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,18 @@ spec:
args:
- |-
trap 'exit 0' TERM
cp /proc/driver/nvidia/params root/gpu-params
sed -i 's/^ModifyDeviceFiles: 1$/ModifyDeviceFiles: 0/' root/gpu-params
mount --bind root/gpu-params /proc/driver/nvidia/params
# TODO: Masking of the params file is done below to allow nvkind to
# selectively exclude certain GPUs from being visible to the driver.
# At present, this is only feasible with a host-mounted driver where
# /dev in this container already has GPU devices present (as brought
# in via the --privileged flag from docker/podman when using nvkind).
# In the future we should revisit this to find a more robust method
# of supporting this.
if [ "${NVIDIA_DRIVER_ROOT}" = "/" ]; then
cp /proc/driver/nvidia/params root/gpu-params
sed -i 's/^ModifyDeviceFiles: 1$/ModifyDeviceFiles: 0/' root/gpu-params
mount --bind root/gpu-params /proc/driver/nvidia/params
fi
nvidia-dra-plugin &
wait
resources:
Expand Down

0 comments on commit 6308d36

Please sign in to comment.