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
153 changes: 102 additions & 51 deletions .github/workflows/precompiled.yaml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,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
9 changes: 7 additions & 2 deletions base/generate-ci-config
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ export DEBIAN_FRONTEND=noninteractive
apt-get update -y -qq > /dev/null

# Generate a list of all kernel versions which have NVIDIA precompiled driver packages available.
SUPPORTED_KERNELS_LINUX_SIGNATURES_LIST=$(apt-cache search "linux-signatures-nvidia.*${LTS_KERNEL}.*${KERNEL_FLAVOR}" | awk '{print $1}' | sed -e "s/^.*${LTS_KERNEL}/${LTS_KERNEL}/" | sort -n -t'-' -k2| grep "${KERNEL_FLAVOR}$")
# linux-signatures-nvidia (secure boot signatures) is not available for arm64
if [ "$(uname -m)" = "aarch64" ]; then
SUPPORTED_KERNELS_LINUX_LIST=$(apt-cache search "linux-objects-nvidia-${DRIVER_BRANCH}-server.*${LTS_KERNEL}.*${KERNEL_FLAVOR}" | awk '{print $1}' | grep -v "open" | sed -e "s/^.*${LTS_KERNEL}/${LTS_KERNEL}/" | sort -n -t'-' -k2)
else
SUPPORTED_KERNELS_LINUX_LIST=$(apt-cache search "linux-signatures-nvidia.*${LTS_KERNEL}.*${KERNEL_FLAVOR}" | awk '{print $1}' | sed -e "s/^.*${LTS_KERNEL}/${LTS_KERNEL}/" | sort -n -t'-' -k2| grep "${KERNEL_FLAVOR}$")
fi
# Generate a list of all kernel versions which have linux-image packages available.
SUPPORTED_KERNELS_LINUX_IMAGE_LIST=$(apt-cache search linux-image-${LTS_KERNEL}.*-${KERNEL_FLAVOR} | awk '{print $1}' | sed -e "s/^.*${LTS_KERNEL}/${LTS_KERNEL}/" | sort -n -t'-' -k2 | grep "${KERNEL_FLAVOR}$")

Expand All @@ -26,7 +31,7 @@ DRIVER_VERSION=$(apt-cache show nvidia-utils-${DRIVER_BRANCH}-server |grep Versi
# Get the latest kernel from linux-signatures-list and linux-images-list
# As list is already sorted , compare the kernel version and find exact match
# get the latest kernel version with tail
SK=$(grep -Fxf <(echo "$SUPPORTED_KERNELS_LINUX_SIGNATURES_LIST") <(echo "$SUPPORTED_KERNELS_LINUX_IMAGE_LIST") | tail -n1)
SK=$(grep -Fxf <(echo "$SUPPORTED_KERNELS_LINUX_LIST") <(echo "$SUPPORTED_KERNELS_LINUX_IMAGE_LIST") | tail -n1)

# Write to file
echo "export KERNEL_VERSION=$SK DRIVER_VERSION=$DRIVER_VERSION DRIVER_VERSIONS=$DRIVER_VERSION" > /var/kernel_version.txt
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[@]}"
}
27 changes: 14 additions & 13 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 @@ -18,24 +19,24 @@ export PATH=$(pwd)/bin:${PATH}

# calculate kernel version of latest image
prefix="kernel-version-${DRIVER_BRANCH}-${LTS_KERNEL}"
suffix="${kernel_flavor}-${DIST}"
suffix="${KERNEL_FLAVOR}-${DIST}${PLATFORM_SUFFIX}"

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
13 changes: 11 additions & 2 deletions ubuntu24.04/precompiled/local-repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,24 @@ 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

fabricmanager_download
nscq_download
Expand Down
34 changes: 25 additions & 9 deletions ubuntu24.04/precompiled/nvidia-driver
Original file line number Diff line number Diff line change
Expand Up @@ -400,21 +400,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-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

# 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