Skip to content

Record staged driver tree versions in version-info for Accelerated AMIs - #2830

Merged
arsbw2802 merged 1 commit into
awslabs:mainfrom
arsbw2802:version-info-fix
Sep 28, 2026
Merged

arsbw2802 merged 1 commit into
awslabs:mainfrom
arsbw2802:version-info-fix

Conversation

@arsbw2802

Copy link
Copy Markdown

Description of changes:

  • Accelerated AMIs bake multiple NVIDIA driver trees (lts, pb). Their version-specific rpms are extracted into /opt/nvidia/<tree>/.rpms, not installed, so they never enter the rpm database because of which rpm --query --all never sees them and are missing from version-info.json. This made the release consistency check report them as removed and hid them from release notes.
  • Record each tree's package versions under a new nvidia_driver_trees key so the release consistency check and release notes can see every driver version present in the AMI.
  • packages remains rpm-database-only. Trees are discovered dynamically and not hard-coded, so is scalable to work with more driver versions with no changes.

Output shape

{
  "packages": { ... },
  "nvidia_driver_trees": {
    "lts": { "nvidia-driver": "580.178.04-1.amzn2023", ... },
    "pb":  { "nvidia-driver": "595.91.07-1.amzn2023", ... }
  }
}

Testing Done

  • Built an accelerated AMI (k8s=1.36, enable_accelerator=nvidia) and inspected the produced version-info.json:
    • nvidia_driver_trees has both lts (580.178.04) and pb (595.91.07), each with the full version-specific driver set.
    • No staged driver names leak into packages.
    • rpm-database-installed nvidia packages (container-toolkit, etc.) still in packages.
  • End-to-end: ran the updated EKSWorkerAMIRelease comparator against this AMI's version-info; consistency check passes.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

See this guide for recommended testing for PRs. Some tests may not apply. Completing tests and providing additional validation steps are not required, but it is recommended and may reduce review time and time to merge.

@arsbw2802
arsbw2802 requested a review from a team as a code owner September 22, 2026 23:41
@arsbw2802
arsbw2802 marked this pull request as draft September 22, 2026 23:42
@arsbw2802
arsbw2802 marked this pull request as ready for review September 23, 2026 21:54

@mselim00 mselim00 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thanks !just a few comments

[ -L "$VERSION_PATH" ] && continue
VERSION=$(basename "$VERSION_PATH")
RPM_DIRS=""
for DIR in "$VERSION_PATH/.rpms" "$VERSION_PATH/flavors/open/.rpms"; do

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we should also be looking at the RPMs for all favors, not just open

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

True, but I am less strict about this though.

  1. The previous version-info only had proprietary kernel modules (last flavor installed).
  2. GRID does not have an RPM since it comes from a .run file.
  3. Since the purpose of this is version consistency checks and release notes, using open alone is good enough. We already validate that every userspace program and kernel module is of the same version in validate.sh

If adding more flavors adds more nesting to the previously flat json, I am good to just use open.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Aarushi and I chatted a bit on this offline.

I agree, based on the current state of the provisioners, it doesn’t actually add much value. however, it is technically more correct to also include the proprietary RPM (though I agree that it is net new to have both) and lets the generated JSON be used to provide additional validation against future potential code changes that may allow the proprietary package to be downgraded or even dropped entirely. the conclusion of our chat was basically that it’s a nice to have, we can merge this without that if things get unnecessarily messy

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Added both flavors of RPMS. The output now will be similar to :
"nvidia": {
"lts": {
....
"kmod-nvidia-latest-dkms": "580.178.04-1.amzn2023",
"kmod-nvidia-open-dkms": "580.178.04-1.amzn2023",
....
},
"pb": {
....
"kmod-nvidia-latest-dkms": "595.91.07-1.amzn2023",
"kmod-nvidia-open-dkms": "595.91.07-1.amzn2023",
....
}
}

Comment on lines +31 to +32
VERSION_JSON=$(echo "$RPMS" | xargs sudo rpm --query --package \
--queryformat '\{"%{NAME}": "%{VERSION}-%{RELEASE}"\}\n' | jq --slurp --sort-keys 'add')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm guessing this doesn't work for proprietary? we might want to just try parsing this information from the RPM name, they're generally named according to a <name>-<version>-<release>.<architecture>.rpm convention

sudo rpm --query --all --queryformat '\{"%{NAME}": "%{VERSION}-%{RELEASE}"\}\n' | jq --slurp --sort-keys 'add | {packages:(.)}' > $OUTPUT_FILE

# nvidia drivers
if [ -d /opt/nvidia ]; then

@kummatty kummatty Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

NIT: In the install provisioner we are pretty explicit with our usage of the terms lts and pb, so we can be explicit about paths her as well.

The check on whether this is an nvidia AMI across other provisioners is

if [ "$ENABLE_ACCELERATOR" != "nvidia" ]; then
  // return or break early
fi

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Addressed the second part in the revision. As for being explicit about the lts and pb paths, I wanted to keep the check dynamic so that if we run into a similar issue like this where we have to add or change another driver version, it will still be compatible.

@mselim00 mselim00 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm, thanks for the revision!

@arsbw2802
arsbw2802 merged commit 607e8be into awslabs:main Sep 28, 2026
2 checks passed
@mselim00 mselim00 added the changelog/exclude Exclude this PR from future changelog entries. label Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/exclude Exclude this PR from future changelog entries.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants