Skip to content

Commit 6d553ac

Browse files
committed
amazon linux 2023 support
1 parent c610352 commit 6d553ac

File tree

16 files changed

+1277
-2
lines changed

16 files changed

+1277
-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: [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: 14 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,18 @@ 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
63+
- ispr: true
64+
dist: amzn2023
65+
driver: 550.127.05
5266
fail-fast: false
5367
steps:
5468
- 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: 20 additions & 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))
@@ -92,6 +92,10 @@ pull-signed_ubuntu22.04%: DIST = ubuntu22.04
9292
pull-signed_ubuntu22.04%: DRIVER_TAG = $(DRIVER_BRANCH)
9393
pull-signed_ubuntu22.04%: IMAGE_TAG = $(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
9494

95+
pull-signed_amzn2023%: DIST = amzn2023
96+
pull-signed_amzn2023%: DRIVER_TAG = $(DRIVER_BRANCH)
97+
pull-signed_amzn2023%: IMAGE_TAG = $(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
98+
9599
PLATFORM ?= linux/amd64
96100
$(DRIVER_PULL_TARGETS): pull-%:
97101
$(DOCKER) pull "--platform=$(PLATFORM)" "$(IMAGE)"
@@ -109,6 +113,10 @@ archive-signed_ubuntu22.04%: DIST = ubuntu22.04
109113
archive-signed_ubuntu22.04%: DRIVER_TAG = $(DRIVER_BRANCH)
110114
archive-signed_ubuntu22.04%: IMAGE_TAG = $(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
111115

116+
archive-signed_amzn2023%: DIST = amzn2023
117+
archive-signed_amzn2023%: DRIVER_TAG = $(DRIVER_BRANCH)
118+
archive-signed_amzn2023%: IMAGE_TAG = $(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
119+
112120
$(DRIVER_ARCHIVE_TARGETS): archive-%:
113121
$(DOCKER) save "$(IMAGE)" -o "archive.tar"
114122

@@ -130,6 +138,11 @@ push-signed_ubuntu22.04%: DRIVER_TAG = $(DRIVER_BRANCH)
130138
push-signed_ubuntu22.04%: IMAGE_TAG = $(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
131139
push-signed_ubuntu22.04%: OUT_IMAGE_TAG = $(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
132140

141+
push-signed_amzn2023%: DIST = amzn2023
142+
push-signed_amzn2023%: DRIVER_TAG = $(DRIVER_BRANCH)
143+
push-signed_amzn2023%: IMAGE_TAG = $(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
144+
push-signed_amzn2023%: OUT_IMAGE_TAG = $(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
145+
133146
# $(DRIVER_BUILD_TARGETS) is in the form of build-$(DIST)-$(DRIVER_VERSION)
134147
# Parse the target to set the required variables.
135148
build-%: DIST = $(word 2,$(subst -, ,$@))
@@ -176,6 +189,12 @@ build-signed_ubuntu22.04%: DRIVER_TAG = $(DRIVER_BRANCH)
176189
build-signed_ubuntu22.04%: IMAGE_TAG = $(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
177190
build-signed_ubuntu22.04%: DOCKER_BUILD_ARGS = --build-arg KERNEL_VERSION="$(KERNEL_VERSION)"
178191

192+
# amzn2023 Precompiled Driver
193+
build-signed_amzn2023%: DIST = amzn2023
194+
build-signed_amzn2023%: DRIVER_TAG = $(DRIVER_BRANCH)
195+
build-signed_amzn2023%: IMAGE_TAG = $(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
196+
build-signed_amzn2023%: DOCKER_BUILD_ARGS = --build-arg KERNEL_VERSION="$(KERNEL_VERSION)"
197+
179198
# base is an image used to poll Canonical for the latest kernel version
180199
build-base-%: DOCKERFILE = $(CURDIR)/base/Dockerfile
181200
build-base-%: TARGET = $(word 3,$(subst -, ,$@))

amzn2023/Dockerfile

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

0 commit comments

Comments
 (0)