Skip to content

Commit 7cb0b27

Browse files
committed
amazon linux 2023 support
1 parent d06fa8c commit 7cb0b27

File tree

15 files changed

+1271
-5
lines changed

15 files changed

+1271
-5
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.183.06, 550.90.12, 560.35.03]
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: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ on:
2121
- opened
2222
- synchronize
2323
branches:
24-
- main
25-
- release-*
24+
- main-no
25+
- release-no
2626
push:
2727
branches:
28-
- main
29-
- release-*
28+
- main-no
29+
- release-no
3030

3131
jobs:
3232
image:
@@ -40,6 +40,7 @@ jobs:
4040
dist:
4141
- ubuntu20.04
4242
- ubuntu22.04
43+
- amzn2023
4344
- rhel8
4445
- rhel9
4546
ispr:
@@ -53,6 +54,10 @@ jobs:
5354
- ispr: true
5455
dist: ubuntu20.04
5556
driver: 550.90.12
57+
- dist: amzn2023
58+
driver: 535.183.06
59+
- dist: amzn2023
60+
driver: 550.90.12
5661
fail-fast: false
5762
steps:
5863
- 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
@@ -121,6 +121,12 @@ image-rhel9:
121121
- .dist-rhel9
122122
- .driver-versions-rhel9
123123

124+
image-amzn2023:
125+
extends:
126+
- .image-pull
127+
- .dist-amzn2023
128+
- .driver-versions-amzn2023
129+
124130
# The .scan step forms the base of the image scan operation performed before releasing
125131
# images.
126132
.scan-generic:
@@ -190,6 +196,18 @@ image-rhel9:
190196
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
191197
- !reference [.pipeline-trigger-rules, rules]
192198

199+
.scan-amzn2023:
200+
# Repeat for each DRIVER_VERSION
201+
extends:
202+
- .driver-versions-amzn2023
203+
- .scan-generic
204+
rules:
205+
- !reference [.scan-rules-common, rules]
206+
- if: $CI_PIPELINE_SOURCE == "schedule"
207+
when: never
208+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
209+
- !reference [.pipeline-trigger-rules, rules]
210+
193211
.scan-precompiled-ubuntu22.04:
194212
variables:
195213
DIST: signed_ubuntu22.04
@@ -235,6 +253,14 @@ scan-ubuntu22.04-arm64:
235253
needs:
236254
- image-ubuntu22.04
237255

256+
scan-amzn2023-amd64:
257+
extends:
258+
- .scan-amzn2023
259+
- .dist-amzn2023
260+
- .platform-amd64
261+
needs:
262+
- image-amzn2023
263+
238264
scan-precompiled-ubuntu22.04-amd64:
239265
variables:
240266
PLATFORM: linux/amd64
@@ -302,6 +328,12 @@ release:ngc-ubuntu22.04:
302328
- .dist-ubuntu22.04
303329
- .driver-versions-ubuntu22.04
304330

331+
release:ngc-amzn2023:
332+
extends:
333+
- .release:ngc
334+
- .dist-amzn2023
335+
- .driver-versions-amzn2023
336+
305337
release:ngc-precompiled-ubuntu22.04:
306338
variables:
307339
DIST: signed_ubuntu22.04
@@ -478,6 +510,9 @@ sign:ngc-ubuntu-rhel-rhcos:
478510
- SIGN_JOB_NAME: ["ubuntu"]
479511
VERSION: ["20.04"]
480512
DRIVER_VERSION: ["535.183.06", "550.90.12", "560.35.03"]
513+
- SIGN_JOB_NAME: ["amzn"]
514+
VERSION: ["2023"]
515+
DRIVER_VERSION: ["560.35.03"]
481516
- SIGN_JOB_NAME: ["rhel"]
482517
VERSION: ["8.8", "8.10"]
483518
DRIVER_VERSION: ["535.183.06", "550.90.12", "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 -, ,$@))
@@ -175,6 +188,12 @@ build-signed_ubuntu22.04%: DRIVER_TAG = $(DRIVER_BRANCH)
175188
build-signed_ubuntu22.04%: IMAGE_TAG = $(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
176189
build-signed_ubuntu22.04%: DOCKER_BUILD_ARGS = --build-arg KERNEL_VERSION="$(KERNEL_VERSION)"
177190

191+
# amzn2023 Precompiled Driver
192+
build-signed_amzn2023%: DIST = amzn2023
193+
build-signed_amzn2023%: DRIVER_TAG = $(DRIVER_BRANCH)
194+
build-signed_amzn2023%: IMAGE_TAG = $(DRIVER_BRANCH)-$(KERNEL_VERSION)-$(DIST)
195+
build-signed_amzn2023%: DOCKER_BUILD_ARGS = --build-arg KERNEL_VERSION="$(KERNEL_VERSION)"
196+
178197
# base is an image used to poll Canonical for the latest kernel version
179198
build-base-%: DOCKERFILE = $(CURDIR)/base/Dockerfile
180199
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)