fix(edge): discover rocm-smi/amd-smi by absolute path + amdgpu dmesg - #39
Open
rishi-anand wants to merge 1 commit into
Open
fix(edge): discover rocm-smi/amd-smi by absolute path + amdgpu dmesg#39rishi-anand wants to merge 1 commit into
rishi-anand wants to merge 1 commit into
Conversation
On Kairos-based edge hosts the ROCm tooling ships inside GPU-workload containers, not on the host, and it's installed under a versioned directory like /opt/rocm-7.2.1/bin/ that is NOT on the default PATH. The previous logic used `command -v` / `which`, which returned nothing even when the binary was present — so support bundles arrived without any rocm-smi or amd-smi output. amd-smi wasn't attempted at all. Changes to gpu-info(): - Add find-rocm-tool() and find-rocm-tool-in-pod() helpers that search PATH, well-known ROCm install paths (/opt/rocm/bin, /opt/rocm-*/bin, /usr/local/bin, /usr/bin), and fall back to `find /opt` / `find /opt /usr` when the versioned dir isn't matched. All discovered binaries are invoked by absolute path — no PATH dependency. - Attempt both rocm-smi (existing) and amd-smi (new — the modern replacement). Capture version, list, static, metric, firmware, bad-pages, topology from amd-smi. - Emit a rocm-smi-status file when neither tool is found anywhere, documenting exactly where we searched so bundle readers can tell a missed collection from a genuine absence. - Collect `dmesg -T | grep -iE "amdgpu|drm|pcieport"` — kernel-level GPU driver / DRM / PCIe events that userspace tooling doesn't surface. Falls back to non-`-T` dmesg on older utils. Ordering fix: move set-kubeconfig to run before gpu-info in the main flow. gpu-info uses `kubectl exec` as its in-pod fallback, but on Palette edge hosts KUBECONFIG is only set by set-kubeconfig; without this reorder the kubectl fallback silently no-op'd on every collection. Verified end-to-end on an MI325 edge appliance: - amdgpu-dmesg.log populated with pcieport/pciehp events - amd-smi-version.txt returns AMDSMI 26.2.2 / ROCm 7.2.1 / amdgpu 6.16.13 - amd-smi-list.txt enumerates all attached GPUs (BDF, UUID, KFD_ID) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Contributor
Author
|
Verified on live AMD Instinct MI325 edge appliance (Kairos host,
|
brathina-spectro
left a comment
Contributor
There was a problem hiding this comment.
Changes looks good except the mongo collection related block getting deleted.
| } >> "${TMPDIR}/mongo/disk-usage.txt" | ||
| done < <(printf '%s\n' "$MONGO_PODS") | ||
|
|
||
| techo "Collecting MongoDB database + collection sizes" |
Contributor
There was a problem hiding this comment.
Is this being deleted accidentally? We saw a few cases where the mongoDb grew more than expected and so the SB was enhanced to gather info about mongoDb collection.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
On Kairos-based edge hosts the ROCm tooling ships inside GPU-workload containers, not on the host, and it's installed under a versioned directory like
/opt/rocm-7.2.1/bin/that is NOT on the defaultPATH. The previous logic usedcommand -v/which, which returned nothing even when the binary was there — so bundles arrived with norocm-smioramd-smioutput, andamd-smi(the modern replacement) wasn't attempted at all.find-rocm-tool/find-rocm-tool-in-podhelpers: checkPATH, then well-known ROCm install dirs (/opt/rocm/bin,/opt/rocm-*/bin,/usr/local/bin,/usr/bin), then fall back tofind /opt/find /opt /usr. All discovered binaries are invoked by absolute path.rocm-smi(existing) andamd-smi(new). Captureversion,list,static,metric,firmware,bad-pages,topology.rocm-smi-statuswhen neither is found — documents exactly where the script searched so bundle readers can distinguish a missed collection from a genuine absence.dmesg -T | grep -iE "amdgpu|drm|pcieport"— kernel-level GPU driver / DRM / PCIe AER events that userspace tooling doesn't surface.set-kubeconfigbeforegpu-infoin the main flow.gpu-infouseskubectl execas its in-pod fallback, but on Palette edge hostsKUBECONFIGis only set byset-kubeconfig; without this reorder the kubectl fallback silently no-op'd every run.Test plan
gpu/amd/amdgpu-dmesg.logpopulated with pcieport/pciehp events.gpu/amd/amd-smi-version.txt—AMDSMI Tool: 26.2.2 | AMDSMI Library: 26.2.2 | ROCm: 7.2.1 | amdgpu: 6.16.13 | hsmp: 2.5.gpu/amd/amd-smi-list.txt— enumerates all attached GPUs with BDF / UUID / KFD_ID / NODE_ID.Collecting amd-smi via amd-gpu-operator/pod/default-metrics-exporter-xnsnn (/opt/rocm/bin/amd-smi).bash -npasses.🤖 Generated with Claude Code