Skip to content

Commit 3d7b0bb

Browse files
committed
amazon linux 2023 support
Signed-off-by: shiva kumar <[email protected]>
1 parent c610352 commit 3d7b0bb

File tree

13 files changed

+1017
-2
lines changed

13 files changed

+1017
-2
lines changed

.common-ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ trigger-pipeline:
8181
matrix:
8282
- DRIVER_VERSION: [535.216.01, 550.127.05]
8383

84+
# Define the driver versions for jobs that can be run in parallel for amzn2023
85+
.driver-versions-amzn2023:
86+
parallel:
87+
matrix:
88+
- DRIVER_VERSION: [535.216.01, 560.35.03]
89+
8490
# Define the matrix of precompiled jobs that can be run in parallel for ubuntu22.04
8591
.driver-versions-precompiled-ubuntu22.04:
8692
parallel:
@@ -105,6 +111,10 @@ trigger-pipeline:
105111
DIST: ubuntu22.04
106112
CVE_UPDATES: "openssl"
107113

114+
.dist-amzn2023:
115+
variables:
116+
DIST: amzn2023
117+
108118
.dist-rhel8:
109119
variables:
110120
DIST: rhel8
@@ -174,6 +184,14 @@ trigger-pipeline:
174184
rules:
175185
- if: $CI_PIPELINE_SOURCE != "schedule"
176186

187+
.release-amzn2023:
188+
# Perform for each DRIVER_VERSION
189+
extends:
190+
- .release-generic
191+
- .driver-versions-amzn2023
192+
rules:
193+
- if: $CI_PIPELINE_SOURCE != "schedule"
194+
177195
.release-rhel9:
178196
# Perform for each DRIVER_VERSION
179197
extends:
@@ -211,6 +229,15 @@ trigger-pipeline:
211229
OUT_REGISTRY: "${CI_REGISTRY}"
212230
OUT_IMAGE_NAME: "${CI_REGISTRY_IMAGE}/staging/driver"
213231

232+
.release:staging-amzn2023:
233+
extends:
234+
- .release-amzn2023
235+
variables:
236+
OUT_REGISTRY_USER: "${CI_REGISTRY_USER}"
237+
OUT_REGISTRY_TOKEN: "${CI_REGISTRY_PASSWORD}"
238+
OUT_REGISTRY: "${CI_REGISTRY}"
239+
OUT_IMAGE_NAME: "${CI_REGISTRY_IMAGE}/staging/driver"
240+
214241
.release:staging-rhel9:
215242
extends:
216243
- .release-rhel9

.github/workflows/image.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ jobs:
3636
driver:
3737
- 535.216.01
3838
- 550.127.05
39+
- 560.35.03
3940
dist:
4041
- ubuntu20.04
4142
- ubuntu22.04
43+
- amzn2023
4244
- rhel8
4345
ispr:
4446
- ${{github.event_name == 'pull_request'}}
@@ -49,6 +51,15 @@ jobs:
4951
- ispr: true
5052
dist: ubuntu20.04
5153
driver: 550.127.05
54+
- ispr: true
55+
dist: ubuntu20.04
56+
driver: 560.35.03
57+
- ispr: true
58+
dist: ubuntu22.04
59+
driver: 560.35.03
60+
- ispr: true
61+
dist: amzn2023
62+
driver: 535.216.01
5263
fail-fast: false
5364
steps:
5465
- uses: actions/checkout@v4

.gitlab-ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,15 @@ include:
4949
rules:
5050
- if: $CI_PIPELINE_SOURCE != "schedule"
5151

52+
# Define the image build targets
53+
.image-build-amzn2023:
54+
# Perform for each DRIVER_VERSION
55+
extends:
56+
- .driver-versions-amzn2023
57+
- .image-build-generic
58+
rules:
59+
- if: $CI_PIPELINE_SOURCE != "schedule"
60+
5261
# Define the image build targets
5362
.image-build-rhel9:
5463
# Perform for each DRIVER_VERSION
@@ -69,6 +78,11 @@ image-ubuntu22.04:
6978
- .image-build-ubuntu22.04
7079
- .dist-ubuntu22.04
7180

81+
image-amzn2023:
82+
extends:
83+
- .image-build-amzn2023
84+
- .dist-amzn2023
85+
7286
image-rhel8:
7387
extends:
7488
- .image-build

.nvidia-ci.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ image-rhel8:
115115
- .image-pull
116116
- .dist-rhel8
117117

118+
image-amzn2023:
119+
extends:
120+
- .image-pull
121+
- .dist-amzn2023
122+
- .driver-versions-amzn2023
123+
118124
# The .scan step forms the base of the image scan operation performed before releasing
119125
# images.
120126
.scan-generic:
@@ -184,6 +190,18 @@ image-rhel8:
184190
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
185191
- !reference [.pipeline-trigger-rules, rules]
186192

193+
.scan-amzn2023:
194+
# Repeat for each DRIVER_VERSION
195+
extends:
196+
- .driver-versions-amzn2023
197+
- .scan-generic
198+
rules:
199+
- !reference [.scan-rules-common, rules]
200+
- if: $CI_PIPELINE_SOURCE == "schedule"
201+
when: never
202+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
203+
- !reference [.pipeline-trigger-rules, rules]
204+
187205
.scan-precompiled-ubuntu22.04:
188206
variables:
189207
DIST: signed_ubuntu22.04
@@ -229,6 +247,14 @@ scan-ubuntu22.04-arm64:
229247
needs:
230248
- image-ubuntu22.04
231249

250+
scan-amzn2023-amd64:
251+
extends:
252+
- .scan-amzn2023
253+
- .dist-amzn2023
254+
- .platform-amd64
255+
needs:
256+
- image-amzn2023
257+
232258
scan-precompiled-ubuntu22.04-amd64:
233259
variables:
234260
PLATFORM: linux/amd64
@@ -278,6 +304,12 @@ release:ngc-ubuntu22.04:
278304
- .dist-ubuntu22.04
279305
- .driver-versions-ubuntu22.04
280306

307+
release:ngc-amzn2023:
308+
extends:
309+
- .release:ngc
310+
- .dist-amzn2023
311+
- .driver-versions-amzn2023
312+
281313
release:ngc-precompiled-ubuntu22.04:
282314
variables:
283315
DIST: signed_ubuntu22.04
@@ -439,3 +471,6 @@ sign:ngc-ubuntu-rhel-rhcos:
439471
- SIGN_JOB_NAME: ["rhcos"]
440472
VERSION: ["4.12","4.13","4.14","4.15", "4.16", "4.17"]
441473
DRIVER_VERSION: ["535.216.01", "550.127.05"]
474+
- SIGN_JOB_NAME: ["amzn"]
475+
VERSION: ["2023"]
476+
DRIVER_VERSION: ["560.35.03"]

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ OUT_IMAGE_TAG = $(OUT_IMAGE_VERSION)-$(OUT_DIST)
5454
OUT_IMAGE = $(OUT_IMAGE_NAME):$(OUT_IMAGE_TAG)
5555

5656
##### Public rules #####
57-
DISTRIBUTIONS := ubuntu18.04 ubuntu20.04 ubuntu22.04 signed_ubuntu20.04 signed_ubuntu22.04 rhel8 rhel9 flatcar fedora36 sles15.3 precompiled_rhcos
57+
DISTRIBUTIONS := ubuntu18.04 ubuntu20.04 ubuntu22.04 amzn2023 signed_ubuntu20.04 signed_ubuntu22.04 rhel8 rhel9 flatcar fedora36 sles15.3 precompiled_rhcos
5858
PUSH_TARGETS := $(patsubst %, push-%, $(DISTRIBUTIONS))
5959
BASE_FROM := jammy focal
6060
PUSH_TARGETS := $(patsubst %, push-%, $(DISTRIBUTIONS))

amzn2023/Dockerfile

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
FROM nvcr.io/nvidia/cuda:12.6.2-base-amzn2023 AS build
2+
3+
ARG TARGETARCH
4+
5+
SHELL ["/bin/bash", "-c"]
6+
7+
RUN dnf update -y && \
8+
dnf install -y \
9+
gcc \
10+
gcc-c++ \
11+
make \
12+
ca-certificates \
13+
git \
14+
tar && \
15+
dnf clean all
16+
17+
ENV GOLANG_VERSION=1.23.2
18+
19+
# download appropriate binary based on the target architecture for multi-arch builds
20+
RUN curl https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-${TARGETARCH}.tar.gz \
21+
| tar -C /usr/local -xz
22+
23+
ENV PATH /usr/local/bin:$PATH
24+
ENV PATH /usr/local/go/bin:$PATH
25+
26+
WORKDIR /work
27+
28+
RUN git clone https://github.com/NVIDIA/gpu-driver-container driver && \
29+
cd driver/vgpu/src && \
30+
go build -o vgpu-util && \
31+
mv vgpu-util /work
32+
33+
FROM nvcr.io/nvidia/cuda:12.6.2-base-amzn2023
34+
35+
SHELL ["/bin/bash", "-c"]
36+
37+
ARG BASE_URL=https://us.download.nvidia.com/tesla
38+
ARG TARGETARCH
39+
ENV TARGETARCH=$TARGETARCH
40+
ENV DRIVER_ARCH=${TARGETARCH/amd64/x86_64}
41+
ARG DRIVER_VERSION
42+
ENV DRIVER_VERSION=$DRIVER_VERSION
43+
44+
# Arg to indicate if driver type is either of passthrough(baremetal) or vgpu
45+
ARG DRIVER_TYPE=passthrough
46+
ENV DRIVER_TYPE=$DRIVER_TYPE
47+
ARG DRIVER_BRANCH=550
48+
ENV DRIVER_BRANCH=$DRIVER_BRANCH
49+
ARG VGPU_LICENSE_SERVER_TYPE=NLS
50+
ENV VGPU_LICENSE_SERVER_TYPE=$VGPU_LICENSE_SERVER_TYPE
51+
# Enable vGPU version compability check by default
52+
ARG DISABLE_VGPU_VERSION_CHECK=true
53+
ENV DISABLE_VGPU_VERSION_CHECK=$DISABLE_VGPU_VERSION_CHECK
54+
ENV NVIDIA_VISIBLE_DEVICES=void
55+
56+
RUN echo "TARGETARCH=$TARGETARCH"
57+
58+
ADD install.sh /tmp
59+
60+
RUN NVIDIA_GPGKEY_SUM=d0664fbbdb8c32356d45de36c5984617217b2d0bef41b93ccecd326ba3b80c87 && \
61+
curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/amzn2023/${DRIVER_ARCH}/D42D0685.pub | sed '/^Version/d' > /etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA && \
62+
echo "$NVIDIA_GPGKEY_SUM /etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA" | sha256sum -c --strict - && \
63+
curl -fsSL -o /etc/yum.repos.d/cuda-amzn2023.repo https://developer.download.nvidia.com/compute/cuda/repos/amzn2023/${DRIVER_ARCH}/cuda-amzn2023.repo
64+
65+
RUN dnf clean all && dnf update -y && dnf install -y shadow-utils
66+
RUN /tmp/install.sh reposetup && /tmp/install.sh depinstall && \
67+
curl -fsSL -o /usr/local/bin/donkey https://github.com/3XX0/donkey/releases/download/v1.1.0/donkey && \
68+
chmod +x /usr/local/bin/donkey
69+
70+
COPY nvidia-driver /usr/local/bin
71+
COPY --from=build /work/vgpu-util /usr/local/bin
72+
73+
RUN curl -fsSL -o /usr/local/bin/extract-vmlinux https://raw.githubusercontent.com/torvalds/linux/master/scripts/extract-vmlinux && \
74+
chmod +x /usr/local/bin/extract-vmlinux
75+
76+
ADD drivers drivers/
77+
78+
# Fetch the installer automatically for passthrough/baremetal types
79+
RUN if [ "$DRIVER_TYPE" != "vgpu" ]; then \
80+
cd drivers && \
81+
/tmp/install.sh download_installer; fi
82+
83+
RUN if [ "$DRIVER_TYPE" != "vgpu" ] && [ "$TARGETARCH" != "arm64" ]; then \
84+
dnf update -y && \
85+
dnf install -y \
86+
nvidia-fabric-manager-${DRIVER_VERSION}-1 \
87+
libnvidia-nscq-${DRIVER_BRANCH}-${DRIVER_VERSION}-1; fi
88+
89+
WORKDIR /drivers
90+
91+
ARG PUBLIC_KEY=empty
92+
COPY ${PUBLIC_KEY} kernel/pubkey.x509
93+
94+
RUN dnf clean all
95+
96+
# Add NGC DL license from the CUDA image
97+
RUN mkdir /licenses && mv /NGC-DL-CONTAINER-LICENSE /licenses/NGC-DL-CONTAINER-LICENSE
98+
99+
ENTRYPOINT ["nvidia-driver", "init"]

amzn2023/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# AmazonLinux2 [![build status](https://gitlab.com/nvidia/driver/badges/master/build.svg)](https://gitlab.com/nvidia/driver/commits/master)
2+
3+
See https://github.com/NVIDIA/nvidia-docker/wiki/Driver-containers-(Beta)

amzn2023/drivers/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Folder for downloading vGPU drivers and dependent metadata files

amzn2023/empty

Whitespace-only changes.

amzn2023/install.sh

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/usr/bin/env bash
2+
3+
set -eu
4+
5+
download_installer () {
6+
DRIVER_ARCH=${TARGETARCH/amd64/x86_64} && curl -fSsl -O $BASE_URL/$DRIVER_VERSION/NVIDIA-Linux-$DRIVER_ARCH-$DRIVER_VERSION.run && \
7+
chmod +x NVIDIA-Linux-$DRIVER_ARCH-$DRIVER_VERSION.run;
8+
}
9+
10+
dep_install () {
11+
if [ "$TARGETARCH" = "amd64" ]; then
12+
dnf update -y && dnf install -y \
13+
gcc \
14+
make \
15+
glibc-devel \
16+
ca-certificates \
17+
kmod \
18+
file \
19+
elfutils-libelf-devel \
20+
libglvnd-devel \
21+
shadow-utils \
22+
util-linux \
23+
tar \
24+
rpm-build \
25+
dnf-utils \
26+
pkgconfig \
27+
nvidia-container-runtime \
28+
nvidia-container-toolkit \
29+
libnvidia-container-tools \
30+
libnvidia-container1 && \
31+
dnf clean all
32+
fi
33+
}
34+
35+
repo_setup () {
36+
if [ "$TARGETARCH" = "amd64" ]; then
37+
echo "[nvidia]
38+
name=Main Repository
39+
baseurl=https://developer.download.nvidia.com/compute/cuda/repos/amzn2023/$DRIVER_ARCH
40+
gpgcheck=1
41+
enabled=1
42+
gpgkey=https://developer.download.nvidia.com/compute/cuda/repos/amzn2023/$DRIVER_ARCH/D42D0685.pub" > /etc/yum.repos.d/nvidia.repo && \
43+
usermod -o -u 0 -g 0 nobody
44+
else
45+
echo "TARGETARCH doesn't match a known arch target"
46+
exit 1
47+
fi
48+
}
49+
50+
if [ "$1" = "reposetup" ]; then
51+
repo_setup
52+
elif [ "$1" = "depinstall" ]; then
53+
dep_install
54+
elif [ "$1" = "download_installer" ]; then
55+
download_installer
56+
else
57+
echo "Unknown function: $1"
58+
exit 1
59+
fi
60+

0 commit comments

Comments
 (0)