Skip to content

Commit d4b4655

Browse files
Thean LimTheanLim
authored andcommitted
fix(gpu): Remove dualstack URLs from nvidia repo for ISO regions
Temporary fix to remove $dualstack from amazonlinux-nvidia.repo file when building in air-gapped/ISO regions, as these regions cannot use dualstack URLs.
1 parent b61a8db commit d4b4655

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

al2023.pkr.hcl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ build {
196196

197197
provisioner "shell" {
198198
environment_vars = [
199-
"AMI_TYPE=${source.name}"
199+
"AMI_TYPE=${source.name}",
200+
"AIR_GAPPED=${var.air_gapped}"
200201
]
201202
scripts = [
202203
"scripts/al2023/gpu/install-nvidia-driver.sh",

scripts/al2023/gpu/install-nvidia-driver.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ sudo systemctl enable --now dkms
3636
# nvidia-release creates an nvidia repo file at /etc/yum.repos.d/amazonlinux-nvidia.repo
3737
sudo dnf install -y nvidia-release
3838

39+
# Temporary fix: ISO regions cannot use dualstack URLs, remove them from the repo file
40+
if [ -n "$AIR_GAPPED" ]; then
41+
echo "ISO regions cannot use dualstack URLs, removing from nvidia repo"
42+
sudo sed -i 's/\$dualstack//g' /etc/yum.repos.d/amazonlinux-nvidia.repo
43+
fi
44+
3945
### Kernel Module Archive Functions ###
4046
# These functions pre-compile and archive different NVIDIA driver variants
4147
# This allows runtime switching between proprietary, open-source, and GRID drivers

0 commit comments

Comments
 (0)