Skip to content

feat(vhd): add isolated AMD GPU image and diagnostics - #9596

Open
Alex Huang (wenhug) wants to merge 6 commits into
mainfrom
wenhug/amd-gpu-dedicated-vhd
Open

Alex Huang (wenhug) wants to merge 6 commits into
mainfrom
wenhug/amd-gpu-dedicated-vhd

Conversation

@wenhug

@wenhug Alex Huang (wenhug) commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Add a separate Ubuntu 24.04 Gen2 AMD GPU VHD (2404gen2amdgpucontainerd) for MI300X. The host contains the pinned AMDGPU driver, firmware, amd-smi, lspci, and numactl; ROCm compute libraries and AI frameworks stay in workload containers.

  • Build AMD through the manual .pipelines/.vsts-vhd-builder-amd.yaml, with no dependency from ordinary VHD pipelines and no production publication. AMD failures affect only that separate run.
  • Keep ordinary PR/release matrices, the base Packer template, component manifest/schema, Ubuntu tool installer, and common SKU settings unchanged. Small AMD guards load separate installers, metadata, content checks, and the baked bootstrap validator.
  • Keep default node/E2E behavior. Opt-in bootstrap validates the baked driver in nodePrep; the AMD scenario explicitly selects the dedicated image, checks eight GPUs and AMD SMI, and requires CPU-reference PyTorch training to complete.
  • Scope cleanup to this build's verified subscription, resource group and ownership tags; disable broad shared cleanup in the AMD pipeline.

Validation:

  • Repository validation passed: 1,340 ShellSpec examples; make test, make lint, make generate; E2E scenario/config tests and focused AMD tests. Tests also cover missing/broken AMD files without changing normal or NVIDIA paths, and all 45 existing Linux image names/outputs match the base.
  • Dedicated AMD build 181874913 succeeded, including capture/content checks and France Central replication. Validation commit 72e925a9 changes only the pipeline entrypoint; its image inputs match PR implementation 3ce6d173. Later changes affect the AMD test launcher and documentation, not the captured image.
  • Fresh image 2404gen2amdgpucontainerd/1.1789808022.4162 booted on MI300X, joined AKS and passed the AMD E2E scenario with no skips. Kernel 6.8.0-1067-azure, module 7.1.3.31500000, AMD SMI and eight GPUs were verified.
  • Before and after an independently verified reboot: 40 CPU-reference training steps per GPU; 100 BF16 distributed Transformer steps on eight GPUs with finite values, decreasing loss and identical full-model hashes; 42,631 total full-buffer transfer calls with 254.77 TB remote traffic and zero mismatches. Median remote-send bandwidth was 278.7–291.4 GB/s per GPU. All workloads exited successfully; host checks passed before and after each round.

Qualification / rollout:

These are bounded functional tests on a fresh dedicated image, not peak-performance, all-future-transfer or vendor security-fix guarantees. Runtime observations were healthy; full vendor security qualification remains outstanding. Native AKS image selection/driver policy, native ANC JSON, full embedded legacy provisioning, PIS, serviced-kernel/DKMS updates and Secure Boot require separate qualification. This test used scriptless NBC with baked ANC/scripts and explicitly selected the AMD SIG version.

See the AMD VHD documentation for provenance, bandwidth definitions and before/after values, package footprint, network prerequisites and reproducible E2E commands. Current PR checks should be read separately from the completed dedicated AMD bake and MI300X qualification.

Which issue(s) this PR fixes:

None linked.

@github-actions github-actions Bot added the components This pull request updates cached components on Linux or Windows VHDs label Sep 19, 2026
@github-actions

github-actions Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Windows Unit Test Results

  3 files   17 suites   55s ⏱️
484 tests 484 ✅ 0 💤 0 ❌
487 runs  487 ✅ 0 💤 0 ❌

Results for commit f3aea1c.

♻️ This comment has been updated with latest results.

Copilot AI 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.

Copilot review overview

🔵 Needs a closer look

It introduces a kernel driver VHD and provisioning path whose complete Packer, MI300X boot, reboot, PIS, and native ANC qualification remains pending.

Review effort: Balanced
Findings: None

What changed in this PR

Adds an opt-in Ubuntu 24.04 MI300X VHD with pinned AMDGPU drivers, diagnostics, provisioning validation, and GPU E2E coverage.

Changes:

  • Adds AMDGPU/AMD SMI installation, validation, metadata, and dedicated VHD pipelines.
  • Propagates AMD configuration through NBC/ANC and validates eight MI300X GPUs during nodePrep.
  • Adds an opt-in MI300X scenario with managed disks and containerized eight-GPU training.
File Description
vhdbuilder/​scripts/​linux/​ubuntu/​tool_installs_ubuntu.sh Installs pinned AMD driver and diagnostics.
vhdbuilder/​packer/​test/​linux-vhd-content-test.sh Validates AMD VHD contents.
vhdbuilder/​packer/​produce-packer-settings.sh Validates AMD build settings.
vhdbuilder/​packer/​produce-packer-settings-functions.sh Adds AMD SKU naming and constraints.
vhdbuilder/​packer/​install-dependencies.sh Dispatches AMD-specific installation.
spec/​vhdbuilder/​packer/​test/​amd_gpu_content_spec.sh Tests AMD content validation.
spec/​vhdbuilder/​packer/​linux_sku_name_spec.sh Tests SKU naming and constraints.
spec/​vhdbuilder/​packer/​amd_gpu_driver_spec.sh Tests driver installation.
spec/​vhdbuilder/​packer/​amd_gpu_diagnostics_spec.sh Tests diagnostics installation.
spec/​parts/​linux/​cloud-init/​artifacts/​cse_install_amd_gpu_spec.sh Tests provisioning validation.
schemas/​components.cue Defines AMD component schemas.
pkg/​agent/​variables.go Exposes the AMD CSE variable.
pkg/​agent/​variables_test.go Tests AMD variable propagation.
parts/​linux/​cloud-init/​artifacts/​cse_main.sh Runs AMD validation in nodePrep.
parts/​linux/​cloud-init/​artifacts/​cse_install.sh Validates driver and GPU devices.
parts/​linux/​cloud-init/​artifacts/​cse_helpers.sh Adds AMD error codes.
parts/​linux/​cloud-init/​artifacts/​cse_cmd.sh Emits the AMD environment flag.
parts/​common/​components.json Pins AMD packages and repositories.
e2e/​scenario/​vmss.go Supports configured SKUs and managed NVMe disks.
e2e/​scenario/​vmss_test.go Tests VM size and disk behavior.
e2e/​scenario/​types.go Adds scenario-level VM size configuration.
e2e/​scenario/​scenario_gpu_amd.go Defines the MI300X scenario.
e2e/​scenario/​scenario_gpu_amd_test.go Tests AMD scenario behavior.
e2e/​scenario/​provision.go Initializes the configured VM size.
e2e/​scenario/​node_config.go Propagates AMD enablement to ANC.
e2e/​scenario/​fixtures/​amd_gpu_training.py Exercises all eight GPUs.
e2e/​scenario/​fixtures/​amd_gpu_host_check.py Checks host driver and diagnostics.
e2e/​config/​vhd.go Defines the dedicated AMD image.
docs/​amd-gpu-vhd.md Documents architecture and qualification.
aks-node-controller/​parser/​parser.go Maps ANC AMD configuration to CSE.
aks-node-controller/​parser/​parser_test.go Tests ANC AMD environment generation.
.pipelines/​templates/​.builder-release-template.yaml Supports AMD SKU generation and reports.
.pipelines/​.vsts-vhd-builder.yaml Adds the AMD VHD build job.
.pipelines/​.vsts-vhd-builder-release.yaml Adds the disabled-by-default release job.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI review requested due to automatic review settings September 19, 2026 08:00

Copilot AI 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.

Copilot review overview

🔵 Needs a closer look

The NBC-to-ANC conversion currently discards the explicit GPU-driver opt-out.

Review effort: Balanced
Findings: None

Previously missed (1)

In code that hasn't changed since last review

Medium severity Preserve ConfigGPUDriverIfNeeded when converting NBC to ANC

e2e/​scenario/​node_config.go:286

🟡 Medium Risk — 🏗️ Architecture: This conversion enables AMD from the NBC but still hard-codes ConfigGpuDriver to true on the next line. Consequently, an NBC with EnableAMDGPU=true and ConfigGPUDriverIfNeeded=false loses the explicit driver opt-out when converted to ANC, contrary to the documented parity between the two provisioning contracts. Map both fields from the NBC (and exercise the false case in the existing conversion test).

Copilot AI review requested due to automatic review settings September 19, 2026 08:33
@wenhug Alex Huang (wenhug) changed the title feat(vhd): add dedicated MI300X AMD GPU image and diagnostics feat(vhd): add isolated AMD GPU image and diagnostics Sep 19, 2026

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

The AMD package manifest bypasses the repository’s automated dependency updates and PR-time component validation.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)

Comment on lines +3 to +5
"repositoryURL": "https://repo.radeon.com/amdgpu/31.50/ubuntu",
"signingKeyURL": "https://repo.radeon.com/rocm/rocm.gpg.key",
"signingKeyFingerprint": "CA8BB4727A47B4D09B4EE8969386B48A1A693C5C",
Copilot AI review requested due to automatic review settings September 19, 2026 10:40

Copilot AI 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.

Copilot review overview

🔵 Needs a closer look

Dependency governance, plugin privilege hardening, and retry-safe resource cleanup need correction.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
Previously missed (2)

In code that hasn't changed since last review

Medium severity Cleanup misses resource groups from earlier retry attempts

.pipelines/​.vsts-vhd-builder-amd.yaml:78

🟡 Medium Risk — Operational implications: This cleanup records only $(PKR_RG_NAME) from the final Packer attempt. The shared build task has retryCountOnTaskFailure: 3, while packer.mk overwrites packer-output at the start of each attempt, so a failed earlier attempt can leave a different temporary resource group that this step can no longer discover. Persist and ownership-check every resource-group name emitted across retries, or disable automatic task retries for this isolated pipeline.

Medium severity Privileged plugin container lacks Linux capability restrictions

e2e/​scenario/​scenario_gpu_amd.go:175

🔒 High Risk — Security: The manifest shipped with the pinned upstream v1.31.0.11 plugin keeps privileged: true but also drops all Linux capabilities. Omitting that restriction gives this third-party container the full capability set while it mounts /sys and the kubelet device-plugin directory, unnecessarily increasing host impact if the image is compromised. Mirror the upstream hardening here.

Copilot AI review requested due to automatic review settings September 19, 2026 11:10
@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
github.com/Azure/agentbaker/aks-node-controller 72%
github.com/Azure/agentbaker/aks-node-controller/common 100%
github.com/Azure/agentbaker/aks-node-controller/helpers 71%
github.com/Azure/agentbaker/aks-node-controller/parser 89%
github.com/Azure/agentbaker/aks-node-controller/pkg/gpu 100%
github.com/Azure/agentbaker/aks-node-controller/pkg/nodeconfigutils 67%
github.com/Azure/agentbaker/aks-node-controller/utils 0%
github.com/Azure/agentbaker/apiserver 25%
github.com/Azure/agentbaker/cmd 0%
github.com/Azure/agentbaker/cmd/starter 0%
github.com/Azure/agentbaker/fuzz/api 0%
github.com/Azure/agentbaker/hotfix/render-nodecustomdata 0%
github.com/Azure/agentbaker/pkg/agent 76%
github.com/Azure/agentbaker/pkg/agent/datamodel 76%
github.com/Azure/agentbaker/pkg/agent/toggles 0%
github.com/Azure/agentbaker/pkg/vhdbuilder/datamodel 88%
Summary 74% (6318 / 8580)

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
staging_cse_windows Package 1 58%
debug 0%
provisioningscripts 2%
parts_windows Package 1 76%
test 0%
windows 21%
Summary 36% (1434 / 6706)

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
shellspec spec 20%
Summary 20% (2920 / 14347)

Copilot AI 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.

Copilot review overview

🔵 Needs a closer look

The security-sensitive AMD package manifest currently bypasses the repository’s centralized validation and Renovate update mechanism.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)

Copilot AI review requested due to automatic review settings September 19, 2026 11:18

Copilot AI 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.

Copilot review overview

🔵 Needs a closer look

AMD dependencies currently bypass the repository’s centralized component and Renovate tracking workflow.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

components This pull request updates cached components on Linux or Windows VHDs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants