cozystack icon indicating copy to clipboard operation
cozystack copied to clipboard

[kubernetes] Pre-install NVIDIA GPU Driver

Open kvaps opened this issue 8 months ago • 2 comments

Signed-off-by: Andrei Kvapil [email protected]

Summary by CodeRabbit

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

kvaps avatar Apr 23 '25 13:04 kvaps

[!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.

coderabbitai[bot] avatar Apr 23 '25 13:04 coderabbitai[bot]

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.

kvaps avatar Apr 24 '25 07:04 kvaps