diff --git a/.github/workflows/image.yaml b/.github/workflows/image.yaml index 4d1c3a3e..e3cf9610 100644 --- a/.github/workflows/image.yaml +++ b/.github/workflows/image.yaml @@ -18,9 +18,7 @@ name: image on: push: branches: - - main - - "pull-request/[0-9]+" - - release-* + - precompiled-arm-support-no jobs: image: diff --git a/.github/workflows/precompiled.yaml b/.github/workflows/precompiled.yaml index f4728c0b..ca968640 100644 --- a/.github/workflows/precompiled.yaml +++ b/.github/workflows/precompiled.yaml @@ -16,6 +16,9 @@ name: Precompiled images on: + push: + branches: + - precompiled-arm-support schedule: - cron: '00 09 * * *' @@ -34,22 +37,26 @@ jobs: id: extract_driver_branch run: | # get driver_branch - DRIVER_BRANCH=("535" "570" "580") + # DRIVER_BRANCH=("535" "570" "580") + DRIVER_BRANCH=("580") driver_branch_json=$(printf '%s\n' "${DRIVER_BRANCH[@]}" | jq -R . | jq -cs .) echo "driver_branch=$driver_branch_json" >> $GITHUB_OUTPUT # get kernel flavors - KERNEL_FLAVORS=("aws" "azure" "azure-fde" "generic" "nvidia" "oracle") + # KERNEL_FLAVORS=("aws" "azure" "azure-fde" "generic" "nvidia" "oracle") + KERNEL_FLAVORS=("generic") kernel_flavors_json=$(printf '%s\n' "${KERNEL_FLAVORS[@]}" | jq -R . | jq -cs .) echo "kernel_flavors=$kernel_flavors_json" >> $GITHUB_OUTPUT # get ubuntu distributions - DIST=("ubuntu22.04" "ubuntu24.04") + # DIST=("ubuntu22.04" "ubuntu24.04") + DIST=("ubuntu24.04") dist_json=$(printf '%s\n' "${DIST[@]}" | jq -R . | jq -cs .) echo "dist=$dist_json" >> $GITHUB_OUTPUT # LTS_KERNEL setup - LTS_KERNEL=("5.15" "6.8") + # LTS_KERNEL=("5.15" "6.8") + LTS_KERNEL=("6.8") lts_kernel_json=$(printf '%s\n' "${LTS_KERNEL[@]}" | jq -R . | jq -cs .) echo "lts_kernel=$lts_kernel_json" >> $GITHUB_OUTPUT @@ -79,7 +86,13 @@ jobs: GENERATE_ARTIFACTS="false" echo "PUSH_ON_BUILD=${GENERATE_ARTIFACTS}" >> $GITHUB_ENV - echo "BUILD_MULTI_ARCH_IMAGES=${GENERATE_ARTIFACTS}" >> $GITHUB_ENV + + # Enable multi-arch builds only for Ubuntu 24.04 when generating artifacts + if [[ "${{ matrix.dist }}" == "ubuntu24.04" ]]; then + echo "BUILD_MULTI_ARCH_IMAGES=true" >> $GITHUB_ENV + else + echo "BUILD_MULTI_ARCH_IMAGES=false" >> $GITHUB_ENV + fi - name: Set up QEMU uses: docker/setup-qemu-action@v3 @@ -117,6 +130,7 @@ jobs: IMAGE_NAME: ghcr.io/nvidia/driver PRECOMPILED: "true" DIST: signed_${{ matrix.dist }} + VERSION: "" run: | source kernel_version.txt && \ make DRIVER_VERSIONS=${DRIVER_VERSIONS} DRIVER_BRANCH=${{ matrix.driver_branch }} build-${DIST}-${DRIVER_VERSION} @@ -273,18 +287,18 @@ jobs: # slack notification for new kernel release before e2e tests starts # as e2e tests may fail for new kernel release - - name: Slack notification - if: steps.set_kernel_version.outputs.matrix_values_not_empty == '1' - uses: slackapi/slack-github-action@v2.1.1 - with: - token: ${{ secrets.SLACK_BOT_TOKEN }} - method: chat.postMessage - payload: | - { - "channel": "${{ secrets.SLACK_CHANNEL_ID }}", - "text": "${{ secrets.DETECTED_PRECOMPILED_KERNEL_MESSAGE }} ${{ steps.set_kernel_version.outputs.published_kernels }} \n - Details: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" - } + # - name: Slack notification + # if: steps.set_kernel_version.outputs.matrix_values_not_empty == '1' + # uses: slackapi/slack-github-action@v2.1.1 + # with: + # token: ${{ secrets.SLACK_BOT_TOKEN }} + # method: chat.postMessage + # payload: | + # { + # "channel": "${{ secrets.SLACK_CHANNEL_ID }}", + # "text": "${{ secrets.DETECTED_PRECOMPILED_KERNEL_MESSAGE }} ${{ steps.set_kernel_version.outputs.published_kernels }} \n + # Details: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" + # } e2e-tests-nvidiadriver: runs-on: linux-amd64-cpu4 @@ -439,7 +453,7 @@ jobs: image_path="./base-images-${{ matrix.driver_branch }}-${{ matrix.kernel_version }}.tar" echo "uploading $image_path" docker load -i $image_path - docker push ${PRIVATE_REGISTRY}/nvidia/driver:base-${BASE_TARGET}-${LTS_KERNEL}-${KERNEL_FLAVOR}-${{ matrix.driver_branch }} + # docker push ${PRIVATE_REGISTRY}/nvidia/driver:base-${BASE_TARGET}-${LTS_KERNEL}-${KERNEL_FLAVOR}-${{ matrix.driver_branch }} - name: Download built image artifact if: ${{ ! (matrix.driver_branch == 535 && contains(matrix.kernel_version, 'ubuntu24.04')) }} @@ -454,16 +468,16 @@ jobs: image_path="./driver-images-${{ matrix.driver_branch }}-${{ matrix.kernel_version }}.tar" echo "uploading $image_path" docker load -i $image_path - docker push ${PRIVATE_REGISTRY}/nvidia/driver:${{ matrix.driver_branch }}-${{ matrix.kernel_version }} + # docker push ${PRIVATE_REGISTRY}/nvidia/driver:${{ matrix.driver_branch }}-${{ matrix.kernel_version }} - - name: Slack notification - if: ${{ ! (matrix.driver_branch == 535 && contains(matrix.kernel_version, 'ubuntu24.04')) }} - uses: slackapi/slack-github-action@v2.1.1 - with: - token: ${{ secrets.SLACK_BOT_TOKEN }} - method: chat.postMessage - payload: | - { - "channel": "${{ secrets.SLACK_CHANNEL_ID }}", - "text": "${{ secrets.PUBLISHED_PRECOMPILED_IMAGE_MESSAGE }} ${{ env.PRIVATE_REGISTRY }}/nvidia/driver:${{ matrix.driver_branch }}-${{ matrix.kernel_version }}" - } + # - name: Slack notification + # if: ${{ ! (matrix.driver_branch == 535 && contains(matrix.kernel_version, 'ubuntu24.04')) }} + # uses: slackapi/slack-github-action@v2.1.1 + # with: + # token: ${{ secrets.SLACK_BOT_TOKEN }} + # method: chat.postMessage + # payload: | + # { + # "channel": "${{ secrets.SLACK_CHANNEL_ID }}", + # "text": "${{ secrets.PUBLISHED_PRECOMPILED_IMAGE_MESSAGE }} ${{ env.PRIVATE_REGISTRY }}/nvidia/driver:${{ matrix.driver_branch }}-${{ matrix.kernel_version }}" + # } diff --git a/multi-arch.mk b/multi-arch.mk index 263fa88f..a9cf2503 100644 --- a/multi-arch.mk +++ b/multi-arch.mk @@ -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 diff --git a/ubuntu24.04/precompiled/Dockerfile b/ubuntu24.04/precompiled/Dockerfile index b7fb17ed..f02ac7b7 100644 --- a/ubuntu24.04/precompiled/Dockerfile +++ b/ubuntu24.04/precompiled/Dockerfile @@ -1,4 +1,4 @@ -FROM nvcr.io/nvidia/cuda:13.0.2-base-ubuntu24.04 +FROM nvcr.io/nvidia/cuda:13.1.0-base-ubuntu24.04 ENV DEBIAN_FRONTEND=noninteractive @@ -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 \ @@ -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 @@ -50,7 +52,10 @@ COPY nvidia-driver /usr/local/bin ADD local-repo.sh /tmp -RUN mkdir -p /usr/local/repos && \ +RUN apt-get clean && \ + apt-get autoclean && \ + rm -rf /var/lib/apt/lists/* && \ + mkdir -p /usr/local/repos && \ /tmp/local-repo.sh download_driver_package_deps && \ /tmp/local-repo.sh build_local_apt_repo && \ /tmp/local-repo.sh fetch_nvidia_installer && \ diff --git a/ubuntu24.04/precompiled/local-repo.sh b/ubuntu24.04/precompiled/local-repo.sh index 1e35de72..0df3e57d 100755 --- a/ubuntu24.04/precompiled/local-repo.sh +++ b/ubuntu24.04/precompiled/local-repo.sh @@ -68,7 +68,12 @@ 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 @@ -76,7 +81,12 @@ download_driver_package_deps () { 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 + + # SHIVAKU: TODO: Remove this once libnvidia-fbc1 is available for arm64 + # 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