Skip to content
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
81485a6
feat(podvm): opt-in NVIDIA 595.71.05 driver for B200 multi-GPU CC
alhassankhedr-cohere May 8, 2026
02f05f0
fix(podvm): build libnvat from source so nvidia-attester actually links
alhassankhedr-cohere May 12, 2026
d02fb9b
fix(podvm): refresh Cargo.lock before AA build so nvidia-attester res…
alhassankhedr-cohere May 12, 2026
6361ef8
fix: multi-GPU nvidia-attester detection and debug image sizing
alhassankhedr-cohere May 12, 2026
0f10cc0
chore: remove temporary detect_platform sed patch
alhassankhedr-cohere May 13, 2026
c174616
fix: install libnvat to /usr instead of /usr/local
alhassankhedr-cohere May 13, 2026
92af4d5
fix: copy libnvat from /usr/lib to match CMAKE_INSTALL_PREFIX
alhassankhedr-cohere May 13, 2026
8cec037
fix: force libnvat install to /usr/lib (not arch-specific subdir)
alhassankhedr-cohere May 13, 2026
da1222b
fix: address Bugbot findings in Dockerfile
alhassankhedr-cohere May 13, 2026
9f839bf
fix: add libssl-dev to NVAT build deps (prevents OpenSSL source build)
alhassankhedr-cohere May 13, 2026
ad4c921
ci: default guest_components_ref to alhassankhedr/sync-main-to-cohere
alhassankhedr-cohere May 15, 2026
7a46e77
fix(podvm): pin debug rootfs to 12 GiB for NVIDIA 595 stack
alhassankhedr-cohere May 15, 2026
928b7fd
build(podvm-b200-cc): bump NVIDIA stack to 595.71.05 + load ib_umad f…
alhassankhedr-cohere May 19, 2026
85f075d
fix(b200-cc): gate nvidia-persistenced on NVLink fabric readiness
alhassankhedr-cohere May 19, 2026
bb64832
build(podvm-b200-cc): add nvlink5-595 metapackage components + OFED d…
alhassankhedr-cohere May 20, 2026
fd50ec5
build(podvm-b200-cc): add NVIDIA DOCA-Host repo + restore CX7 NIC tools
alhassankhedr-cohere May 20, 2026
5e953fc
build(podvm-b200-cc): fix non-existent package names
alhassankhedr-cohere May 20, 2026
f4b67ed
build(podvm-b200-cc): bake fmctl-probe into the SVM image at build time
alhassankhedr-cohere May 20, 2026
b8a77ba
build(podvm-b200-cc): add image-side distro guard to mkosi.postinst
alhassankhedr-cohere May 20, 2026
de75f12
build(podvm-b200-cc): gate nvidia-imex.service on check-nvidia-gpu
alhassankhedr-cohere May 20, 2026
077f479
build(podvm-b200-cc): fmctl-probe — add resolve-by-physids; fix stdou…
alhassankhedr-cohere May 20, 2026
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
71 changes: 68 additions & 3 deletions .github/workflows/build-podvm-cohere.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,20 @@ on:
type: string
default: "https://github.com/cohere-ai/guest-components.git"
guest_components_ref:
description: "guest-components ref (default: cohere)"
description: |
guest-components ref (branch, tag, or SHA).

Default: alhassankhedr/sync-main-to-cohere (head of PR #9).
That branch carries upstream main's nvidia-attester rewrite
(NVAT SDK based, no `count == 1` guard) and is required for
multi-GPU evidence to work end-to-end on 8x B200 hosts. The
plain `cohere` branch still has the old NVML-based attester
which silently produces empty evidence on 2+ GPU systems
(mod a sed `s/count == 1/count >= 1/` patch the podvm-mkosi
Dockerfile applies). Switch back to `cohere` after PR #9 merges.
required: false
type: string
default: "cohere"
default: "alhassankhedr/sync-main-to-cohere"
custom_gc_binaries:
description: "guest-components binaries to build from source"
required: false
Expand All @@ -46,6 +56,11 @@ on:
required: false
type: boolean
default: false
b200_cc_drivers:
description: "Install NVIDIA 595.71.05 open driver (enables Confidential Computing on multi-GPU B200). EXPERIMENTAL"
required: false
type: boolean
default: false

permissions:
id-token: write # OIDC token for build provenance attestation
Expand All @@ -70,11 +85,13 @@ jobs:
image_name_debug: ${{ steps.compute.outputs.image_name_debug }}
image_tag_release: ${{ steps.compute.outputs.image_tag_release }}
image_tag_debug: ${{ steps.compute.outputs.image_tag_debug }}
b200_cc_drivers: ${{ steps.compute.outputs.b200_cc_drivers }}
steps:
- name: Compute tags and image names
id: compute
env:
DISTRO: ${{ inputs.distro || 'ubuntu' }}
B200_CC_DRIVERS: ${{ inputs.b200_cc_drivers && 'true' || 'false' }}
run: |
if [[ "$GITHUB_REF" == refs/tags/podvm-v* ]]; then
TAG="${GITHUB_REF#refs/tags/podvm-}"
Expand All @@ -84,10 +101,15 @@ jobs:
REPLACE_IMAGE="true"
fi
TAG="${TAG//./-}"
# Suffix CC-driver builds so they never collide with standard images
if [ "$B200_CC_DRIVERS" = "true" ]; then
TAG="${TAG}-cc595"
fi
{
echo "tag=$TAG"
echo "distro=$DISTRO"
echo "replace_image=$REPLACE_IMAGE"
echo "b200_cc_drivers=$B200_CC_DRIVERS"
echo "image_name_release=podvm-${DISTRO}-${TEE_PLATFORM}-release-${TAG}"
echo "image_name_debug=podvm-${DISTRO}-${TEE_PLATFORM}-debug-${TAG}"
echo "image_tag_release=${TAG}-${DISTRO}-release"
Expand Down Expand Up @@ -176,7 +198,7 @@ jobs:
PODVM_DISTRO: ${{ needs.meta.outputs.distro }}
AA_FEATURES: ${{ inputs.aa_features || 'bin,ttrpc,kbs,coco_as,rust-crypto,tdx-attester,nvidia-attester' }}
GC_REPO: ${{ inputs.guest_components_repo || 'https://github.com/cohere-ai/guest-components.git' }}
GC_REF: ${{ inputs.guest_components_ref || 'cohere' }}
GC_REF: ${{ inputs.guest_components_ref || 'alhassankhedr/sync-main-to-cohere' }}
GC_CUSTOM_BINARIES: ${{ inputs.custom_gc_binaries || 'attestation-agent,api-server-rest' }}
run: |
MAKE_ARGS=(
Expand All @@ -195,6 +217,47 @@ jobs:
echo "Disk after binaries build:"
df -h /

- name: Override NVIDIA driver to 595.71.05 (B200 multi-GPU CC)
if: needs.meta.outputs.b200_cc_drivers == 'true'
working-directory: src/cloud-api-adaptor/podvm-mkosi
run: |
set -euo pipefail
CONF=mkosi.presets/system/mkosi.conf.d/ubuntu.conf
# The 595 branch only ships the unversioned `nvidia-driver-open`
# metapackage in NVIDIA's CUDA repo (no `nvidia-driver-595-open`).
# Match by package name only so this survives future 580.x.y bumps.
sed -i -E \
-e 's|^([[:space:]]*)nvidia-driver-580-open=.*|\1nvidia-driver-open=595.71.05-1ubuntu1|' \
-e 's|^([[:space:]]*)nvidia-persistenced=.*|\1nvidia-persistenced=595.71.05-1ubuntu1|' \
-e 's|^([[:space:]]*)nvidia-fabricmanager=.*|\1nvidia-fabricmanager=595.71.05-1ubuntu1|' \
-e 's|^([[:space:]]*)libnvidia-nscq=.*|\1libnvidia-nscq=595.71.05-1ubuntu1|' \
"$CONF"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opt-in flag is non-functional; config already hardcodes 595

High Severity

The b200_cc_drivers flag is supposed to opt-in to the 595 driver by sed-replacing 580 package pins, but ubuntu.conf was directly committed with 595 packages (nvidia-driver-open=595.71.05-1ubuntu1), making the sed a no-op. Specifically, the first sed pattern looks for nvidia-driver-580-open= which doesn't exist in the committed file (it has nvidia-driver-open= without 580), and patterns 2–4 match but replace with the same already-present 595 values. This means ALL builds use the 595 driver regardless of the flag, contradicting the stated "Default behaviour is unchanged" and the PR's "opt-in" design. The flag's only actual effect is appending -cc595 to the image tag.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit fd50ec5. Configure here.

echo "----- Updated NVIDIA package pins -----"
grep -E '^[[:space:]]*(nvidia|libnvidia)' "$CONF"

- name: Increase debug root partition for CC595 drivers
if: needs.meta.outputs.b200_cc_drivers == 'true' && matrix.profile == 'debug'
working-directory: src/cloud-api-adaptor/podvm-mkosi
run: |
set -euo pipefail
CONF=mkosi.presets/system/mkosi.repart-debug/10-root.conf
# NVIDIA 595 drivers make the root filesystem too large for
# systemd-repart's Minimize=guess estimation, causing mkfs.ext4
# "No space left on device" during the build.
printf '[Partition]\nType=root\nFormat=ext4\nCopyFiles=/\nMinimize=off\nSizeMinBytes=12G\nSizeMaxBytes=12G\n' > "$CONF"
echo "----- Updated repart config -----"
cat "$CONF"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug root partition override is redundant dead code

Low Severity

The "Increase debug root partition for CC595 drivers" workflow step (conditional on b200_cc_drivers == 'true') writes Minimize=off / SizeMinBytes=12G / SizeMaxBytes=12G to 10-root.conf. However, the base 10-root.conf was already directly changed in this commit from Minimize=guess to the identical Minimize=off + 12G content. The conditional override is redundant dead code that writes exactly what's already in the file.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit de75f12. Configure here.


- name: Resolve installed NVIDIA driver version
working-directory: src/cloud-api-adaptor/podvm-mkosi
run: |
set -euo pipefail
CONF=mkosi.presets/system/mkosi.conf.d/ubuntu.conf
DRIVER_LINE=$(grep -E '^[[:space:]]*nvidia-driver(-580)?-open=' "$CONF" | head -n1)
DRIVER_VER=$(printf '%s' "$DRIVER_LINE" | sed -E 's|.*=([0-9]+\.[0-9]+\.[0-9]+).*|\1|')
echo "Resolved NVIDIA driver version: $DRIVER_VER"
echo "NVIDIA_DRIVER=$DRIVER_VER" >> "$GITHUB_ENV"

- name: Build OS image
working-directory: src/cloud-api-adaptor/podvm-mkosi
env:
Expand Down Expand Up @@ -265,6 +328,7 @@ jobs:
--arg distro "$DISTRO" \
--arg profile "$PROFILE" \
--arg tee_platform "$TEE_PLATFORM" \
--arg nvidia_driver "$NVIDIA_DRIVER" \
--arg build_date "$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
'$ARGS.named' > /tmp/measurements.json

Expand Down Expand Up @@ -307,6 +371,7 @@ jobs:
--annotation "com.cohere.caa.commit=${CAA_COMMIT}" \
--annotation "com.cohere.caa.version=${GITHUB_REF_NAME}" \
--annotation "com.cohere.rtmr2=${RTMR2}" \
--annotation "com.cohere.nvidia.driver=${NVIDIA_DRIVER}" \
--format json > oras-output.json

cat oras-output.json

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Agentic Security Review
Severity: HIGH

GC_REF now defaults to a mutable personal branch (alhassankhedr/sync-main-to-cohere) for push/tag-driven PodVM builds instead of an immutable, reviewed ref. That expands the build trust boundary to branch-head state that can change outside this repository’s review path.

Impact: If that branch is updated maliciously (or compromised), unreviewed guest-components code can be pulled into release artifacts and published as trusted PodVM images.

Expand Down
42 changes: 41 additions & 1 deletion src/cloud-api-adaptor/podvm-mkosi/Dockerfile.mkosi.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,40 @@ COPY mkosi.conf.ubuntu /image/mkosi.conf

# Add NVIDIA APT repos to mkosi.skeleton/ so they are present in the image tree
# *before* package installation. mkosi applies SkeletonTrees before apt-get runs.
#
# Three NVIDIA repos are wired in:
# 1. CUDA repo (developer.download.nvidia.com/compute/cuda)
# Provides nvidia-driver-open, nvidia-fabricmanager, libnvidia-nscq,
# nvidia-imex, libnvsdm, nvlsm, collectx-bringup, mft, mft-oem,
# mft-autocomplete, etc. — the full R595 + nvlink5 stack EXCEPT for
# the `ucx` dependency that collectx-bringup pulls in.
# 2. nvidia-container-toolkit repo (nvidia.github.io/libnvidia-container)
# Provides nvidia-container-toolkit and friends.
# 3. NVIDIA DOCA-Host networking repo (linux.mellanox.com/public/repo/doca)
# Provides `ucx` (Unified Communication X) and the matching MOFED
# userspace stack. We need it ONLY for `ucx` (so collectx-bringup's
# Depends: ucx resolves) and as an alternate source for mft*/
# collectx-bringup. The repo is pinned at priority 100 so it acts as
# a fallback — packages already available from the cuda repo or from
# Ubuntu universe (e.g. rdma-core, ibverbs-utils, libibumad3) are
# NOT replaced by the MOFED variants, which would otherwise turn the
# image into a MOFED-userspace install. Only ucx (which exists ONLY
# in DOCA) and any explicitly-requested package fall through to it.
RUN mkdir -p /image/mkosi.skeleton/etc/apt/sources.list.d \
/image/mkosi.skeleton/etc/apt/preferences.d \
/image/mkosi.skeleton/usr/share/keyrings \
&& curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/cuda-archive-keyring.gpg \
-o /image/mkosi.skeleton/usr/share/keyrings/cuda-archive-keyring.gpg \
&& curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey \
| gpg --dearmor -o /image/mkosi.skeleton/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
&& curl -fsSL https://www.mellanox.com/downloads/ofed/RPM-GPG-KEY-Mellanox \
| gpg --dearmor -o /image/mkosi.skeleton/usr/share/keyrings/nvidia-doca-keyring.gpg \
&& echo 'deb [signed-by=/usr/share/keyrings/cuda-archive-keyring.gpg] https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2404/x86_64/ /' \
> /image/mkosi.skeleton/etc/apt/sources.list.d/cuda-ubuntu2404-x86_64.list \
&& echo 'deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://nvidia.github.io/libnvidia-container/stable/deb/amd64 /' \
> /image/mkosi.skeleton/etc/apt/sources.list.d/nvidia-container-toolkit.list \
&& echo 'deb [signed-by=/usr/share/keyrings/nvidia-doca-keyring.gpg] https://linux.mellanox.com/public/repo/doca/latest/ubuntu24.04/x86_64/ ./' \
> /image/mkosi.skeleton/etc/apt/sources.list.d/nvidia-doca-ubuntu2404.list \
&& printf '%s\n' \
'Package: nvidia-*' \
'Pin: origin developer.download.nvidia.com' \
Expand All @@ -74,7 +97,24 @@ RUN mkdir -p /image/mkosi.skeleton/etc/apt/sources.list.d \
'Package: cuda-*' \
'Pin: origin developer.download.nvidia.com' \
'Pin-Priority: 1001' \
> /image/mkosi.skeleton/etc/apt/preferences.d/nvidia-cuda-repo
> /image/mkosi.skeleton/etc/apt/preferences.d/nvidia-cuda-repo \
&& printf '%s\n' \
'# Pin the NVIDIA DOCA-Host repo to priority 100. Apt rule for' \
'# "Pin-Priority: 100": install ONLY if explicitly requested or as' \
'# a dep, never auto-upgrade or replace a package available from' \
'# a higher-priority source. Outcome:' \
'# - ucx (only in DOCA) -> installs from DOCA ✓ (resolves' \
'# collectx-bringup Depends: ucx)' \
'# - rdma-core, ibverbs-utils, libibumad3 (in universe @500 AND' \
'# in DOCA @100) -> installs from universe ✓' \
'# (keeps inbox OFED, not MOFED)' \
'# - collectx-bringup, mft* -> install from cuda repo (origin' \
'# developer.download.nvidia.com,' \
'# default priority 500 > 100)' \
'Package: *' \
'Pin: origin linux.mellanox.com' \
'Pin-Priority: 100' \
> /image/mkosi.skeleton/etc/apt/preferences.d/nvidia-doca-repo

RUN --security=insecure mkosi --profile=$PROFILE --image-version=$IMAGE_VERSION

Expand Down
86 changes: 86 additions & 0 deletions src/cloud-api-adaptor/podvm-mkosi/mkosi.postinst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,56 @@

set -euxo pipefail

# ---------------------------------------------------------------------------
# Distro guard: this image MUST be Ubuntu noble.
#
# The Makefile default is `PODVM_DISTRO ?= fedora`, so a bare
# `make image-debug` silently builds a Fedora qcow2. The Cohere B200 SVM
# stack assumes Ubuntu noble end-to-end:
# - mkosi.presets/system/mkosi.conf.d/ubuntu.conf pins 13 NVIDIA packages
# (nvidia-driver-open=595.71.05-1ubuntu1, nvidia-fabricmanager*,
# libnvsdm, nvidia-imex, libnvidia-nscq, nvlsm, collectx-bringup, mft*,
# rdma-core, ibverbs-utils, libibumad3, datacenter-gpu-manager-4-cuda12,
# nvidia-modprobe, nvidia-container-toolkit) from the CUDA + DOCA-Host
# apt repos. NONE of these resolve in Fedora's package universe.
# - service-vm/scripts/svc-vm-bootstrap.sh runtime install workaround
# uses `apt-get download` + `dpkg -x` (no rpm equivalent here).
# - service-vm/scripts/verify-svc-vm.sh hard-fail gates use dpkg-query,
# ldconfig with /lib/x86_64-linux-gnu/, and apt-style version strings.
# - The fmctl-probe bake below links against
# /usr/lib/x86_64-linux-gnu/libnvfm.so from nvidia-fabricmanager-dev,
# which does not exist in Fedora's NVIDIA repos.
#
# A Fedora qcow2 produced by this pipeline would silently lack every B200
# component and the SVM would only fail at FM startup time -- AFTER the
# operator has copied a 5 GiB image into place and rebooted. Fail here
# instead, before mkosi finalizes the disk image.
# ---------------------------------------------------------------------------
osr="${BUILDROOT}/etc/os-release"
if [ -f "$osr" ]; then
distro_id=$(awk -F= '$1=="ID" {gsub(/"/,"",$2); print $2; exit}' "$osr")
if [ "$distro_id" != "ubuntu" ]; then
cat >&2 <<EOF
[postinst] FAIL: rootfs is ID=${distro_id}, expected ID=ubuntu.
[postinst]
[postinst] The Makefile default is \`PODVM_DISTRO ?= fedora\`, so a bare
[postinst] \`make image-debug\` silently builds a Fedora qcow2 that lacks
[postinst] the entire B200 NVIDIA stack pinned in
[postinst] mkosi.presets/system/mkosi.conf.d/ubuntu.conf. Re-invoke with:
[postinst]
[postinst] PODVM_DISTRO=ubuntu make image-debug
[postinst]
[postinst] Or use one of the wrapper scripts that sets it for you:
[postinst] - /tmp/run-podvm-build.sh (host-side captured)
[postinst] - host/scripts/04-build-podvm-locally.sh (fortress, reproducible)
[postinst] - host/scripts/run-podvm-build.host.sh (fortress, verbatim capture)
[postinst]
[postinst] (Hit on $(date -u +%Y-%m-%dT%H:%M:%SZ).)
EOF
exit 1
fi
fi

# move issue files away from /etc
# to allow /run/issue and /run/issue.d to take precedence
mv "${BUILDROOT}/etc/issue.d" "${BUILDROOT}/usr/lib/issue.d" || true
Expand Down Expand Up @@ -42,3 +92,39 @@ if [ -f /usr/lib/systemd/boot/efi/linuxx64.efi.stub ]; then
cp /usr/lib/systemd/boot/efi/linuxx64.efi.stub \
"${BUILDROOT}/usr/lib/systemd/boot/efi/linuxx64.efi.stub"
fi

# ---------------------------------------------------------------------------
# Bake fmctl-probe (NVIDIA Fabric Manager SDK client) into the SVM image.
#
# fmctl-probe is the small C++ utility used by the host-side
# {activate,deactivate}-partition-by-bdfs.sh wrappers to drive
# fmActivateFabricPartition / fmDeactivateFabricPartition / and the
# fmGetSupportedFabricPartitions-based BDF->partition-id resolver.
# Source is vendored at mkosi.skeleton/usr/src/fmctl-probe/fmctl-probe.cpp
# (canonical copy lives in fortress: scratch/oci-b200/.../orchestration/scripts/
# fmctl-probe.cpp -- keep them in sync).
#
# We compile inside ${BUILDROOT} via chroot so the binary links against the
# rootfs's own libnvfm (from nvidia-fabricmanager-dev), guaranteeing ABI parity
# with the libnvfm.so loaded at runtime. Building from the outer Oracular
# builder would risk linking against a different libstdc++/libnvfm version.
#
# Removed from the image after compile: the source tree (~12 KiB) is build-time
# only; we don't want a build artifact source dir in production qcow2s.
# ---------------------------------------------------------------------------
FMCTL_SRC="${BUILDROOT}/usr/src/fmctl-probe/fmctl-probe.cpp"
FMCTL_HDR="${BUILDROOT}/usr/include/nv_fm_agent.h"
if [ -f "${FMCTL_SRC}" ] && [ -f "${FMCTL_HDR}" ]; then
echo "[postinst] compiling fmctl-probe inside rootfs against libnvfm"
chroot "${BUILDROOT}" /usr/bin/g++ \
-std=c++17 -O2 -Wall -Wextra \
/usr/src/fmctl-probe/fmctl-probe.cpp \
-lnvfm \
-o /usr/local/bin/fmctl-probe
chroot "${BUILDROOT}" /usr/bin/test -x /usr/local/bin/fmctl-probe
rm -rf "${BUILDROOT}/usr/src/fmctl-probe"
echo "[postinst] fmctl-probe baked at /usr/local/bin/fmctl-probe"
elif [ -f "${FMCTL_SRC}" ]; then
echo "[postinst] WARN: fmctl-probe source present but nv_fm_agent.h missing;" \
"is nvidia-fabricmanager-dev in Packages=? Skipping bake." >&2
fi
Loading