Skip to content

fix: Ensure that Python stub generation works against libnvidia-ml stubs #6188

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
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MartinMarciniszyn
Copy link
Collaborator

@MartinMarciniszyn MartinMarciniszyn commented Jul 18, 2025

Summary by CodeRabbit

  • Chores
    • Improved Docker image build efficiency and reliability by consolidating commands and ensuring correct library linking for GPU support.
    • Simplified build scripts by removing redundant logic related to library file checks and symbolic linking.
    • Updated Docker image tags for LLM-related components to reflect the latest builds.

Signed-off-by: Martin Marciniszyn Mehringer <11665257+MartinMarciniszyn@users.noreply.github.com>
@MartinMarciniszyn MartinMarciniszyn self-assigned this Jul 18, 2025
Copy link

coderabbitai bot commented Jul 18, 2025

Walkthrough

The Docker multi-stage build process was updated to handle the creation of a symbolic link for libnvidia-ml.so directly within the Dockerfile. Corresponding logic for this symlink creation was removed from the Python build script, centralizing the handling of this library in the container build process. Additionally, LLM-related Docker image tags were updated to newer versions.

Changes

File(s) Change Summary
docker/Dockerfile.multi Consolidated OpenCV uninstall/reinstall commands; added RUN command to symlink libnvidia-ml.so.
scripts/build_wheel.py Removed logic for searching and symlinking libnvidia-ml.so; environment variable logic remains.
jenkins/current_image_tags.properties Updated LLM Docker image tags to newer timestamped versions.

Suggested reviewers

  • DomBrown

Poem

In Docker’s warren, links are made anew,
While Python scripts shed tasks they once knew.
No more searching for libraries in fright—
The Dockerfile now makes symlinks right.
A tidy warren, a build more bright!
🐇✨


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a6f21ae and 44c545c.

📒 Files selected for processing (1)
  • jenkins/current_image_tags.properties (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • jenkins/current_image_tags.properties
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Pre-commit Check

🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.

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

@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.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 07e8813 and a6f21ae.

📒 Files selected for processing (2)
  • docker/Dockerfile.multi (2 hunks)
  • scripts/build_wheel.py (0 hunks)
💤 Files with no reviewable changes (1)
  • scripts/build_wheel.py
🔇 Additional comments (1)
docker/Dockerfile.multi (1)

73-77: Uninstall command may miss the actual package name

opencv is not the canonical PyPI package; the wheel in NVIDIA images is usually opencv-python / opencv-python-headless.
If the base layer was installed with opencv-python, the pip uninstall -y opencv line becomes a no-op and leaves the old wheel on disk, defeating the purpose of the clean re-install.

Consider uninstalling all known OpenCV wheels in one shot:

-RUN pip3 uninstall -y opencv &&  \
+RUN pip3 uninstall -y opencv opencv-python opencv-python-headless opencv-contrib-python || true && \

This will work regardless of which flavour was pre-installed.

Signed-off-by: Martin Marciniszyn Mehringer <11665257+MartinMarciniszyn@users.noreply.github.com>
@MartinMarciniszyn
Copy link
Collaborator Author

/bot run --skip-test

@tensorrt-cicd
Copy link
Collaborator

PR_Github #12339 [ run ] triggered by Bot

@MartinMarciniszyn
Copy link
Collaborator Author

Supersedes #5940 .

@xavier-nvidia
Copy link
Contributor

These changes look good to me.

@tensorrt-cicd
Copy link
Collaborator

PR_Github #12339 [ run ] completed with state FAILURE
/LLM/main/L0_MergeRequest_PR pipeline #9166 (Partly Tested) completed with status: 'FAILURE'

if "libnvidia-ml.so" in result.stdout:
line = result.stdout.splitlines()[0]
path = os.path.dirname(line)
new_library_path += f":{path}"
Copy link
Collaborator

@jiaganc jiaganc Jul 21, 2025

Choose a reason for hiding this comment

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

This line adds the stub lib path to LD_LIBRARY_PATH. Removing this causes the build error. I think we need to add code like:

new_library_path += ":/usr/local/cuda/lib64/stub"

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.

4 participants