[SWDEV-545128] Implement some changes in AMD-SMI to aggregate metric from primary and secondary KFD processes#2554
Merged
JeniferC99 merged 4 commits intodevelopfrom Feb 18, 2026
Conversation
adam360x
requested changes
Jan 15, 2026
bc74e16 to
6acf4a1
Compare
adam360x
approved these changes
Jan 21, 2026
Contributor
Author
|
/AzurePipelines run rocm-ci-caller |
|
Azure Pipelines successfully started running 1 pipeline(s). |
6acf4a1 to
2bafe43
Compare
Contributor
Author
|
/AzurePipelines run rocm-ci-caller |
|
Azure Pipelines successfully started running 1 pipeline(s). |
adam360x
approved these changes
Jan 22, 2026
2bafe43 to
15882e2
Compare
… from primary and secondary KFD processes
15882e2 to
00d5d1f
Compare
oliveiradan
reviewed
Jan 27, 2026
oliveiradan
reviewed
Jan 27, 2026
oliveiradan
reviewed
Jan 27, 2026
oliveiradan
reviewed
Jan 27, 2026
oliveiradan
reviewed
Jan 27, 2026
oliveiradan
reviewed
Jan 27, 2026
oliveiradan
reviewed
Jan 27, 2026
oliveiradan
reviewed
Jan 27, 2026
oliveiradan
reviewed
Jan 27, 2026
oliveiradan
reviewed
Jan 27, 2026
oliveiradan
reviewed
Jan 27, 2026
oliveiradan
reviewed
Jan 27, 2026
oliveiradan
requested changes
Jan 28, 2026
Contributor
oliveiradan
left a comment
There was a problem hiding this comment.
@koushikbillakanti-amd, please take a look at my comments and let me know if you have any questions.
oliveiradan
reviewed
Jan 30, 2026
oliveiradan
reviewed
Jan 31, 2026
oliveiradan
reviewed
Jan 31, 2026
oliveiradan
reviewed
Jan 31, 2026
oliveiradan
reviewed
Jan 31, 2026
oliveiradan
reviewed
Jan 31, 2026
oliveiradan
requested changes
Jan 31, 2026
Contributor
oliveiradan
left a comment
There was a problem hiding this comment.
@koushikbillakanti-amd, some notes are in.
oliveiradan
approved these changes
Feb 9, 2026
amd-josnarlo
pushed a commit
that referenced
this pull request
Feb 23, 2026
…from primary and secondary KFD processes (#2554) * [SWDEV-545128] Implement some changes in AMD-SMI to aggregate metrics from primary and secondary KFD processes * Update rocm_smi_kfd.cc * Resolving Daniel's review comments * Latest updates on daniel's comments --------- Co-authored-by: Koushik Billakanti <kbillaka@amd.com>
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.
Motivation
This PR adds support for parsing per-GPU KFD process files that use the _NNNN suffix naming convention (e.g., vram_46775, stats_46775/).
The ROCm kernel driver exposes per-GPU process statistics in /sys/class/kfd/kfd/proc/PID/ with GPU-specific file suffixes.
Without this change, AMD-SMI cannot read process memory usage and statistics on systems using this KFD file structure.
Technical Details
Modified src/rocm_smi_kfd.cc and rocm_smi_kfd.cc to parse files with _NNNN GPU ID suffixes.
Added logic to read cu_occupancy and evicted_ms from stats_NNNN/ subdirectories under each process.
The implementation maintains backward compatibility with older KFD structures while supporting the new per-GPU naming convention.
JIRA ID
Resolves [SWDEV-545128]
Test Plan
Built AMD-SMI from source and ran amd-smi process command with active GPU workloads.
Verified KFD directory structure parsing by inspecting /sys/class/kfd/kfd/proc/PID/ contents.
Tested both text and JSON output formats to confirm correct data retrieval.
Test Result
Process detection working correctly - PID, process name, and memory usage displayed.
Per-GPU stats (cu_occupancy=0, evicted_ms=0) read successfully from stats_46775/ directory.
All tests passed on MI300A GPU with KFD_ID 46775.
Submission Checklist