Skip to content

Commit ef7e0c0

Browse files
authored
fix the ec2 grid driver s3 doesn't exist in THF,ALE,NCL (#2500)
1 parent cc69216 commit ef7e0c0

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

templates/al2023/provisioners/install-nvidia-driver.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,15 @@ echo "Installing NVIDIA ${NVIDIA_DRIVER_MAJOR_VERSION} drivers..."
2929
# of the AMI, we want to ensure that all three kernel modules (and also the userspace modules)
3030
# are on the same NVIDIA driver version. Currently, the script installs the NVIDIA GRID drivers
3131
# first and decides the full NVIDIA driver version that the AMI will adhere to
32-
EC2_GRID_DRIVER_S3_BUCKET="ec2-linux-nvidia-drivers"
33-
NVIDIA_DRIVER_FULL_VERSION=$(aws s3 ls --recursive s3://${EC2_GRID_DRIVER_S3_BUCKET}/ \
32+
if [[ "$AWS_REGION" == "us-isof-south-1" || "$AWS_REGION" == "eusc-de-east-1" || "$AWS_REGION" == "eu-isoe-west-1" ]]; then
33+
EC2_GRID_DRIVER_S3_BUCKET="${BINARY_BUCKET_NAME}"
34+
GRID_DRIVER_S3_SCAN_PATH="s3://${EC2_GRID_DRIVER_S3_BUCKET}/bin/nvidia-grid-drivers/"
35+
else
36+
EC2_GRID_DRIVER_S3_BUCKET="ec2-linux-nvidia-drivers"
37+
GRID_DRIVER_S3_SCAN_PATH="s3://${EC2_GRID_DRIVER_S3_BUCKET}/"
38+
fi
39+
40+
NVIDIA_DRIVER_FULL_VERSION=$(aws s3 ls --recursive ${GRID_DRIVER_S3_SCAN_PATH} \
3441
| grep -Eo "(NVIDIA-Linux-x86_64-)${NVIDIA_DRIVER_MAJOR_VERSION}\.[0-9]+\.[0-9]+(-grid-aws\.run)" \
3542
| cut -d'-' -f4 \
3643
| sort -V \
@@ -180,7 +187,7 @@ function archive-grid-kmod() {
180187
fi
181188

182189
echo "Archiving NVIDIA GRID kernel modules for major version ${NVIDIA_DRIVER_MAJOR_VERSION}"
183-
NVIDIA_GRID_RUNFILE_NAME=$(aws s3 ls --recursive s3://${EC2_GRID_DRIVER_S3_BUCKET}/ \
190+
NVIDIA_GRID_RUNFILE_NAME=$(aws s3 ls --recursive ${GRID_DRIVER_S3_SCAN_PATH} \
184191
| grep "NVIDIA-Linux-x86_64-${NVIDIA_DRIVER_FULL_VERSION}" \
185192
| sort -k1,2 \
186193
| tail -1 \
@@ -196,7 +203,7 @@ function archive-grid-kmod() {
196203
GRID_RUNFILE_LOCAL_NAME=$(basename "${NVIDIA_GRID_RUNFILE_NAME}")
197204

198205
echo "Downloading GRID driver runfile..."
199-
aws s3 cp "s3://ec2-linux-nvidia-drivers/${NVIDIA_GRID_RUNFILE_NAME}" "${GRID_INSTALLATION_TEMP_DIR}/${GRID_RUNFILE_LOCAL_NAME}"
206+
aws s3 cp "s3://${EC2_GRID_DRIVER_S3_BUCKET}/${NVIDIA_GRID_RUNFILE_NAME}" "${GRID_INSTALLATION_TEMP_DIR}/${GRID_RUNFILE_LOCAL_NAME}"
200207
chmod +x "${GRID_INSTALLATION_TEMP_DIR}/${GRID_RUNFILE_LOCAL_NAME}"
201208
echo "Extracting NVIDIA GRID driver runfile..."
202209
sudo "${GRID_INSTALLATION_TEMP_DIR}/${GRID_RUNFILE_LOCAL_NAME}" --extract-only --target "${EXTRACT_DIR}"

0 commit comments

Comments
 (0)