Skip to content

docs(core-concepts): clarify which cu/nvml symbols libvgpu.so intercepts - #754

Merged
rootsongjc merged 1 commit into
Project-HAMi:masterfrom
ipsitapp8:docs/clarify-libvgpu-hook-scope
Aug 13, 2026
Merged

docs(core-concepts): clarify which cu/nvml symbols libvgpu.so intercepts#754
rootsongjc merged 1 commit into
Project-HAMi:masterfrom
ipsitapp8:docs/clarify-libvgpu-hook-scope

Conversation

@ipsitapp8

@ipsitapp8 ipsitapp8 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind documentation

What this PR does / why we need it:

The GPU virtualization page says HAMi-Core hijacks NVIDIA library functions "starting with cu/nvml", and that it intercepts "all function calls starting with cu and nvml". That is broader than what libvgpu.so does.

dlsym is overridden in src/libvgpu.c, but what comes back is decided by a lookup, not by the prefix:

  • nvml* goes to __dlsym_hook_section_nvml(), which is an explicit list of DLSYM_HOOK_FUNC(...) entries. A symbol that is not in the list returns NULL and falls through to the real dlsym.

  • cu* is resolved against libvgpu.so itself first. If HAMi-Core defines no wrapper for it, it falls through the same way. The cuGetProcAddress path goes through __dlsym_hook_section(), which is the same kind of list.

  • One family is skipped outright, in find_symbols_in_table() in src/cuda/hook.c:

    /* Skip CUDA graph functions: let them fall through to real driver */
    if (strncmp(symbol, "cuGraph", 7) == 0) {
        return NULL;
    }

This matters when the page is used to debug an isolation gap. "Every cu/nvml call is intercepted" and "the calls in the hook table are intercepted" point at different causes for an allocation that got past the limit.

The change touches the HAMi-Core row in the component table and the dlsym paragraph in the interception flow section, in English and Chinese. Text only, no links or page structure changed.

AI assistance: I used Claude Code to check the existing wording against the HAMi-core source.

Which issue(s) this PR fixes:

None. 4 changed lines, below the 100 line threshold that requires an issue first.

Checklist:

  • npm run lint and npm run format:check pass
  • npm run build succeeds for both en and zh
  • Chinese translation updated if English docs changed (or noted why not)
  • Commits are signed off (git commit -s)

Note on the first box: markdownlint is clean across the repo and Prettier is clean on both changed files. Running npm run format:check on a Windows checkout reports every file in the repo, including untouched ones on master, because core.autocrlf gives CRLF line endings locally. That is a local artifact, not something in this diff.

Summary by CodeRabbit

  • Documentation
    • Clarified that only explicitly registered NVIDIA functions are intercepted by the virtualization library.
    • Documented that unregistered functions resolve normally to the underlying driver.
    • Updated both English and Chinese GPU virtualization documentation.

The GPU virtualization page said HAMi-Core hijacks all functions starting
with cu and nvml. Interception is actually limited to the symbols listed in
the DLSYM_HOOK_FUNC sections of src/libvgpu.c; anything not listed resolves
to the real driver, and cuGraph* is skipped outright in
find_symbols_in_table().

Updates the component table and the dlsym section, plus the zh translation.

Signed-off-by: ipsitapp8 <ipsitapp8@gmail.com>
@hami-robot hami-robot Bot added kind/documentation Improvements or additions to documentation dco-signoff: yes labels Aug 11, 2026
@netlify

netlify Bot commented Aug 11, 2026

Copy link
Copy Markdown

Deploy Preview for project-hami ready!

Name Link
🔨 Latest commit b3db299
🔍 Latest deploy log https://app.netlify.com/projects/project-hami/deploys/6a7ac59e0aec2400088fd02d
😎 Deploy Preview https://deploy-preview-754--project-hami.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d7e5ba57-5176-4111-9996-6c6987ecdebe

📥 Commits

Reviewing files that changed from the base of the PR and between fe70b57 and b3db299.

📒 Files selected for processing (2)
  • docs/core-concepts/gpu-virtualization.md
  • i18n/zh/docusaurus-plugin-content-docs/current/core-concepts/gpu-virtualization.md

📝 Walkthrough

Walkthrough

The English and Chinese GPU virtualization documentation now states that libvgpu.so intercepts only cu and nvml functions listed in its hook table. Unlisted functions resolve normally to the real driver.

Changes

GPU virtualization documentation

Layer / File(s) Summary
Hook-table interception semantics
docs/core-concepts/gpu-virtualization.md, i18n/zh/docusaurus-plugin-content-docs/current/core-concepts/gpu-virtualization.md
The documentation describes selective interception of listed NVIDIA functions and normal resolution of unlisted functions.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Suggested reviewers: mesutoezdil

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the documentation change to clarify which cu/nvml symbols libvgpu.so intercepts.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

@rootsongjc rootsongjc 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.

/lgtm

@hami-robot

hami-robot Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ipsitapp8, rootsongjc
Once this PR has been reviewed and has the lgtm label, please assign windsonsea for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rootsongjc
rootsongjc merged commit a13f7ba into Project-HAMi:master Aug 13, 2026
12 of 13 checks passed
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