Skip to content

Commit 74b2554

Browse files
committed
amazon linux 2023 support
Signed-off-by: shiva kumar <[email protected]>
1 parent 2014a3a commit 74b2554

File tree

11 files changed

+968
-2
lines changed

11 files changed

+968
-2
lines changed

.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: 535.216.01
5266
fail-fast: false
5367
steps:
5468
- uses: actions/checkout@v4

.nvidia-ci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ variables:
8080
.image-pull-ubuntu22.04:
8181
# Perform for each DRIVER_VERSION
8282
extends:
83+
- .driver-versions
8384
- .driver-versions
8485
- .image-pull-generic
8586
rules:
@@ -184,6 +185,18 @@ image-rhel8:
184185
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
185186
- !reference [.pipeline-trigger-rules, rules]
186187

188+
.scan-amzn2023:
189+
# Repeat for each DRIVER_VERSION
190+
extends:
191+
- .driver-versions-amzn2023
192+
- .scan-generic
193+
rules:
194+
- !reference [.scan-rules-common, rules]
195+
- if: $CI_PIPELINE_SOURCE == "schedule"
196+
when: never
197+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
198+
- !reference [.pipeline-trigger-rules, rules]
199+
187200
.scan-precompiled-ubuntu22.04:
188201
variables:
189202
DIST: signed_ubuntu22.04
@@ -278,6 +291,12 @@ release:ngc-ubuntu22.04:
278291
- .dist-ubuntu22.04
279292
- .driver-versions
280293

294+
release:ngc-amzn2023:
295+
extends:
296+
- .release:ngc
297+
- .dist-amzn2023
298+
- .driver-versions-amzn2023
299+
281300
release:ngc-precompiled-ubuntu22.04:
282301
variables:
283302
DIST: signed_ubuntu22.04

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: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
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+
# install fabric-manager and nvidia-nscq
87+
RUN if [ "$DRIVER_TYPE" != "vgpu" ] && [ "$TARGETARCH" != "arm64" ]; then \
88+
dnf install -y nvidia-fabric-manager-${DRIVER_VERSION}-1 libnvidia-nscq-${DRIVER_BRANCH}-${DRIVER_VERSION}-1; fi
89+
90+
WORKDIR /drivers
91+
92+
ARG PUBLIC_KEY=empty
93+
COPY ${PUBLIC_KEY} kernel/pubkey.x509
94+
95+
# Remove cuda repository to avoid GPG errors
96+
RUN rm -f /etc/yum.repos.d/cuda*
97+
RUN dnf clean all
98+
99+
# Add NGC DL license from the CUDA image
100+
RUN mkdir /licenses && mv /NGC-DL-CONTAINER-LICENSE /licenses/NGC-DL-CONTAINER-LICENSE
101+
102+
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 -eux
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)