8000 [kubernetes] Pre-install NVIDIA GPU Driver by kvaps · Pull Request #863 · cozystack/cozystack · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[kubernetes] Pre-install NVIDIA GPU Driver #863

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kvaps
Copy link
Member
@kvaps kvaps commented Apr 23, 2025

Signed-off-by: Andrei Kvapil kvapss@gmail.com

Summary by CodeRabbit

  • New Features
    • Added NVIDIA driver support (nvidia-dkms-535) to the Ubuntu container disk image for improved GPU compatibility.

@kvaps kvaps requested review from lllamnyp and klinch0 as code owners April 23, 2025 13:26
Copy link
Contributor
coderabbitai bot commented Apr 23, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The Dockerfile for the Ubuntu container disk image in the Kubernetes application package was updated to include the installation of the NVIDIA driver package nvidia-dkms-535. This addition is achieved by appending a command to install the driver using apt-get via guestfish --remote, following the installation of Kubernetes components. No changes were made to the declarations of exported or public entities.

Changes

File(s) Change Summary
packages/apps/kubernetes/images/ubuntu-container-disk/Dockerfile Added installation of the NVIDIA driver package nvidia-dkms-535 using guestfish --remote.

Poem

In the Dockerfile, a tweak so neat,
NVIDIA drivers now complete!
With guestfish magic, drivers install,
Kubernetes runs for one and all.
Now GPUs hum in harmony,
Thanks to this container symphony!
🐇✨


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor
@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c22603b and d0688d3.

📒 Files selected for processing (1)
  • packages/apps/kubernetes/images/ubuntu-container-disk/Dockerfile (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: pre-commit
  • GitHub Check: Build and Test
🔇 Additional comments (1)
packages/apps/kubernetes/images/ubuntu-container-disk/Dockerfile (1)

40-40: No changes required for the comment line.
The # install nvidia driver comment is clear and consistent with the surrounding Dockerfile.

8000

@@ -37,6 +37,8 @@ RUN qemu-img resize image.img 5G \
&& guestfish --remote command "sed -i '/SystemdCgroup/ s/=.*/= true/' /etc/containerd/config.toml" \
# install kubernetes
&& guestfish --remote command "apt-get install -y kubelet kubeadm" \
# install nvidia driver
&& guestfish --remote command "apt-get install -y install nvidia-dkms-535" \
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix the apt‑get install command typo and enhance GPU support.
The command currently reads:

apt-get install -y install nvidia-dkms-535

– the duplicated install keyword will break the invocation. Remove the extra word. Additionally, consider installing the nvidia-driver-535 meta‑package (which pulls in the necessary userland components) and nvidia-container-toolkit to enable GPU support in containers.

Minimal fix:

- && guestfish --remote command "apt-get install -y install nvidia-dkms-535" \
+ && guestfish --remote command "apt-get install -y nvidia-dkms-535" \

For full GPU driver + runtime support, you might instead do:

- && guestfish --remote command "apt-get install -y install nvidia-dkms-535" \
+ && guestfish --remote command "apt-get install -y nvidia-driver-535 nvidia-dkms-535 nvidia-container-toolkit" \
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
&& guestfish --remote command "apt-get install -y install nvidia-dkms-535" \
&& guestfish --remote command "apt-get install -y nvidia-dkms-535" \

@kvaps kvaps marked this pull request as draft April 23, 2025 13:31
@kvaps kvaps force-pushed the kubernetes-ubuntu-gpu branch from d0688d3 to 9786db4 Compare April 23, 2025 14:28
@kvaps kvaps force-pushed the kubernetes-ubuntu-gpu branch from 9786db4 to 969268d Compare April 23, 2025 22:22
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@kvaps kvaps force-pushed the kubernetes-ubuntu-gpu branch from 969268d to 126a842 Compare April 23, 2025 22:39
@kvaps
Copy link
Member Author
kvaps commented Apr 24, 2025

There is still some issues with driver load.

It does not work with gpuOperator.valuesOverride.gpu-operator.driver.enabled=false:

# k logs -n cozy-gpu-operator nvidia-container-toolkit-daemonset-4h9xn -f driver-validation
time="2025-04-24T07:21:03Z" level=info msg="version: b5479aaa-amd64, commit: b5479aa"
time="2025-04-24T07:21:03Z" level=info msg="Attempting to validate a pre-installed driver on the host"
time="2025-04-24T07:21:03Z" level=info msg="Attempting to validate a driver container installation"
time="2025-04-24T07:21:03Z" level=warning msg="failed to validate the driver, retrying after 5 seconds\n"
time="2025-04-24T07:21:08Z" level=info msg="Attempting to validate a driver container installation"
time="2025-04-24T07:21:08Z" level=warning msg="failed to validate the driver, retrying after 5 seconds\n"
time="2025-04-24T07:21:13Z" level=info msg="Attempting to validate a driver container installation"
time="2025-04-24T07:21:13Z" level=warning msg="failed to validate the driver, retrying after 5 seconds\n"
time="2025-04-24T07:21:18Z" level=info msg="Attempting to validate a driver container installation"
time="2025-04-24T07:21:18Z" level=warning msg="failed to validate the driver, retrying after 5 seconds\n"
time="2025-04-24T07:21:23Z" level=info msg="Attempting to validate a driver container installation"
time="2025-04-24T07:21:23Z" level=warning msg="failed to validate the driver, retrying after 5 seconds\n"
time="2025-04-24T07:21:28Z" level=info msg="Attempting to validate a driver container installation"
time="2025-04-24T07:21:28Z" level=warning msg="failed to validate the driver, retrying after 5 seconds\n"
time="2025-04-24T07:21:33Z" level=info msg="Attempting to validate a driver container installation"

Same as with gpuOperator.valuesOverride.gpu-operator.driver.enabled=true:

# k logs -n cozy-gpu-operator nvidia-driver-daemonset-qnck2 -f k8s-driver-manager
Getting current value of the 'nvidia.com/gpu.deploy.operator-validator' node label
Current value of 'nvidia.com/gpu.deploy.operator-validator=true'
Getting current value of the 'nvidia.com/gpu.deploy.container-toolkit' node label
Current value of 'nvidia.com/gpu.deploy.container-toolkit=true'
Getting current value of the 'nvidia.com/gpu.deploy.device-plugin' node label
Current value of 'nvidia.com/gpu.deploy.device-plugin=true'
Getting current value of the 'nvidia.com/gpu.deploy.gpu-feature-discovery' node label
Current value of 'nvidia.com/gpu.deploy.gpu-feature-discovery=true'
Getting current value of the 'nvidia.com/gpu.deploy.dcgm-exporter' node label
Current value of 'nvidia.com/gpu.deploy.dcgm-exporter=true'
Getting current value of the 'nvidia.com/gpu.deploy.dcgm' node label
Current value of 'nvidia.com/gpu.deploy.dcgm=true'
Getting current value of the 'nvidia.com/gpu.deploy.mig-manager' node label
Current value of 'nvidia.com/gpu.deploy.mig-manager='
Getting current value of the 'nvidia.com/gpu.deploy.nvsm' node label
Current value of 'nvidia.com/gpu.deploy.nvsm='
Getting current value of the 'nvidia.com/gpu.deploy.sandbox-validator' node label
Current value of 'nvidia.com/gpu.deploy.sandbox-validator='
Getting current value of the 'nvidia.com/gpu.deploy.sandbox-device-plugin' node label
Current value of 'nvidia.com/gpu.deploy.sandbox-device-plugin='
Getting current value of the 'nvidia.com/gpu.deploy.vgpu-device-manager' node label
Current value of 'nvidia.com/gpu.deploy.vgpu-device-manager='
Current value of AUTO_UPGRADE_POLICY_ENABLED=true'
Shutting down all GPU clients on the current node by disabling their component-specific nodeSelector labels
node/kubernetes-abcdef-md1-lsctb-7xqzz labeled
Waiting for the operator-validator to shutdown
Waiting for the container-toolkit to shutdown
pod/nvidia-container-toolkit-daemonset-g64fn condition met
Waiting for the device-plugin to shutdown
Waiting for gpu-feature-discovery to shutdown
Waiting for dcgm-exporter to shutdown
Waiting for dcgm to shutdown
Auto eviction of GPU pods on node kubernetes-abcdef-md1-lsctb-7xqzz is disabled by the upgrade policy
Unloading NVIDIA driver kernel modules...
nvidia_uvm           1785856  0
nvidia_drm            110592  0
nvidia_modeset       1699840  1 nvidia_drm
nvidia              11513856  2 nvidia_uvm,nvidia_modeset
drm_kms_helper        311296  1 nvidia_drm
drm                   622592  4 drm_kms_helper,nvidia,nvidia_drm
Could not unload NVIDIA driver kernel modules, driver is in use
Auto drain of the node kubernetes-abcdef-md1-lsctb-7xqzz is disabled by the upgrade policy
Failed to uninstall nvidia driver components
Auto eviction of GPU pods on node kubernetes-abcdef-md1-lsctb-7xqzz is disabled by the upgrade policy
Auto drain of the node kubernetes-abcdef-md1-lsctb-7xqzz is disabled by the upgrade policy
Rescheduling all GPU clients on the current node by enabling their component-specific nodeSelector labels
node/kubernetes-abcdef-md1-lsctb-7xqzz labeled

Also it significantly increases pipeline time, and decreases the user flexibility, so I would keep it as-is for now.

7247
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0