@@ -34,31 +34,28 @@ echo "Installing NVIDIA ${NVIDIA_DRIVER_MAJOR_VERSION} drivers..."
3434# ###############################################################################
3535# ## Add repository #############################################################
3636# ###############################################################################
37- function get_cuda_al2023_x86_repo() {
38- if [[ $AWS_REGION == cn-* ]]; then
39- DOMAIN=" nvidia.cn"
40- else
41- DOMAIN=" nvidia.com"
42- fi
43-
44- echo " https://developer.download.${DOMAIN} /compute/cuda/repos/amzn2023/x86_64/cuda-amzn2023.repo"
45- }
46-
4737# Determine the domain based on the region
4838if is-isolated-partition; then
4939 sudo dnf install -y nvidia-release
5040 sudo sed -i ' s/$dualstack//g' /etc/yum.repos.d/amazonlinux-nvidia.repo
5141
5242 rpm_install " opencl-filesystem-1.0-5.el7.noarch.rpm" " ocl-icd-2.2.12-1.el7.x86_64.rpm"
43+
5344else
45+ if [[ $AWS_REGION == cn-* ]]; then
46+ DOMAIN=" nvidia.cn"
47+ else
48+ DOMAIN=" nvidia.com"
49+ fi
50+
5451 if [ -n " ${NVIDIA_REPOSITORY:- } " ]; then
5552 sudo dnf config-manager --add-repo ${NVIDIA_REPOSITORY}
5653 elif [[ " $( uname -m) " == " aarch64" ]]; then
5754 sudo dnf config-manager --add-repo https://developer.download.${DOMAIN} /compute/cuda/repos/amzn2023/sbsa/cuda-amzn2023.repo
5855 # nvidia-container-toolkit is not included in the amzn2023/sbsa repo, but is for other architectures
5956 sudo dnf config-manager --add-repo=https://nvidia.github.io/libnvidia-container/stable/rpm/nvidia-container-toolkit.repo
6057 else
61- sudo dnf config-manager --add-repo $( get_cuda_al2023_x86_repo )
58+ sudo dnf config-manager --add-repo https://developer.download. ${DOMAIN} /compute/cuda/repos/amzn2023/ $( uname -m ) /cuda-amzn2023.repo
6259 fi
6360
6461 # update all current .repo sources to enable gpgcheck
@@ -85,23 +82,10 @@ sudo dnf -y install \
8582 kernel-headers-$( uname -r) \
8683 kernel-modules-extra-common-$( uname -r)
8784
88- # Install dkms dependency from amazonlinux repo
85+ # Install dkms dependency from amazonlinux
8986sudo dnf -y install patch
90-
91- if is-isolated-partition; then
92- sudo dnf -y install dkms
93- else
94- # Install dkms from the cuda repo
95- if [[ " $( uname -m) " == " x86_64" ]]; then
96- sudo dnf -y --disablerepo=" *" --enablerepo=" cuda*" install dkms
97- else
98- sudo dnf -y remove dkms
99- sudo dnf config-manager --add-repo $( get_cuda_al2023_x86_repo)
100- sudo dnf -y --disablerepo=" *" --enablerepo=" cuda*" install dkms
101- sudo dnf config-manager --set-disabled cuda-amzn2023-x86_64
102- sudo rm /etc/yum.repos.d/cuda-amzn2023.repo
103- fi
104- fi
87+ # Install dkms from the cuda repo
88+ sudo dnf -y --disablerepo=" *" --enablerepo=" cuda*" install dkms
10589
10690function archive-open-kmods() {
10791 echo " Archiving open kmods"
0 commit comments