Skip to content

Commit c7ce51a

Browse files
Shiva Kumarshivakunv
authored andcommitted
Support Data Center precompiled driver container for Arm (Ubuntu 24.04)
Signed-off-by: Shiva Kumar (SW-CLOUD) <[email protected]>
1 parent 55d2ea9 commit c7ce51a

11 files changed

Lines changed: 210 additions & 177 deletions

File tree

.github/workflows/image.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,5 +200,11 @@ jobs:
200200
PRECOMPILED: "true"
201201
DIST: signed_${{ matrix.dist }}
202202
run: |
203-
source kernel_version.txt && \
203+
source kernel_version.txt
204+
# arm64 does not support azure-fde (package linux-objects-nvidia-*-azure-fde not available for arm64)
205+
if [[ "${{ matrix.dist }}" == "ubuntu24.04" ]] && [[ "${{ matrix.flavor }}" != "azure-fde" ]]; then
206+
export DOCKER_BUILD_PLATFORM_OPTIONS="--platform=linux/amd64,linux/arm64"
207+
else
208+
export DOCKER_BUILD_PLATFORM_OPTIONS="--platform=linux/amd64"
209+
fi
204210
make DRIVER_VERSIONS=${DRIVER_VERSIONS} DRIVER_BRANCH=${{ matrix.driver }} build-${DIST}-${DRIVER_VERSION}

.github/workflows/precompiled.yaml

Lines changed: 139 additions & 95 deletions
Large diffs are not rendered by default.

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,13 @@ build-%: DOCKERFILE = $(CURDIR)/$(SUBDIR)/Dockerfile
160160
# build-ubuntu20.04-$(DRIVER_VERSION) triggers a build for a specific $(DRIVER_VERSION)
161161
$(DISTRIBUTIONS): %: build-%
162162
$(BUILD_TARGETS): %: $(foreach driver_version, $(DRIVER_VERSIONS), $(addprefix %-, $(driver_version)))
163+
DRIVER_BUILD_TAG = $(if $(findstring type=oci,$(DOCKER_BUILD_OPTIONS)),,--tag $(IMAGE))
163164
$(DRIVER_BUILD_TARGETS):
164165
DOCKER_BUILDKIT=1 \
165166
$(DOCKER) $(BUILDX) build --pull \
166167
$(DOCKER_BUILD_OPTIONS) \
167168
$(DOCKER_BUILD_PLATFORM_OPTIONS) \
168-
--tag $(IMAGE) \
169+
$(DRIVER_BUILD_TAG) \
169170
--build-arg DRIVER_VERSION="$(DRIVER_VERSION)" \
170171
--build-arg GOLANG_VERSION="$(GOLANG_VERSION)" \
171172
--build-arg DRIVER_BRANCH="$(DRIVER_BRANCH)" \
@@ -215,6 +216,7 @@ $(BASE_BUILD_TARGETS):
215216
DOCKER_BUILDKIT=1 \
216217
$(DOCKER) $(BUILDX) build --pull --no-cache \
217218
$(DOCKER_BUILD_OPTIONS) \
219+
$(DOCKER_BUILD_PLATFORM_OPTIONS) \
218220
--tag $(IMAGE) \
219221
--target $(TARGET) \
220222
--build-arg CUDA_VERSION="$(CUDA_VERSION)" \

multi-arch.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,4 @@ $(DRIVER_PUSH_TARGETS): push-%:
2727
build-ubuntu18.04%: DOCKER_BUILD_PLATFORM_OPTIONS = --platform=linux/amd64
2828
build-signed_ubuntu20.04%: DOCKER_BUILD_PLATFORM_OPTIONS = --platform=linux/amd64
2929
build-signed_ubuntu22.04%: DOCKER_BUILD_PLATFORM_OPTIONS = --platform=linux/amd64
30-
build-signed_ubuntu24.04%: DOCKER_BUILD_PLATFORM_OPTIONS = --platform=linux/amd64
3130
build-sles%: DOCKER_BUILD_PLATFORM_OPTIONS = --platform=linux/amd64
Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,9 @@ spec:
1111
instance:
1212
type: g4dn.xlarge
1313
region: us-west-1
14-
ingressIpRanges:
15-
- 18.190.12.32/32
16-
- 3.143.46.93/32
17-
- 52.15.119.136/32
18-
- 35.155.108.162/32
19-
- 35.162.190.51/32
20-
- 54.201.61.24/32
21-
- 52.24.205.48/32
22-
- 44.235.4.62/32
23-
- 44.230.241.223/32
14+
os: ubuntu-22.04
2415
image:
2516
architecture: amd64
26-
imageId: ami-0007a86be89339c9f
2717
containerRuntime:
2818
install: true
2919
name: containerd

tests/holodeck_ubuntu24.04.yaml

Lines changed: 0 additions & 34 deletions
This file was deleted.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
get_kernel_versions_to_test() {
2-
if [[ "$#" -ne 4 ]]; then
3-
echo " Error:$0 must be called with KERNEL_FLAVORS DRIVER_BRANCHES DIST LTS_KERNEL" >&2
2+
if [[ "$#" -lt 4 || "$#" -gt 5 ]]; then
3+
echo " Error:$0 must be called with KERNEL_FLAVORS DRIVER_BRANCHES DIST LTS_KERNEL or KERNEL_FLAVORS DRIVER_BRANCHES DIST LTS_KERNEL PLATFORM_SUFFIX" >&2
44
exit 1
55
fi
66

77
local -a KERNEL_FLAVORS=("${!1}")
88
local -a DRIVER_BRANCHES=("${!2}")
99
local DIST="$3"
1010
local LTS_KERNEL="$4"
11-
11+
local PLATFORM_SUFFIX="$5"
1212
kernel_versions=()
1313
for kernel_flavor in "${KERNEL_FLAVORS[@]}"; do
1414
for DRIVER_BRANCH in "${DRIVER_BRANCHES[@]}"; do
15-
source ./tests/scripts/findkernelversion.sh "${kernel_flavor}" "$DRIVER_BRANCH" "$DIST" "$LTS_KERNEL" >&2
15+
source ./tests/scripts/findkernelversion.sh "${kernel_flavor}" "$DRIVER_BRANCH" "$DIST" "$LTS_KERNEL" "$PLATFORM_SUFFIX" >&2
1616
if [[ "$should_continue" == true ]]; then
1717
break
1818
fi
@@ -25,7 +25,7 @@ get_kernel_versions_to_test() {
2525
# Remove duplicates
2626
kernel_versions=($(printf "%s\n" "${kernel_versions[@]}" | sort -u))
2727
for i in "${!kernel_versions[@]}"; do
28-
kernel_versions[$i]="${kernel_versions[$i]}-$DIST"
28+
kernel_versions[$i]="${kernel_versions[$i]}-$DIST$PLATFORM_SUFFIX"
2929
done
3030
echo "${kernel_versions[@]}"
3131
}

tests/scripts/findkernelversion.sh

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
#!/bin/bash
22

3-
if [[ $# -ne 4 ]]; then
4-
echo " KERNEL_FLAVOR DRIVER_BRANCH DIST LTS_KERNEL are required"
3+
if [[ $# -lt 4 || $# -gt 5 ]]; then
4+
echo " KERNEL_FLAVOR DRIVER_BRANCH DIST LTS_KERNEL or KERNEL_FLAVOR DRIVER_BRANCH DIST LTS_KERNEL PLATFORM_SUFFIX are required"
55
exit 1
66
fi
77

88
export KERNEL_FLAVOR="${1}"
99
export DRIVER_BRANCH="${2}"
1010
export DIST="${3}"
1111
export LTS_KERNEL="${4}"
12+
export PLATFORM_SUFFIX="${5}"
1213

1314
export REGCTL_VERSION=v0.7.1
1415
mkdir -p bin
@@ -21,21 +22,21 @@ prefix="kernel-version-${DRIVER_BRANCH}-${LTS_KERNEL}"
2122
suffix="${KERNEL_FLAVOR}-${DIST}"
2223

2324
artifact_dir="./kernel-version-artifacts"
24-
artifact=$(find "$artifact_dir" -maxdepth 1 -type d -name "${prefix}*-${suffix}" | head -1)
25-
if [ -n "$artifact" ]; then
26-
artifact_name=$(basename "$artifact")
27-
if [ -f "$artifact/${artifact_name}.tar" ]; then
28-
tar -xf "$artifact/${artifact_name}.tar" -C ./
29-
export $(grep -oP 'KERNEL_VERSION=[^ ]+' ./kernel_version.txt)
30-
rm -f kernel_version.txt
31-
fi
25+
artifact_file=$(find "$artifact_dir" -maxdepth 1 -type f -name "${prefix}*-${suffix}.tar" | head -1)
26+
if [ -n "$artifact_file" ]; then
27+
tar -xf "$artifact_file" -C ./
28+
export $(grep -oE 'KERNEL_VERSION=[^ ]+' ./kernel_version.txt)
29+
rm -f kernel_version.txt
3230
fi
3331

3432
# calculate driver tag
3533
status_nvcr=0
3634
status_ghcr=0
37-
regctl tag ls nvcr.io/nvidia/driver | grep "^${DRIVER_BRANCH}-${KERNEL_VERSION}-${DIST}$" || status_nvcr=$?
38-
regctl tag ls ghcr.io/nvidia/driver | grep "^${DRIVER_BRANCH}-${KERNEL_VERSION}-${DIST}$" || status_ghcr=$?
35+
PLATFORM=$(echo "${PLATFORM_SUFFIX}" | sed 's/-//')
36+
[ -z "$PLATFORM" ] && PLATFORM=amd64
37+
regctl manifest inspect nvcr.io/nvidia/driver:${DRIVER_BRANCH}-${KERNEL_VERSION}-${DIST} --platform=linux/${PLATFORM} > /dev/null 2>&1; status_nvcr=$?
38+
regctl manifest inspect ghcr.io/nvidia/driver:${DRIVER_BRANCH}-${KERNEL_VERSION}-${DIST} --platform=linux/${PLATFORM} > /dev/null 2>&1; status_ghcr=$?
39+
3940
if [[ $status_nvcr -eq 0 || $status_ghcr -eq 0 ]]; then
4041
export should_continue=false
4142
else

ubuntu24.04/precompiled/Dockerfile

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ ENV NVIDIA_VISIBLE_DEVICES=void
1717

1818
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
1919

20-
RUN dpkg --add-architecture i386 && \
20+
# Add i386 architecture only for amd64 builds (not available on ARM)
21+
RUN if [ "$TARGETARCH" = "amd64" ]; then dpkg --add-architecture i386; fi && \
2122
apt-get update && apt-get install -y --no-install-recommends \
2223
apt-utils \
2324
build-essential \
@@ -31,11 +32,12 @@ RUN dpkg --add-architecture i386 && \
3132
pkg-config && \
3233
rm -rf /var/lib/apt/lists/*
3334

34-
# Fetch GPG keys for CUDA repo
35-
RUN apt-key del 3bf863cc && \
35+
# Fetch GPG keys for CUDA repo (architecture-specific)
36+
RUN CUDA_ARCH=$([ "$TARGETARCH" = "arm64" ] && echo "sbsa" || echo "x86_64") && \
37+
apt-key del 3bf863cc && \
3638
rm /etc/apt/sources.list.d/cuda* && \
37-
curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/3bf863cc.pub | gpg --dearmor -o /etc/apt/keyrings/cuda.pub && \
38-
echo "deb [signed-by=/etc/apt/keyrings/cuda.pub] https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64 /" > /etc/apt/sources.list.d/cuda.list
39+
curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/${CUDA_ARCH}/3bf863cc.pub | gpg --dearmor -o /etc/apt/keyrings/cuda.pub && \
40+
echo "deb [signed-by=/etc/apt/keyrings/cuda.pub] https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/${CUDA_ARCH} /" > /etc/apt/sources.list.d/cuda.list
3941

4042
RUN usermod -o -u 0 -g 0 _apt
4143

ubuntu24.04/precompiled/local-repo.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,23 @@ download_driver_package_deps () {
6868
pushd ${LOCAL_REPO_DIR}
6969

7070
download_apt_with_dep linux-objects-nvidia-${DRIVER_BRANCH}-server-${KERNEL_VERSION}
71-
download_apt_with_dep linux-signatures-nvidia-${KERNEL_VERSION}
71+
72+
# linux-signatures-nvidia (secure boot signatures) is not available for arm64
73+
if [ "$TARGETARCH" = "amd64" ]; then
74+
download_apt_with_dep linux-signatures-nvidia-${KERNEL_VERSION}
75+
fi
76+
7277
download_apt_with_dep linux-modules-nvidia-${DRIVER_BRANCH}-server-${KERNEL_VERSION}
7378
download_apt_with_dep linux-modules-nvidia-${DRIVER_BRANCH}-server-open-${KERNEL_VERSION}
7479
download_apt_with_dep nvidia-utils-${DRIVER_BRANCH}-server
7580
download_apt_with_dep nvidia-headless-no-dkms-${DRIVER_BRANCH}-server
7681
download_apt_with_dep libnvidia-decode-${DRIVER_BRANCH}-server
7782
download_apt_with_dep libnvidia-extra-${DRIVER_BRANCH}-server
7883
download_apt_with_dep libnvidia-encode-${DRIVER_BRANCH}-server
79-
download_apt_with_dep libnvidia-fbc1-${DRIVER_BRANCH}-server
84+
# libnvidia-fbc1 (FrameBuffer Capture) is not available for arm64
85+
if [ "$TARGETARCH" = "amd64" ]; then
86+
download_apt_with_dep libnvidia-fbc1-${DRIVER_BRANCH}-server
87+
fi
8088
download_apt_with_dep libnvidia-gl-${DRIVER_BRANCH}-server
8189

8290
fabricmanager_download

0 commit comments

Comments
 (0)