-
Notifications
You must be signed in to change notification settings - Fork 265
feat(gpu): pre-bake NVIDIA CUDA kernel module into the VHD #8661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ganeshkumarashok
wants to merge
3
commits into
main
Choose a base branch
from
gpu-prebake-cuda-driver
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
spec/parts/linux/cloud-init/artifacts/cse_install_ubuntu_spec.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| #!/bin/bash | ||
|
|
||
| Describe 'cse_install_ubuntu.sh' | ||
| Include "./parts/linux/cloud-init/artifacts/ubuntu/cse_install_ubuntu.sh" | ||
|
|
||
| Describe 'cleanUpPrebakedGPUDriver' | ||
| It 'is a no-op when the prebake marker is absent' | ||
| GPU_DKMS_MARKER_FILE="/tmp/aks-gpu-marker-absent-$$" | ||
| When call cleanUpPrebakedGPUDriver | ||
| The status should be success | ||
| The output should equal "" | ||
| End | ||
|
|
||
| It 'deregisters the nvidia DKMS module and removes baked artifacts (libs, binaries, marker) when present' | ||
| marker="$(mktemp)" | ||
| GPU_DKMS_MARKER_FILE="${marker}" | ||
| rm() { echo "mock rm $*"; } | ||
| ldconfig() { echo "mock ldconfig"; } | ||
| When call cleanUpPrebakedGPUDriver | ||
| The status should be success | ||
| The output should include "Removing pre-baked NVIDIA driver" | ||
| # deregisters via the DKMS source tree + built module removal (no slow dkms remove) | ||
| The output should include "mock rm -rf /var/lib/dkms/nvidia" | ||
| The output should include "mock rm -f /lib/modules" | ||
| # relocated userspace libs | ||
| The output should include "mock rm -rf /usr/bin/lib64" | ||
| # driver userspace binaries so nvidia-smi becomes "command not found" on non-GPU nodes | ||
| The output should include "mock rm -f /usr/bin/nvidia-smi" | ||
| The output should include "mock ldconfig" | ||
| # the slow per-version dkms remove --all must NOT be on the critical path anymore | ||
| The output should not include "dkms remove" | ||
| End | ||
|
Comment on lines
+14
to
+32
|
||
| End | ||
| End | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two are assigned without
local, so they leak into the global shell scope (bash treats any in-function assignment withoutlocalas global). The siblinginstallGPUDriverImagejust above already useslocal gpuInstallAction="${1:-install}"— suggest matching that here:The later
GPU_INSTALL_ACTION="install-skip-build"reassignment is unaffected. Not a functional bug (both are set unconditionally before use and passed explicitly as a positional arg), but CLAUDE.md calls this out: "use local variables rather than constants when their scoping allows for it" and "avoid using variables declared inside another function, even they are visible. It is hard to reason and might introduce subtle bugs."