diff --git a/charts/core/templates/ray-service/ray-service.yaml b/charts/core/templates/ray-service/ray-service.yaml index 24cdb197..a9c5d56b 100644 --- a/charts/core/templates/ray-service/ray-service.yaml +++ b/charts/core/templates/ray-service/ray-service.yaml @@ -169,7 +169,14 @@ spec: lifecycle: postStart: exec: - command: ["/bin/sh","-c","/home/ray/script/start_ray_serve.sh"] + command: + - "/bin/bash" + - "-c" + - > + if [[ -n $${NVIDIA_VISIBLE_DEVICES} ]]; then + sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml; + fi; + /home/ray/script/start_ray_serve.sh preStop: exec: command: ["/bin/sh","-c","ray stop"]