forked from NVIDIA/gpu-driver-container
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·100 lines (96 loc) · 3.02 KB
/
install.sh
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
#!/bin/bash
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved.
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 \
gcc \
glibc.i686 \
make \
cpio \
kmod \
jq
elif [ "$DRIVER_ARCH" = "ppc64le" ]; then
dnf install -y \
libglvnd-glx \
ca-certificates \
curl \
gcc \
glibc \
make \
cpio \
kmod \
jq
elif [ "$DRIVER_ARCH" = "aarch64" ]; then
dnf install -y \
libglvnd-glx \
ca-certificates \
curl \
gcc \
glibc \
make \
cpio \
kmod \
jq
fi
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
}
if [ "$1" = "nvinstall" ]; then
nvidia_installer
elif [ "$1" = "depinstall" ]; then
dep_installer
else
echo "Unknown function: $1"
fi