Skip to content

fix(gpu): tear down cuda-lts VHD prebake on GRID nodes [backport #8919 to v20260709] - #8924

Merged
ganeshkumarashok merged 2 commits into
official/v20260709from
ganesh/grid-prebake-teardown-0709-backport
Jul 13, 2026
Merged

fix(gpu): tear down cuda-lts VHD prebake on GRID nodes [backport #8919 to v20260709]#8924
ganeshkumarashok merged 2 commits into
official/v20260709from
ganesh/grid-prebake-teardown-0709-backport

Conversation

@ganeshkumarashok

Copy link
Copy Markdown
Contributor

Summary

Backport of #8919 to the official/v20260709 release branch (prebake-enabled VHD).

Fixes nvidia-smi failing with "Failed to initialize NVML: Driver/library version mismatch" on agentpool GRID / converged A10 (NVv5) nodes and NAP GRID nodes booting the CUDA-prebaked shared Ubuntu VHD.

Root cause: the shared Ubuntu VHD prebakes only the cuda(-lts) driver + a DKMS marker. The existing cleanUpPrebakedGPUDriver only runs on nodes that do not install a managed driver. A GRID node installs the grid driver on top of the stale prebaked cuda module + /usr/bin/lib64 libs → NVML mismatch.

Fix: cleanUpGridNodeCudaPrebake, invoked from ensureGPUDrivers before the configGPUDrivers/validateGPUDrivers dispatch, tears down the prebake when the node installs grid and the marker is not grid (cuda / legacy kind-less). Pure driver-kind mismatch; CUDA nodes untouched.

Cherry-pick of the squashed main commit 947d2def64 — verified the introduced patch body is identical to what merged on main.

Related

Test plan

  • shellcheck clean; ShellSpec coverage for cleanUpGridNodeCudaPrebake (incl. non-Ubuntu no-op)
  • e2e on an agentpool GRID/A10 node + a NAP GRID node booting the prebaked VHD

🤖 Generated with Claude Code

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.

Pull request overview

Backports the GPU provisioning fix from #8919 onto official/v20260709 to prevent NVML driver/library mismatches on GRID (A10 / NVv5) nodes booting from CUDA-prebaked shared Ubuntu VHDs by tearing down a mismatched CUDA prebake before the GRID managed driver install.

Changes:

  • Add cleanUpGridNodeCudaPrebake to remove CUDA-prebaked driver artifacts when the node’s requested managed driver kind is GRID and the VHD marker kind is non-GRID/legacy.
  • Invoke the new cleanup early in ensureGPUDrivers (before the config/validate dispatch) so it applies to both managed driver install paths.
  • Add ShellSpec coverage for the new decision logic (teardown vs no-op, including legacy marker and non-Ubuntu no-op).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
parts/linux/cloud-init/artifacts/cse_config.sh Introduces cleanUpGridNodeCudaPrebake and runs it early in ensureGPUDrivers on Ubuntu to avoid GRID vs CUDA prebake collisions.
spec/parts/linux/cloud-init/artifacts/cse_config_spec.sh Adds ShellSpec tests validating teardown/no-op behavior for GRID vs CUDA marker-kind combinations and non-Ubuntu behavior.

Copilot AI review requested due to automatic review settings July 13, 2026 22:46
@github-actions

Copy link
Copy Markdown
Contributor

Changes cached containers or packages on windows VHDs

Please get a Windows SIG member to approve.

The following dif file shows any additions or deletions from what will be cached on windows VHDs organised by VHD type.

  • Additions are new things cached.
  • Deletions are things no longer cached.
diff --git a/vhd_files/2025-gen2-tl.txt b/vhd_files/2025-gen2-tl.txt
index a901175..5fc7b9e 100644
--- a/vhd_files/2025-gen2-tl.txt
+++ b/vhd_files/2025-gen2-tl.txt
@@ -34 +33,0 @@ HKLM:\SYSTEM\CurrentControlSet\Policies\Microsoft\FeatureManagement\Overrides\18
-HKLM:\SYSTEM\CurrentControlSet\Policies\Microsoft\FeatureManagement\Overrides\908168846=1
diff --git a/vhd_files/2025-gen2.txt b/vhd_files/2025-gen2.txt
index 4d7aa19..5c054c3 100644
--- a/vhd_files/2025-gen2.txt
+++ b/vhd_files/2025-gen2.txt
@@ -34 +33,0 @@ HKLM:\SYSTEM\CurrentControlSet\Policies\Microsoft\FeatureManagement\Overrides\18
-HKLM:\SYSTEM\CurrentControlSet\Policies\Microsoft\FeatureManagement\Overrides\908168846=1
diff --git a/vhd_files/2025.txt b/vhd_files/2025.txt
index 1441011..1fe4b78 100644
--- a/vhd_files/2025.txt
+++ b/vhd_files/2025.txt
@@ -34 +33,0 @@ HKLM:\SYSTEM\CurrentControlSet\Policies\Microsoft\FeatureManagement\Overrides\18
-HKLM:\SYSTEM\CurrentControlSet\Policies\Microsoft\FeatureManagement\Overrides\908168846=1

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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment on lines +1345 to +1352
# Keep only when the prebake is explicitly grid (matches this grid node). An empty marker kind is
# a legacy cuda prebake; a "cuda" marker is a cuda prebake -- both mismatch a grid node, tear down.
if [ "${m_kind}" = "grid" ]; then
return 0
fi
echo "AKS_GPU_PREBAKE event=grid_cuda_prebake_teardown driver_type=${NVIDIA_GPU_DRIVER_TYPE:-} marker_kind=${m_kind:-none} node_kind=${node_kind} action=teardown"
cleanUpPrebakedGPUDriver
}
@ganeshkumarashok
ganeshkumarashok merged commit da3471a into official/v20260709 Jul 13, 2026
18 of 30 checks passed
@ganeshkumarashok
ganeshkumarashok deleted the ganesh/grid-prebake-teardown-0709-backport branch July 13, 2026 23:16
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.

3 participants