-
Notifications
You must be signed in to change notification settings - Fork 93
docs: add simulated GPU scheduling troubleshooting #788
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
Samkeliso-dube00
wants to merge
2
commits into
Project-HAMi:master
Choose a base branch
from
Samkeliso-dube00:docs/simulated-gpu-scheduling-troubleshooting
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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
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 |
|---|---|---|
|
|
@@ -160,3 +160,178 @@ devicePlugin: | |
| ``` | ||
|
|
||
| ::: | ||
|
|
||
| ## GPU Pod Scheduling Failure with Simulated GPUs | ||
|
|
||
| When using simulated GPUs with HAMi, a GPU workload can remain `Pending` even though Kubernetes advertises the simulated GPU resources. | ||
|
|
||
| ### Symptom | ||
|
|
||
| A GPU workload remains unscheduled: | ||
|
|
||
| ```bash | ||
| kubectl get pod hami-gpu-test -o wide | ||
| ``` | ||
|
|
||
| Output: | ||
|
|
||
| ``` | ||
| NAME READY STATUS RESTARTS AGE | ||
| hami-gpu-test 0/1 Pending 0 5m | ||
| ``` | ||
|
|
||
| The pod events may show: | ||
|
|
||
| ``` | ||
| Warning FailedScheduling ... node ... has been locked within 5m0s | ||
| ``` | ||
|
|
||
| HAMi scheduler logs may also report: | ||
|
|
||
| ``` | ||
| failed to decode node devices | ||
| ``` | ||
|
|
||
| ### Cause | ||
|
|
||
| HAMi needs the GPU device information on the node in its expected JSON format. | ||
|
|
||
| In this simulated-GPU setup, the node annotation contained a colon-delimited device string: | ||
|
|
||
| ``` | ||
| GPU-MOCK-0,0,11441,100,NVIDIA-Tesla-K80,0,true:GPU-MOCK-1,1,11441,100,NVIDIA-Tesla-K80,0,true: | ||
| ``` | ||
|
|
||
| HAMi expected JSON and therefore failed to decode the node device information: | ||
|
|
||
| ``` | ||
| failed to decode node devices | ||
| err="invalid character 'G' looking for beginning of value" | ||
| ``` | ||
|
|
||
| ### Solution | ||
|
|
||
| Register the simulated NVIDIA devices on the node using the HAMi node registration annotation. | ||
|
|
||
| Apply the annotation with proper JSON format: | ||
|
|
||
| ```bash | ||
| kubectl annotate node kcna-cluster-worker \ | ||
|
Samkeliso-dube00 marked this conversation as resolved.
|
||
| 'hami.io/node-nvidia-register=[{"id":"GPU-MOCK-0","count":1,"devmem":11441,"devcore":100,"type":"NVIDIA-Tesla-K80","health":true,"numa":0,"mode":"hami-core"},{"id":"GPU-MOCK-1","count":1,"devmem":11441,"devcore":100,"type":"NVIDIA-Tesla-K80","health":true,"numa":0,"mode":"hami-core"}]' \ | ||
| --overwrite | ||
| ``` | ||
|
|
||
| Verify the annotation: | ||
|
|
||
| ```bash | ||
| kubectl get node kcna-cluster-worker \ | ||
| -o jsonpath='{.metadata.annotations.hami\.io/node-nvidia-register}' | ||
| echo | ||
| ``` | ||
|
|
||
| The output should contain a valid JSON array similar to: | ||
|
|
||
| ```json | ||
| [ | ||
| { | ||
| "id": "GPU-MOCK-0", | ||
| "count": 1, | ||
| "devmem": 11441, | ||
| "devcore": 100, | ||
| "type": "NVIDIA-Tesla-K80", | ||
| "health": true, | ||
| "numa": 0, | ||
| "mode": "hami-core" | ||
| }, | ||
| { | ||
| "id": "GPU-MOCK-1", | ||
| "count": 1, | ||
| "devmem": 11441, | ||
| "devcore": 100, | ||
| "type": "NVIDIA-Tesla-K80", | ||
| "health": true, | ||
| "numa": 0, | ||
| "mode": "hami-core" | ||
| } | ||
| ] | ||
| ``` | ||
|
|
||
| Then delete and recreate the affected pod so HAMi can attempt scheduling again: | ||
|
|
||
| ```bash | ||
| kubectl delete pod hami-gpu-test | ||
| ``` | ||
|
|
||
| Recreate the workload using the GPU resource request appropriate for the test environment. | ||
|
|
||
| ### Verification | ||
|
|
||
| Check the pod: | ||
|
|
||
| ```bash | ||
| kubectl get pod hami-gpu-test -o wide | ||
| ``` | ||
|
|
||
| A successful result should show the pod running on the registered node: | ||
|
|
||
| ``` | ||
| NAME READY STATUS RESTARTS AGE | ||
| hami-gpu-test 1/1 Running 0 11s | ||
| ``` | ||
|
|
||
| Check the scheduling events: | ||
|
|
||
| ```bash | ||
| kubectl describe pod hami-gpu-test | grep -A10 "Events:" | ||
| ``` | ||
|
|
||
| Successful scheduling should include messages similar to: | ||
|
|
||
| ``` | ||
| Normal FilteringSucceed ... find fit node(kcna-cluster-worker) | ||
| Normal BindingSucceed ... Successfully binding node [kcna-cluster-worker] | ||
| Normal Scheduled ... Successfully assigned default/hami-gpu-test to kcna-cluster-worker | ||
| ``` | ||
|
|
||
| ### Troubleshooting | ||
|
|
||
| If the pod remains `Pending`,verify that Kubernetes advertises the simulated GPU resources: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing space after the comma. |
||
|
|
||
| ```bash | ||
| kubectl get node kcna-cluster-worker \ | ||
| -o jsonpath='{.status.capacity.nvidia\.com/gpu}' | ||
| echo | ||
| ``` | ||
|
|
||
| Check the HAMi GPU registration annotation: | ||
|
|
||
| ```bash | ||
| kubectl get node kcna-cluster-worker \ | ||
| -o jsonpath='{.metadata.annotations.hami\.io/node-nvidia-register}' | ||
| echo | ||
| ``` | ||
|
|
||
| Check the HAMi scheduler logs: | ||
|
|
||
| ```bash | ||
| kubectl logs -n kube-system \ | ||
| -l app.kubernetes.io/component=hami-scheduler \ | ||
| --tail=200 | ||
| ``` | ||
|
|
||
| Look specifically for: | ||
|
|
||
| ``` | ||
| failed to decode node devices | ||
| ``` | ||
|
|
||
| If this error appears, inspect the `hami.io/node-nvidia-register` annotation and make sure it contains valid JSON. | ||
|
|
||
| ### Environment Tested | ||
|
|
||
| - Kubernetes v1.36.1 | ||
| - HAMi v2.9.0 | ||
| - Kind | ||
| - Simulated GPUs | ||
| - Two simulated NVIDIA devices on the worker node | ||
| - Node: `kcna-cluster-worker` | ||
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.
heads up: #741, #773, #779 and #783 all append sections to this same file, and #767 covers the filtering events in depth. coordinate merge order to avoid conflicts and duplication.