fix(context): resolve amd-smi path in get_gpu_renderD_nodes (ROCM-27727)#156
Merged
Conversation
amd-smi was invoked as a bare command, relying on PATH, while every other call site in this file resolves it via self._rocm_path. On hosts where /opt/rocm*/bin is not on PATH, this caused GPU detection to fail with exit code 127 (ROCM-27727). Co-authored-by: Cursor <cursoragent@cursor.com>
coketaste
requested review from
Cemberk,
Rohan138,
gargrahul and
leconcio
as code owners
July 14, 2026 20:53
There was a problem hiding this comment.
Pull request overview
This PR fixes AMD GPU render node detection on hosts where ROCm binaries are not on PATH by invoking amd-smi via the resolved ROCm installation root (self._rocm_path), aligning get_gpu_renderD_nodes() with other ROCm tool call sites in context.py.
Changes:
- Resolve
amd-smito${ROCM_PATH}/bin/amd-smibefore callingamd-smi list -e --json. - Keep the existing stderr-handling fallback behavior while avoiding reliance on
PATH.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2 tasks
coketaste
added a commit
that referenced
this pull request
Jul 16, 2026
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
get_gpu_renderD_nodes()invokedamd-smias a bare command, relying on it being onPATH. On hosts where/opt/rocm*/binis not onPATH(e.g. CentOS 9 / MI350 CI runners), the subprocess failed with exit code 127 ("command not found"), causing GPU detection—and the run phase—to abort.amd-smi/rocminfocall site incontext.pyalready resolves the binary viaself._rocm_path(e.g. vendor detection at line ~421,rocminfoat line ~552). This fix brings the modernamd-smi list -e --jsoncall in line with that pattern by resolvingos.path.join(self._rocm_path, "bin", "amd-smi")before invoking it.phantom_disagg_llama70b_mi350andphantom_disagg_proxy_moe_mi350failing with: