-
Notifications
You must be signed in to change notification settings - Fork 93
Add Lab 7: GPU isolation on k3s without the GPU Operator #560
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
Merged
hami-robot
merged 2 commits into
Project-HAMi:master
from
saiyam1814:add-hami-isolation-lab
Jul 8, 2026
Merged
Changes from all commits
Commits
Show all changes
2 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
There are no files selected for viewing
385 changes: 385 additions & 0 deletions
385
.../zh/docusaurus-plugin-content-docs-tutorials/current/labs/hami-isolation-k3s.md
Large diffs are not rendered by default.
Oops, something went wrong.
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
28 changes: 28 additions & 0 deletions
28
tutorials/labs/examples/07-hami-isolation-k3s/oversubscribe-pending.yaml
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,28 @@ | ||
| # A third Pod whose memory slice fits the card when it is empty, but NOT alongside | ||
| # the two 8000 MiB slices that hami-share-a / hami-share-b already hold. It stays | ||
| # Pending with CardInsufficientMemory - proving the device plugin and scheduler | ||
| # account the card's memory as one shared, finite budget. | ||
| # | ||
| # Apply this ONLY after hami-share-a and hami-share-b are Running. | ||
| # | ||
| # Sizing (IMPORTANT - adjust for your card): set gpumem ABOVE (card_total - 2*slice) | ||
| # so it cannot fit beside the two slices, and BELOW card_total so it WOULD fit on an | ||
| # empty card. 90000 MiB works for a 96 GB RTX PRO 6000 (97887 MiB) with two 8000 MiB | ||
| # slices held (~82000 free). For a 48 GB card use ~45000; for a 24 GB card with two | ||
| # 4000 MiB slices, use ~20000. | ||
| # Read the card size first: | ||
| # kubectl exec hami-share-a -- nvidia-smi --query-gpu=memory.total --format=csv | ||
| apiVersion: v1 | ||
| kind: Pod | ||
| metadata: | ||
| name: hami-oversubscribe | ||
| spec: | ||
| restartPolicy: Never | ||
| containers: | ||
| - name: cuda | ||
| image: nvidia/cuda:12.4.1-devel-ubuntu22.04 | ||
| command: ["bash", "-c", "nvidia-smi; sleep infinity"] | ||
| resources: | ||
| limits: | ||
| nvidia.com/gpu: 1 | ||
| nvidia.com/gpumem: 90000 |
35 changes: 35 additions & 0 deletions
35
tutorials/labs/examples/07-hami-isolation-k3s/share-two-pods.yaml
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,35 @@ | ||
| # Two Pods, each asking for one physical GPU and an 8000 MiB memory slice. On a | ||
| # 96 GB RTX PRO 6000 (or a 48 GB A6000) both fit with plenty of headroom, so both | ||
| # land on the one GPU. On a 24 GB card use ~4000 MiB instead. | ||
| # | ||
| # The image is the CUDA devel image because the memory probe compiles a tiny CUDA | ||
| # allocator with nvcc inside the Pod. It is large to pull; that is expected. | ||
| apiVersion: v1 | ||
| kind: Pod | ||
| metadata: | ||
| name: hami-share-a | ||
| spec: | ||
| restartPolicy: Never | ||
| containers: | ||
| - name: cuda | ||
| image: nvidia/cuda:12.4.1-devel-ubuntu22.04 | ||
| command: ["bash", "-c", "nvidia-smi; sleep infinity"] | ||
| resources: | ||
| limits: | ||
| nvidia.com/gpu: 1 | ||
| nvidia.com/gpumem: 8000 | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Pod | ||
| metadata: | ||
| name: hami-share-b | ||
| spec: | ||
| restartPolicy: Never | ||
| containers: | ||
| - name: cuda | ||
| image: nvidia/cuda:12.4.1-devel-ubuntu22.04 | ||
| command: ["bash", "-c", "nvidia-smi; sleep infinity"] | ||
| resources: | ||
| limits: | ||
| nvidia.com/gpu: 1 | ||
| nvidia.com/gpumem: 8000 |
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.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
将实验列表和后面的说明拆成独立段落。
LabCardGridAuto会渲染成块级元素,和说明文字写在同一行会导致 MDX 结构不够稳妥。请把后面的说明单独放到一个段落里。♻️ Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents
Source: Linked repositories