-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·172 lines (157 loc) · 5.01 KB
/
install.sh
File metadata and controls
executable file
·172 lines (157 loc) · 5.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
#!/bin/bash
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved.
set -eu
DRIVER_ARCH=${TARGETARCH/amd64/x86_64} && DRIVER_ARCH=${DRIVER_ARCH/arm64/aarch64}
echo "DRIVER_ARCH is $DRIVER_ARCH"
dep_installer () {
if [ "$DRIVER_ARCH" = "x86_64" ]; then
dnf install -y \
libglvnd-glx \
ca-certificates \
curl-minimal \
gcc \
glibc.i686 \
make \
cpio \
kmod
elif [ "$DRIVER_ARCH" = "ppc64le" ]; then
dnf install -y \
libglvnd-glx \
ca-certificates \
curl-minimal \
gcc \
glibc \
make \
cpio \
kmod
elif [ "$DRIVER_ARCH" = "aarch64" ]; then
dnf install -y \
libglvnd-glx \
ca-certificates \
curl-minimal \
gcc \
glibc \
make \
cpio \
kmod
fi
# Download unzboot as kernel images are compressed in the zboot format on RHEL 9 arm64
# unzboot is only available on the EPEL RPM repo
rpm --import https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-9
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
dnf config-manager --enable epel
dnf install -y unzboot
rm -rf /var/cache/yum/*
}
nvidia_installer () {
if [ "$DRIVER_ARCH" = "x86_64" ]; then
./nvidia-installer --silent \
--no-kernel-module \
--install-compat32-libs \
--no-nouveau-check \
--no-nvidia-modprobe \
--no-rpms \
--no-backup \
--no-check-for-alternate-installs \
--no-libglx-indirect \
--no-install-libglvnd \
--x-prefix=/tmp/null \
--x-module-path=/tmp/null \
--x-library-path=/tmp/null \
--x-sysconfig-path=/tmp/null
elif [ "$DRIVER_ARCH" = "ppc64le" ]; then
./nvidia-installer --silent \
--no-kernel-module \
--no-nouveau-check \
--no-nvidia-modprobe \
--no-rpms \
--no-backup \
--no-check-for-alternate-installs \
--no-libglx-indirect \
--no-install-libglvnd \
--x-prefix=/tmp/null \
--x-module-path=/tmp/null \
--x-library-path=/tmp/null \
--x-sysconfig-path=/tmp/null
elif [ "$DRIVER_ARCH" = "aarch64" ]; then
./nvidia-installer --silent \
--no-kernel-module \
--no-nouveau-check \
--no-nvidia-modprobe \
--no-rpms \
--no-backup \
--no-check-for-alternate-installs \
--no-libglx-indirect \
--no-install-libglvnd \
--x-prefix=/tmp/null \
--x-module-path=/tmp/null \
--x-library-path=/tmp/null \
--x-sysconfig-path=/tmp/null
else
echo "DRIVER_ARCH doesn't match a known arch target"
fi
}
fabricmanager_install() {
if [ "$DRIVER_BRANCH" -ge "580" ]; then
dnf install -y nvidia-fabricmanager-${DRIVER_VERSION}
else
dnf install -y nvidia-fabric-manager-${DRIVER_VERSION}
fi
}
nscq_install() {
if [ "$DRIVER_BRANCH" -ge "580" ]; then
dnf install -y libnvidia-nscq-${DRIVER_VERSION}
else
dnf install -y libnvidia-nscq-${DRIVER_BRANCH}-${DRIVER_VERSION}
fi
}
# libnvsdm packages are not available for arm64
nvsdm_install() {
if [ "$TARGETARCH" = "amd64" ]; then
if [ "$DRIVER_BRANCH" -ge "580" ]; then
dnf install -y libnvsdm-${DRIVER_VERSION}
return 0
fi
if [ "$DRIVER_BRANCH" -ge "570" ]; then
dnf install -y libnvsdm-${DRIVER_BRANCH}-${DRIVER_VERSION}
return 0
fi
fi
}
nvlink5_pkgs_install() {
if [ "$DRIVER_BRANCH" -ge "550" ]; then
dnf install -y infiniband-diags nvlsm
fi
}
imex_install() {
if [ "$DRIVER_BRANCH" -ge "580" ]; then
dnf install -y nvidia-imex-${DRIVER_VERSION}
elif [ "$DRIVER_BRANCH" -ge "550" ]; then
dnf install -y nvidia-imex-${DRIVER_BRANCH}-${DRIVER_VERSION}
fi
}
extra_pkgs_install() {
if [ "$DRIVER_TYPE" != "vgpu" ]; then
dnf module enable -y nvidia-driver:${DRIVER_BRANCH}-dkms
fabricmanager_install
nscq_install
nvsdm_install
nvlink5_pkgs_install
imex_install
fi
}
setup_cuda_repo() {
OS_ARCH=${TARGETARCH/amd64/x86_64} && OS_ARCH=${OS_ARCH/arm64/sbsa};
dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel9/${OS_ARCH}/cuda-rhel9.repo
}
if [ "$1" = "nvinstall" ]; then
nvidia_installer
elif [ "$1" = "depinstall" ]; then
dep_installer
elif [ "$1" = "extrapkgsinstall" ]; then
extra_pkgs_install
elif [ "$1" = "setup_cuda_repo" ]; then
setup_cuda_repo
else
echo "Unknown function: $1"
fi