Skip to content

Commit ed626af

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

File tree

12 files changed

+1013
-1
lines changed

12 files changed

+1013
-1
lines changed

.common-ci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ trigger-pipeline:
9393
DIST: ubuntu22.04
9494
CVE_UPDATES: "openssl"
9595

96+
.dist-amzn2023:
97+
variables:
98+
DIST: amzn2023
99+
96100
.dist-rhel8:
97101
variables:
98102
DIST: rhel8
@@ -162,6 +166,14 @@ trigger-pipeline:
162166
rules:
163167
- if: $CI_PIPELINE_SOURCE != "schedule"
164168

169+
.release-amzn2023:
170+
# Perform for each DRIVER_VERSION
171+
extends:
172+
- .release-generic
173+
- .driver-versions
174+
rules:
175+
- if: $CI_PIPELINE_SOURCE != "schedule"
176+
165177
.release-rhel9:
166178
# Perform for each DRIVER_VERSION
167179
extends:
@@ -199,6 +211,15 @@ trigger-pipeline:
199211
OUT_REGISTRY: "${CI_REGISTRY}"
200212
OUT_IMAGE_NAME: "${CI_REGISTRY_IMAGE}/staging/driver"
201213

214+
.release:staging-amzn2023:
215+
extends:
216+
- .release-amzn2023
217+
variables:
218+
OUT_REGISTRY_USER: "${CI_REGISTRY_USER}"
219+
OUT_REGISTRY_TOKEN: "${CI_REGISTRY_PASSWORD}"
220+
OUT_REGISTRY: "${CI_REGISTRY}"
221+
OUT_IMAGE_NAME: "${CI_REGISTRY_IMAGE}/staging/driver"
222+
202223
.release:staging-rhel9:
203224
extends:
204225
- .release-rhel9

.github/workflows/image.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
dist:
4141
- ubuntu20.04
4242
- ubuntu22.04
43+
- amzn2023
4344
- rhel8
4445
ispr:
4546
- ${{github.event_name == 'pull_request'}}
@@ -50,6 +51,21 @@ jobs:
5051
- ispr: true
5152
dist: ubuntu20.04
5253
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
66+
- ispr: true
67+
dist: amzn2023
68+
driver: 560.35.03
5369
fail-fast: false
5470
steps:
5571
- 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
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: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,18 @@ image-rhel8:
184184
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
185185
- !reference [.pipeline-trigger-rules, rules]
186186

187+
.scan-amzn2023:
188+
# Repeat for each DRIVER_VERSION
189+
extends:
190+
- .driver-versions
191+
- .scan-generic
192+
rules:
193+
- !reference [.scan-rules-common, rules]
194+
- if: $CI_PIPELINE_SOURCE == "schedule"
195+
when: never
196+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
197+
- !reference [.pipeline-trigger-rules, rules]
198+
187199
.scan-precompiled-ubuntu22.04:
188200
variables:
189201
DIST: signed_ubuntu22.04
@@ -278,6 +290,12 @@ release:ngc-ubuntu22.04:
278290
- .dist-ubuntu22.04
279291
- .driver-versions
280292

293+
release:ngc-amzn2023:
294+
extends:
295+
- .release:ngc
296+
- .dist-amzn2023
297+
- .driver-versions
298+
281299
release:ngc-precompiled-ubuntu22.04:
282300
variables:
283301
DIST: signed_ubuntu22.04
@@ -439,3 +457,6 @@ sign:ngc-ubuntu-rhel-rhcos:
439457
- SIGN_JOB_NAME: ["rhcos"]
440458
VERSION: ["4.12","4.13","4.14","4.15", "4.16", "4.17"]
441459
DRIVER_VERSION: ["535.216.01", "550.127.05", "565.57.01"]
460+
- SIGN_JOB_NAME: ["amzn"]
461+
VERSION: ["2023"]
462+
DRIVER_VERSION: ["565.57.01"]

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 := amzn2023 flatcar fedora36 precompiled_rhcos rhel8 rhel9 signed_ubuntu20.04 signed_ubuntu22.04 sles15.3 ubuntu18.04 ubuntu20.04 ubuntu22.04
5858
PUSH_TARGETS := $(patsubst %, push-%, $(DISTRIBUTIONS))
5959
BASE_FROM := jammy focal
6060
PUSH_TARGETS := $(patsubst %, push-%, $(DISTRIBUTIONS))

amzn2023/Dockerfile

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
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+
# Remove cuda repository to avoid GPG errors
8+
RUN rm -f /etc/yum.repos.d/cuda*
9+
10+
RUN dnf update -y && dnf makecache && \
11+
dnf install -y \
12+
gcc \
13+
gcc-c++ \
14+
make \
15+
ca-certificates \
16+
git \
17+
tar && \
18+
dnf clean all && rm -rf /var/cache/yum/*
19+
20+
ENV GOLANG_VERSION=1.23.2
21+
22+
# download appropriate binary based on the target architecture for multi-arch builds
23+
RUN curl https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-${TARGETARCH}.tar.gz \
24+
| tar -C /usr/local -xz
25+
26+
ENV PATH /usr/local/bin:$PATH
27+
ENV PATH /usr/local/go/bin:$PATH
28+
29+
WORKDIR /work
30+
31+
RUN git clone https://github.com/NVIDIA/gpu-driver-container driver && \
32+
cd driver/vgpu/src && \
33+
go build -o vgpu-util && \
34+
mv vgpu-util /work
35+
36+
FROM nvcr.io/nvidia/cuda:12.6.2-base-amzn2023
37+
38+
SHELL ["/bin/bash", "-c"]
39+
40+
ARG BASE_URL=https://us.download.nvidia.com/tesla
41+
ARG TARGETARCH
42+
ENV TARGETARCH=$TARGETARCH
43+
ENV DRIVER_ARCH=${TARGETARCH/amd64/x86_64}
44+
ARG DRIVER_VERSION
45+
ENV DRIVER_VERSION=$DRIVER_VERSION
46+
47+
# Arg to indicate if driver type is either of passthrough(baremetal) or vgpu
48+
ARG DRIVER_TYPE=passthrough
49+
ENV DRIVER_TYPE=$DRIVER_TYPE
50+
ARG DRIVER_BRANCH=560
51+
ENV DRIVER_BRANCH=$DRIVER_BRANCH
52+
ARG VGPU_LICENSE_SERVER_TYPE=NLS
53+
ENV VGPU_LICENSE_SERVER_TYPE=$VGPU_LICENSE_SERVER_TYPE
54+
# Enable vGPU version compability check by default
55+
ARG DISABLE_VGPU_VERSION_CHECK=true
56+
ENV DISABLE_VGPU_VERSION_CHECK=$DISABLE_VGPU_VERSION_CHECK
57+
ENV NVIDIA_VISIBLE_DEVICES=void
58+
59+
RUN echo "TARGETARCH=$TARGETARCH"
60+
61+
ADD install.sh /tmp
62+
63+
RUN NVIDIA_GPGKEY_SUM=d0664fbbdb8c32356d45de36c5984617217b2d0bef41b93ccecd326ba3b80c87 && \
64+
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 && \
65+
echo "$NVIDIA_GPGKEY_SUM /etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA" | sha256sum -c --strict - && \
66+
curl -fsSL -o /etc/yum.repos.d/cuda.repo https://developer.download.nvidia.com/compute/cuda/repos/amzn2023/${DRIVER_ARCH}/cuda-amzn2023.repo
67+
68+
RUN dnf clean all && dnf makecache && dnf update -y && dnf install -y shadow-utils
69+
RUN /tmp/install.sh reposetup && /tmp/install.sh depinstall && \
70+
curl -fsSL -o /usr/local/bin/donkey https://github.com/3XX0/donkey/releases/download/v1.1.0/donkey && \
71+
chmod +x /usr/local/bin/donkey
72+
73+
COPY nvidia-driver /usr/local/bin
74+
COPY --from=build /work/vgpu-util /usr/local/bin
75+
76+
RUN curl -fsSL -o /usr/local/bin/extract-vmlinux https://raw.githubusercontent.com/torvalds/linux/master/scripts/extract-vmlinux && \
77+
chmod +x /usr/local/bin/extract-vmlinux
78+
79+
ADD drivers drivers/
80+
81+
# Fetch the installer automatically for passthrough/baremetal types
82+
RUN if [ "$DRIVER_TYPE" != "vgpu" ]; then \
83+
cd drivers && \
84+
/tmp/install.sh download_installer; fi
85+
86+
# Check for nvidia-fabric-manager or nvidia-fabricmanager availability and install
87+
RUN if [ "$DRIVER_TYPE" != "vgpu" ] && [ "$TARGETARCH" != "arm64" ]; then \
88+
# Initialize the fabric manager package variable
89+
FABRIC_PACKAGE=""; \
90+
if dnf list nvidia-fabric-manager-${DRIVER_VERSION}-1 &>/dev/null; then \
91+
FABRIC_PACKAGE="nvidia-fabric-manager-${DRIVER_VERSION}-1"; \
92+
elif dnf list nvidia-fabricmanager-${DRIVER_BRANCH}-${DRIVER_VERSION}-1 &>/dev/null; then \
93+
FABRIC_PACKAGE="nvidia-fabricmanager-${DRIVER_BRANCH}-${DRIVER_VERSION}-1"; \
94+
else \
95+
echo "Error: No suitable package found for fabric manager version ${DRIVER_VERSION}"; \
96+
exit 1; \
97+
fi; \
98+
dnf install -y "$FABRIC_PACKAGE" libnvidia-nscq-${DRIVER_BRANCH}-${DRIVER_VERSION}-1; fi
99+
100+
WORKDIR /drivers
101+
102+
ARG PUBLIC_KEY=empty
103+
COPY ${PUBLIC_KEY} kernel/pubkey.x509
104+
105+
# Remove cuda repository to avoid GPG errors
106+
# clean cache
107+
# Add NGC DL license from the CUDA image
108+
RUN rm -f /etc/yum.repos.d/cuda* && dnf clean all && \
109+
mkdir /licenses && mv /NGC-DL-CONTAINER-LICENSE /licenses/NGC-DL-CONTAINER-LICENSE
110+
111+
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: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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+
DRIVER_ARCH=${TARGETARCH/amd64/x86_64}
13+
dnf update -y && dnf install -y \
14+
gcc \
15+
make \
16+
glibc-devel \
17+
ca-certificates \
18+
kmod \
19+
file \
20+
elfutils-libelf-devel \
21+
libglvnd-devel \
22+
shadow-utils \
23+
util-linux \
24+
tar \
25+
rpm-build \
26+
dnf-utils \
27+
pkgconfig && \
28+
dnf clean all && \
29+
rm -rf /var/cache/yum/*
30+
fi
31+
}
32+
33+
repo_setup () {
34+
if [ "$TARGETARCH" = "amd64" ]; then
35+
echo "[cuda-amzn2023-x86_64]
36+
name=cuda-amzn2023-x86_64
37+
baseurl=https://developer.download.nvidia.com/compute/cuda/repos/amzn2023/$DRIVER_ARCH
38+
enabled=1
39+
gpgcheck=1
40+
gpgkey=https://developer.download.nvidia.com/compute/cuda/repos/amzn2023/$DRIVER_ARCH/D42D0685.pub" > /etc/yum.repos.d/cuda.repo && \
41+
usermod -o -u 0 -g 0 nobody
42+
else
43+
echo "TARGETARCH doesn't match a known arch target"
44+
exit 1
45+
fi
46+
}
47+
48+
if [ "$1" = "reposetup" ]; then
49+
repo_setup
50+
elif [ "$1" = "depinstall" ]; then
51+
dep_install
52+
elif [ "$1" = "download_installer" ]; then
53+
download_installer
54+
else
55+
echo "Unknown function: $1"
56+
exit 1
57+
fi
58+

0 commit comments

Comments
 (0)