Skip to content

fix: install absent or incomplete managed Ubuntu GPU drivers - #9692

Open
Ganeshkumar Ashokavardhanan (ganeshkumarashok) wants to merge 4 commits into
mainfrom
ganesh/gpu-install-absent-driver
Open

Ganeshkumar Ashokavardhanan (ganeshkumarashok) wants to merge 4 commits into
mainfrom
ganesh/gpu-install-absent-driver

Conversation

@ganeshkumarashok

@ganeshkumarashok Ganeshkumar Ashokavardhanan (ganeshkumarashok) commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

What this PR does / why we need it:

On managed Ubuntu amd64 VHD nodes, validateGPUDrivers currently retries
nvidia-modprobe 24 times before falling back to the normal installer. When a
shared VHD only caches the installer and has no installed host driver, retrying
the missing executable adds 23 x 5 = 115 seconds of sleeps before installation.

Select the existing normal installer immediately when nvidia-modprobe is
absent on an Ubuntu amd64 VHD, or a bounded nvidia-smi probe returns NVIDIA
status 12 (NVML cannot be found or loaded). The latter covers old partial
prebakes: a loadable kernel module is not sufficient when host userspace is
missing. Other probe statuses retain readiness retries; normal-install failures
and final validation failures still propagate. ARM64/non-Ubuntu/non-VHD behavior,
alternate SMI paths, and infoROM corruption handling are preserved. GPU
eligibility and opt-out policy remain in nodePrep.

Add Ubuntu2204_GPUNC_ValidateDriver and Ubuntu2404_GPUNC_ValidateDriver
using the existing T4 GPU scenario and validators. These need separate nodes
because ConfigGPUDriverIfNeeded=false is a different bootstrap input from the
existing unconditional-install scenarios, which remain unchanged. Both verify
module loading and successful nvidia-smi after validation/fallback. Both
explicitly disable the two scriptless CSE delivery flags so automatic CI tests
this checkout's changed scripts, not the default VHD's baked-in CSE. The VMSS
artifact guard now follows the final NBC's EnableScriptlessCSECmd, matching
the existing on-node validator, rather than treating the run-wide default as
the effective mode after a scenario override.

This is the consumer-first companion to #9693, the cache-only shared-VHD producer
change. It introduces no image layout, parking/restoration protocol, driver
container version change or skip-build path.

Validation:

  • Complete cse_config_gpu_spec.sh: 80 examples passed, including 19 new cases.
  • go test ./scenario ./runner in e2e: passed with both new scenarios compiled.
  • Eight full VMSS-model rendering cases cover legacy overrides, global legacy,
    scriptless CSE and scriptless NBC across both Ubuntu images. The two legacy
    overrides reproduced the cloud harness error before the one-line guard fix;
    all cases pass afterward. Image resolution is stubbed, without cloud creation.
  • Bash ShellCheck using repository exclusions and Bash syntax checks passed.
  • ShellCheck 0.11's additional POSIX-only pass reports one existing SC3014
    warning; comparison with the base commit confirms no introduced diagnostics.
  • Cloud GPU verification will pair this source with the producer PR's changed
    VHDs; its results will be recorded separately. Unit results are not presented
    as changed-image or performance evidence.

Findings from the first automatic cloud run:

  • GPU build 183950710:
    16 passed, 175 skipped, 3 failed. The two new validation-only cases each failed
    all three attempts on main-tag prebaked images: modprobe succeeded, then SMI
    returned 12 for missing NVML. Actual traces used the old baked-in validation
    function, not this PR's code. The changes above address both discovered gaps.
    The third failure was an RTX Pro6000 Bastion SSH timeout; an A100 quota skip
    is not counted as a pass.
  • General E2E 183950694:
    133 passed, 60 skipped, 1 failed (AzureLinuxV3Gen2Kata, containerd's version-2
    migration warning). That non-GPU path is outside this change; fix fixAzureLinuxV3Gen2Kata #9690 addresses
    the Kata/containerd area separately.
  • These first runs did not use fix: validate cache-only Ubuntu GPU images and preserve prerequisites #9693's cache-only VHDs. Follow-up cloud results
    will be recorded separately, not inferred from local coverage.
  • Follow-up GPU run 183956291:
    15 passed, 176 skipped, 3 failed. Both new cases were rejected before VM
    creation by the run-wide scriptless artifact guard; they did not exercise
    driver recovery. The effective-mode correction above fixes that harness
    mismatch. The third failure remained the RTX Bastion timeout; A100 and H100
    quota skips are not passes.
  • Follow-up general E2E 183956281 repeated the same sole Kata migration-warning
    failure, with 133 passed and 60 skipped. No unrelated product fix is included.

Latest cloud verification:

  • GPU 183962024:
    19 passed, 0 flaky, 174 skipped, 1 failed. Both new validation-only scenarios
    passed on their first attempt against the same main-tag prebakes that failed
    initially. Their VM traces execute the changed function: SMI status 12,
    normal installation, then working nvidia-smi with driver 580.159.04.
    The remaining RTX failure starts with Azure AllocationFailed in southeastasia,
    before the secondary Bastion/SSH failures; it is not a driver-validation result.
  • General E2E 183962015: 133 passed, 60 skipped, 1 failed, again the same
    non-GPU Kata/containerd migration warning.
  • Changed-image run 183965109
    finished 2 passed / 187 skipped / 5 failed against producer 183958924.
    Both westus3 GRID cases passed first attempt with driver 570.237. Five T4
    cases failed before VM creation: the PR images use Shallow replication,
    which cannot be extended to westus2. The image helper retried this permanent
    Azure error for 3000 seconds; these failures provide no driver result.
  • Replacement 183976638
    succeeded: 6 passed, 1 flaky, 187 skipped, 0 failed. All seven required
    scenarios eventually passed on current producer 183969331 images
    2204gen2containerd/1.1790986591.27907 and
    2404gen2containerd/1.1790986591.7556. Isolated test-only 8bc42be retains
    this consumer source, scenario definitions/SKUs/validators, current CSE,
    no capacity skips and one retry; only T4 placement moves to the images'
    westus3 region. Neither product PR changes regional placement.
  • Both validation-only scenarios passed first attempt. Their actual CSE traces
    show command -v nvidia-modprobe failing, driver_payload_missing=true,
    immediate configGPUDrivers, then healthy SMI 580.159.04/CUDA 13.0.
    Both opt-out cases, 22.04 GRID, and 24.04 GRID/device-plugin passed first
    attempt. These are changed-image results, separate from old-prebake NVML
    recovery above; whole-scenario times are not isolated installer benchmarks.
  • Ubuntu2204_GPUNC required its configured retry: first VMSS provisioning
    timed out after 17m38s; the unchanged source/image passed attempt 2 in 9m22s.
    Only serial diagnostics survived the first attempt, showing NVIDIA module
    loading but not a complete CSE result. Its precise timeout cause remains
    unresolved; this is not claimed as a clean first-attempt or platform-only
    result. All eight explicitly created GPU-attempt VMSS are confirmed absent.
  • The two VMSS identities from 183965109 and all 120 logged VMSS identities
    from consumer VHD gate 183962012 are independently confirmed absent. That
    gate's downstream E2E finished 117 passed / 76 skipped / 1 failed, again on
    the same non-GPU Kata migration warning; its image build/content jobs passed.

Rollout:

Release this consumer change before broad cache-only image rollout where
validation-only callers need the saved retry budget. Existing CSE still has its
normal-install fallback, but its latency must be accounted for.

Targeted GPU success is not full release approval. Broad CI still has the
documented Kata/RTX failures; the companion producer gate also has an unresolved
LocalDNS fault-injection assertion. Distinct-VM GPU PIS, kernel-update/reboot,
and existing-image/fleet remediation remain separate acceptance work.

Which issue(s) this PR fixes:

No automatic issue or alternative-PR closure.

Preserve the CSE budget on cache-only VHDs while retaining readiness retries for existing drivers and the normal installation fallback.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 61d3dd43-5cc2-49b3-9ce5-fbe943764363
Reuse the existing T4 scenario with the distinct ConfigGPUDriverIfNeeded=false input on both supported shared images, preserving existing unconditional-install coverage.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 61d3dd43-5cc2-49b3-9ce5-fbe943764363

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

Review effort: Lite
Findings: 2 Medium severity

Open (2)
What changed in this PR

Reduces GPU validation latency on managed Ubuntu amd64 VHD nodes by skipping futile retries when nvidia-modprobe is not installed and immediately running the normal driver installer, plus adds tests and e2e coverage for the validation-only path.

Changes:

  • Update validateGPUDrivers to detect missing nvidia-modprobe on Ubuntu amd64 VHDs and install drivers before validation retries.
  • Add shell spec coverage for cache-only Ubuntu VHD validation behavior and legacy behavior preservation.
  • Add e2e “validation-only” GPU scenarios for Ubuntu 22.04 and 24.04 VHDs.
File Description
vhdbuilder/​packer/​README.md Documents the new Ubuntu amd64 VHD GPU validation behavior and rationale.
spec/​parts/​linux/​cloud-init/​artifacts/​cse_config_gpu_spec.sh Adds spec cases covering cache-only Ubuntu VHD behavior, failure propagation, and legacy paths.
parts/​linux/​cloud-init/​artifacts/​cse_config_gpu.sh Implements early installer selection when nvidia-modprobe is absent on Ubuntu amd64 VHDs.
e2e/​scenario/​scenario.go Adds validation-only GPU scenarios to exercise the new behavior in e2e.

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

Comment thread e2e/scenario/scenario.go
Comment on lines 1475 to 1479

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The reused constructor currently has two 22.04-specific values: Config.VHD and Description; this wrapper replaces both. The T4 hardware, node settings and validators are otherwise shared, and the existing unconditional-install cases remain unchanged. This intentionally reuses the established scenario rather than copying its bootstrap/validator implementation. There is no current 24.04 behavior depending on 22.04-specific logic; keeping this limited reuse for the focused fallback change.

Comment thread spec/parts/linux/cloud-init/artifacts/cse_config_gpu_spec.sh
Copilot AI balanced review requested due to automatic review settings October 2, 2026 22:19

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

Review effort: Lite
Findings: 3 Medium severity

Open (3)

Comment thread spec/parts/linux/cloud-init/artifacts/cse_config_gpu_spec.sh
Handle NVIDIA status 12 without changing other readiness retries. Deliver current CSE in validation-only E2E scenarios instead of baked-in scripts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 61d3dd43-5cc2-49b3-9ce5-fbe943764363
Copilot AI balanced review requested due to automatic review settings October 2, 2026 22:47
@ganeshkumarashok Ganeshkumar Ashokavardhanan (ganeshkumarashok) changed the title fix(gpu): install missing Ubuntu VHD drivers before validation retries fix: install absent or incomplete managed Ubuntu GPU drivers Oct 2, 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.

Comment thread e2e/scenario/scenario.go
}
validateGPU := s.Config.Validator
s.Config.Validator = func(ctx context.Context, s *Scenario) error {
return errors.Join(validateGPU(ctx, s), ValidateNvidiaSMIInstalled(ctx, s))
validateGPUDrivers() {
retrycmd_if_failure 24 5 25 nvidia-modprobe -u -c0 && echo "gpu driver loaded" || configGPUDrivers || exit $ERR_GPU_DRIVERS_START_FAIL
local driver_payload_missing=false
if [ "$OS" = "$UBUNTU_OS_NAME" ] && [ "${IS_VHD,,}" = "true" ] &&
Comment on lines +114 to +123
if ! command -v nvidia-modprobe >/dev/null 2>&1; then
driver_payload_missing=true
elif command -v nvidia-smi >/dev/null 2>&1; then
local smi_status=0
timeout 30 nvidia-smi >/dev/null 2>&1 || smi_status=$?
# NVIDIA exit 12 means NVML cannot be loaded, even if a prebaked kernel module loads.
if [ "$smi_status" -eq 12 ]; then
driver_payload_missing=true
fi
fi
@github-actions

github-actions Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Windows Unit Test Results

  3 files   18 suites   1m 7s ⏱️
551 tests 551 ✅ 0 💤 0 ❌
554 runs  554 ✅ 0 💤 0 ❌

Results for commit edc4339.

♻️ This comment has been updated with latest results.

Honor the final NBC scriptless flag after scenario overrides. Exercise real VMSS artifact generation across eight Ubuntu legacy/scriptless cases without cloud resource creation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 61d3dd43-5cc2-49b3-9ce5-fbe943764363
Copilot AI balanced review requested due to automatic review settings October 2, 2026 23:25
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
test 0% ❌
windows 27% ❌
staging_cse_windows Package 1 65% ➖
debug 0% ❌
provisioningscripts 2% ❌
parts_windows Package 1 76% ➖
Summary 39% (1663 / 6838) ❌

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.

@github-actions

github-actions Bot commented Oct 2, 2026

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% (6317 / 8582) ➖

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Code Coverage

Package Line Rate Health
shellspec spec 22% ❌
Summary 22% (3178 / 14347) ❌

@aks-node-assistant

Copy link
Copy Markdown
Contributor

AgentBaker Linux gate detective

Run: 183962012
Failed job/stage/task: e2e / Run AgentBaker E2E / Run AgentBaker E2E

Detective summary: E2E completed 192 scenarios with 117 passed, 0 flaky, 74 skipped, and 1 failed; AzureLinuxV3Gen2Kata failed because the validator rejected containerd output containing the v2-to-v4 migration warning.

Likely cause / signature: e2e-azurelinuxv3gen2kata-containerd-v2-migration-warning - recurring strict Kata/containerd config validation failure on the containerd v2-to-v4 migration warning; repair item #39969892 is already open.

Confidence: High for recurring E2E validator/image dependency drift rather than a new build break.

Recommended owner/action: Node/AgentBaker owners should continue repair #39969892; PR owner only needs to act if this PR intentionally changes Kata/containerd config generation or validation inputs.

Strongest alternative: PR 9692 changes GPU/CSE config and VMSS test code, but the fatal scenario is the same Kata/containerd validation signature recurring across unrelated PRs.

Evidence: build run, failed timeline records, focused Run AgentBaker E2E log, build metadata, PR changed files, and wiki tracker.

Wiki: e2e-azurelinuxv3gen2kata-containerd-v2-migration-warning

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants