Skip to content

Adjusted priority of python lib in cli import - #3082

Merged
JeniferC99 merged 1 commit into
developfrom
amdsmi_adjust_pythonlib_priortiy
Feb 18, 2026
Merged

JeniferC99 merged 1 commit into
developfrom
amdsmi_adjust_pythonlib_priortiy

Conversation

@marifamd

@marifamd marifamd commented Feb 4, 2026 •

Copy link
Copy Markdown
Contributor

Default to local ROCm pathways for multi-ROCm installations

  • Changed priority order: local ROCm path indexing now takes precedence over Python library path
  • Previously, Python lib path was checked first, with local ROCm as fallback
  • Fixes issue where users in multi-ROCm setups wouldn't get the Python lib installed since they were using update-alternatives
  • Local pathway indexing was already the fallback for multi-ROCm amd-smi CLI users; now it's the default for all amd-smi CLI users

Copilot AI 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.

Pull request overview

This PR adjusts the Python import path priority for the AMD SMI CLI to better support multi-ROCm installations. The change ensures that the local ROCm path is checked first when importing the amdsmi Python library, rather than defaulting to system-wide installed packages.

Changes:

  • Modified sys.path.append() to sys.path.insert(0, ...) to prioritize local ROCm path over system-wide Python packages

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
@dmitrii-galantsev
dmitrii-galantsev force-pushed the amdsmi_adjust_pythonlib_priortiy branch from 544c60b to 1b42c75 Compare February 5, 2026 23:37
@JeniferC99
JeniferC99 merged commit 749bb2c into develop Feb 18, 2026
31 of 34 checks passed
@JeniferC99
JeniferC99 deleted the amdsmi_adjust_pythonlib_priortiy branch February 18, 2026 21:55
amd-josnarlo pushed a commit that referenced this pull request Feb 23, 2026
Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
marifamd added a commit that referenced this pull request Jul 23, 2026
- the packaging rework made the CLI import site-packages first and only
  fall back to share/amd_smi, reversing the priority from #3082
- on a multi-version ROCm host the CLI must load the amdsmi library it
  shipped with, not another version's copy earlier on sys.path
- resolve share/amd_smi (ROCM_PATH or CLI-relative) before importing, and
  fall back to site-packages only when no share copy exists

Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
marifamd added a commit that referenced this pull request Jul 24, 2026
- the packaging rework made the CLI import site-packages first and only
  fall back to share/amd_smi, reversing the priority from #3082
- on a multi-version ROCm host the CLI must load the amdsmi library it
  shipped with, not another version's copy earlier on sys.path
- resolve share/amd_smi (ROCM_PATH or CLI-relative) before importing, and
  fall back to site-packages only when no share copy exists

Signed-off-by: Maisam Arif <Maisam.Arif@amd.com>
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.

5 participants