Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -198,5 +198,11 @@ jobs:
PRECOMPILED: "true"
DIST: signed_${{ matrix.dist }}
run: |
source kernel_version.txt && \
source kernel_version.txt
# arm64 does not support azure-fde (package linux-objects-nvidia-*-azure-fde not available for arm64)
if [[ "${{ matrix.dist }}" == "ubuntu24.04" ]] && [[ "${{ matrix.flavor }}" != "azure-fde" ]]; then
export DOCKER_BUILD_PLATFORM_OPTIONS="--platform=linux/amd64,linux/arm64"
else
export DOCKER_BUILD_PLATFORM_OPTIONS="--platform=linux/amd64"
fi
make DRIVER_VERSIONS=${DRIVER_VERSIONS} DRIVER_BRANCH=${{ matrix.driver }} build-${DIST}-${DRIVER_VERSION}
234 changes: 139 additions & 95 deletions .github/workflows/precompiled.yaml

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,13 @@ build-%: DOCKERFILE = $(CURDIR)/$(SUBDIR)/Dockerfile
# build-ubuntu20.04-$(DRIVER_VERSION) triggers a build for a specific $(DRIVER_VERSION)
$(DISTRIBUTIONS): %: build-%
$(BUILD_TARGETS): %: $(foreach driver_version, $(DRIVER_VERSIONS), $(addprefix %-, $(driver_version)))
DRIVER_BUILD_TAG = $(if $(findstring type=oci,$(DOCKER_BUILD_OPTIONS)),,--tag $(IMAGE))
$(DRIVER_BUILD_TARGETS):
DOCKER_BUILDKIT=1 \
$(DOCKER) $(BUILDX) build --pull \
$(DOCKER_BUILD_OPTIONS) \
$(DOCKER_BUILD_PLATFORM_OPTIONS) \
--tag $(IMAGE) \
$(DRIVER_BUILD_TAG) \
--build-arg DRIVER_VERSION="$(DRIVER_VERSION)" \
--build-arg GOLANG_VERSION="$(GOLANG_VERSION)" \
--build-arg DRIVER_BRANCH="$(DRIVER_BRANCH)" \
Expand Down Expand Up @@ -215,6 +216,7 @@ $(BASE_BUILD_TARGETS):
DOCKER_BUILDKIT=1 \
$(DOCKER) $(BUILDX) build --pull --no-cache \
$(DOCKER_BUILD_OPTIONS) \
$(DOCKER_BUILD_PLATFORM_OPTIONS) \
--tag $(IMAGE) \
--target $(TARGET) \
--build-arg CUDA_VERSION="$(CUDA_VERSION)" \
Expand Down
1 change: 0 additions & 1 deletion multi-arch.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ $(DRIVER_PUSH_TARGETS): push-%:
build-ubuntu18.04%: DOCKER_BUILD_PLATFORM_OPTIONS = --platform=linux/amd64
build-signed_ubuntu20.04%: DOCKER_BUILD_PLATFORM_OPTIONS = --platform=linux/amd64
build-signed_ubuntu22.04%: DOCKER_BUILD_PLATFORM_OPTIONS = --platform=linux/amd64
build-signed_ubuntu24.04%: DOCKER_BUILD_PLATFORM_OPTIONS = --platform=linux/amd64
build-sles%: DOCKER_BUILD_PLATFORM_OPTIONS = --platform=linux/amd64
12 changes: 1 addition & 11 deletions tests/holodeck_ubuntu22.04.yaml → tests/holodeck_ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,9 @@ spec:
instance:
type: g4dn.xlarge
region: us-west-1
ingressIpRanges:
- 18.190.12.32/32
- 3.143.46.93/32
- 52.15.119.136/32
- 35.155.108.162/32
- 35.162.190.51/32
- 54.201.61.24/32
- 52.24.205.48/32
- 44.235.4.62/32
- 44.230.241.223/32
os: ubuntu-22.04
image:
architecture: amd64
imageId: ami-0007a86be89339c9f
containerRuntime:
install: true
name: containerd
Expand Down
34 changes: 0 additions & 34 deletions tests/holodeck_ubuntu24.04.yaml

This file was deleted.

10 changes: 5 additions & 5 deletions tests/scripts/ci-precompiled-helpers.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
get_kernel_versions_to_test() {
if [[ "$#" -ne 4 ]]; then
echo " Error:$0 must be called with KERNEL_FLAVORS DRIVER_BRANCHES DIST LTS_KERNEL" >&2
if [[ "$#" -lt 4 || "$#" -gt 5 ]]; then
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
exit 1
fi

local -a KERNEL_FLAVORS=("${!1}")
local -a DRIVER_BRANCHES=("${!2}")
local DIST="$3"
local LTS_KERNEL="$4"

local PLATFORM_SUFFIX="$5"
kernel_versions=()
for kernel_flavor in "${KERNEL_FLAVORS[@]}"; do
for DRIVER_BRANCH in "${DRIVER_BRANCHES[@]}"; do
source ./tests/scripts/findkernelversion.sh "${kernel_flavor}" "$DRIVER_BRANCH" "$DIST" "$LTS_KERNEL" >&2
source ./tests/scripts/findkernelversion.sh "${kernel_flavor}" "$DRIVER_BRANCH" "$DIST" "$LTS_KERNEL" "$PLATFORM_SUFFIX" >&2
if [[ "$should_continue" == true ]]; then
break
fi
Expand All @@ -25,7 +25,7 @@ get_kernel_versions_to_test() {
# Remove duplicates
kernel_versions=($(printf "%s\n" "${kernel_versions[@]}" | sort -u))
for i in "${!kernel_versions[@]}"; do
kernel_versions[$i]="${kernel_versions[$i]}-$DIST"
kernel_versions[$i]="${kernel_versions[$i]}-$DIST$PLATFORM_SUFFIX"
done
echo "${kernel_versions[@]}"
}
25 changes: 13 additions & 12 deletions tests/scripts/findkernelversion.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#!/bin/bash

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

export KERNEL_FLAVOR="${1}"
export DRIVER_BRANCH="${2}"
export DIST="${3}"
export LTS_KERNEL="${4}"
export PLATFORM_SUFFIX="${5}"

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

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

# calculate driver tag
status_nvcr=0
status_ghcr=0
regctl tag ls nvcr.io/nvidia/driver | grep "^${DRIVER_BRANCH}-${KERNEL_VERSION}-${DIST}$" || status_nvcr=$?
regctl tag ls ghcr.io/nvidia/driver | grep "^${DRIVER_BRANCH}-${KERNEL_VERSION}-${DIST}$" || status_ghcr=$?
PLATFORM=$(echo "${PLATFORM_SUFFIX}" | sed 's/-//')
[ -z "$PLATFORM" ] && PLATFORM=amd64
regctl manifest inspect nvcr.io/nvidia/driver:${DRIVER_BRANCH}-${KERNEL_VERSION}-${DIST} --platform=linux/${PLATFORM} > /dev/null 2>&1; status_nvcr=$?
regctl manifest inspect ghcr.io/nvidia/driver:${DRIVER_BRANCH}-${KERNEL_VERSION}-${DIST} --platform=linux/${PLATFORM} > /dev/null 2>&1; status_ghcr=$?

if [[ $status_nvcr -eq 0 || $status_ghcr -eq 0 ]]; then
export should_continue=false
else
Expand Down
12 changes: 7 additions & 5 deletions ubuntu24.04/precompiled/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ ENV NVIDIA_VISIBLE_DEVICES=void

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

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

# Fetch GPG keys for CUDA repo
RUN apt-key del 3bf863cc && \
# Fetch GPG keys for CUDA repo (architecture-specific)
RUN CUDA_ARCH=$([ "$TARGETARCH" = "arm64" ] && echo "sbsa" || echo "x86_64") && \
apt-key del 3bf863cc && \
rm /etc/apt/sources.list.d/cuda.list && \
curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/3bf863cc.pub | gpg --dearmor -o /etc/apt/keyrings/cuda.pub && \
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
curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/${CUDA_ARCH}/3bf863cc.pub | gpg --dearmor -o /etc/apt/keyrings/cuda.pub && \
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

RUN usermod -o -u 0 -g 0 _apt

Expand Down
12 changes: 10 additions & 2 deletions ubuntu24.04/precompiled/local-repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,23 @@ download_driver_package_deps () {
pushd ${LOCAL_REPO_DIR}

download_apt_with_dep linux-objects-nvidia-${DRIVER_BRANCH}-server-${KERNEL_VERSION}
download_apt_with_dep linux-signatures-nvidia-${KERNEL_VERSION}

# linux-signatures-nvidia (secure boot signatures) is not available for arm64
if [ "$TARGETARCH" = "amd64" ]; then
download_apt_with_dep linux-signatures-nvidia-${KERNEL_VERSION}
fi

download_apt_with_dep linux-modules-nvidia-${DRIVER_BRANCH}-server-${KERNEL_VERSION}
download_apt_with_dep linux-modules-nvidia-${DRIVER_BRANCH}-server-open-${KERNEL_VERSION}
download_apt_with_dep nvidia-utils-${DRIVER_BRANCH}-server
download_apt_with_dep nvidia-headless-no-dkms-${DRIVER_BRANCH}-server
download_apt_with_dep libnvidia-decode-${DRIVER_BRANCH}-server
download_apt_with_dep libnvidia-extra-${DRIVER_BRANCH}-server
download_apt_with_dep libnvidia-encode-${DRIVER_BRANCH}-server
download_apt_with_dep libnvidia-fbc1-${DRIVER_BRANCH}-server
# libnvidia-fbc1 (FrameBuffer Capture) is not available for arm64
if [ "$TARGETARCH" = "amd64" ]; then
download_apt_with_dep libnvidia-fbc1-${DRIVER_BRANCH}-server
fi
download_apt_with_dep libnvidia-gl-${DRIVER_BRANCH}-server

fabricmanager_download
Expand Down
35 changes: 25 additions & 10 deletions ubuntu24.04/precompiled/nvidia-driver
Original file line number Diff line number Diff line change
Expand Up @@ -416,22 +416,37 @@ _install_driver() {
nvidia-headless-no-dkms-${DRIVER_BRANCH}-server \
libnvidia-decode-${DRIVER_BRANCH}-server \
libnvidia-extra-${DRIVER_BRANCH}-server \
libnvidia-encode-${DRIVER_BRANCH}-server \
libnvidia-fbc1-${DRIVER_BRANCH}-server \
libnvidia-gl-${DRIVER_BRANCH}-server
libnvidia-encode-${DRIVER_BRANCH}-server
# libnvidia-fbc1 (FrameBuffer Capture) is not available for arm64
if [ "$TARGETARCH" = "amd64" ]; then
apt-get install -y --no-install-recommends libnvidia-fbc1-${DRIVER_BRANCH}-server
fi
apt-get install -y --no-install-recommends libnvidia-gl-${DRIVER_BRANCH}-server

# Now install the precompiled kernel module packages signed by Canonical
# linux-signatures-nvidia (secure boot signatures) is not available for arm64
if [ "$KERNEL_TYPE" = "kernel-open" ]; then
echo "Installing Open NVIDIA driver kernel modules..."
apt-get install --no-install-recommends -y \
linux-signatures-nvidia-${KERNEL_VERSION} \
linux-modules-nvidia-${DRIVER_BRANCH}-server-open-${KERNEL_VERSION}
if [ "$TARGETARCH" = "arm64" ]; then
apt-get install --no-install-recommends -y \
linux-modules-nvidia-${DRIVER_BRANCH}-server-open-${KERNEL_VERSION}
else
apt-get install --no-install-recommends -y \
linux-signatures-nvidia-${KERNEL_VERSION} \
linux-modules-nvidia-${DRIVER_BRANCH}-server-open-${KERNEL_VERSION}
fi
else
echo "Installing Closed NVIDIA driver kernel modules..."
apt-get install --no-install-recommends -y \
linux-objects-nvidia-${DRIVER_BRANCH}-server-${KERNEL_VERSION} \
linux-signatures-nvidia-${KERNEL_VERSION} \
linux-modules-nvidia-${DRIVER_BRANCH}-server-${KERNEL_VERSION}
if [ "$TARGETARCH" = "arm64" ]; then
apt-get install --no-install-recommends -y \
linux-objects-nvidia-${DRIVER_BRANCH}-server-${KERNEL_VERSION} \
linux-modules-nvidia-${DRIVER_BRANCH}-server-${KERNEL_VERSION}
else
apt-get install --no-install-recommends -y \
linux-objects-nvidia-${DRIVER_BRANCH}-server-${KERNEL_VERSION} \
linux-signatures-nvidia-${KERNEL_VERSION} \
linux-modules-nvidia-${DRIVER_BRANCH}-server-${KERNEL_VERSION}
fi
fi
}

Expand Down
Loading