[AMD-SMI] AI-NIC Cleanup - #3983
Closed
gabrpham wants to merge 2 commits into
Closed
Conversation
#3403) * Quick fix for the code that populates all AI NIC devices * When no NIC found resturn success --------- Co-authored-by: Sajina Kandy <sputhala@amd.com>
…ode (#3654) Critical bug fixes: - Fix sizeof operator precedence: sizeof(info.field-1) -> sizeof(info.field)-1 in snprintf calls in amd_smi_no_drm_nic.cc - Reset has_valid_hw_mon to false at start of each loop iteration in init() - Fix amdsmi_get_nic_gpu_topo_info: check 'r' instead of 'status' after get_nic_device_from_handle - Return AMDSMI_STATUS_NO_DATA on NUMA=65535 instead of SUCCESS - CLI list(): pass 'nics' to list_brcm_nic instead of 'ainics' - CLI topology_nic(): fix gpucount = len(args.gpu) instead of len(args.switch) - CLI monitor(): call metric_nic/metric_switch instead of non-existent monitor_nic/monitor_switch Error handling: - Return AMDSMI_STATUS_API_FAILED from catch blocks instead of falling through to AMDSMI_STATUS_SUCCESS - Replace std::cerr/printf with LOG_ERROR macro in catch blocks - Check init() return value in populate_brcm_nic/switch_devices() - Replace NULL with nullptr in NIC/switch API functions - Remove duplicate nullptr checks in topology functions Code cleanup: - Rename camelCase variables to snake_case across NIC/switch code - Add trailing underscore to private members in amd_smi_system.h - Fix keyword spacing (if( -> if () and brace placement (~33 instances) - Fix #endif comment formatting - Remove dead code and unused variables in Python modules - Fix docstrings, comments, typos, and log message grammar - Fix Python naming conventions (PEP 8 class names, no builtin shadowing) Build fixes (amdsmi_unified): - Move linker hardening flags from CMAKE_CXX_FLAGS to linker flag variables to fix -Wunused-command-line-argument errors with clang-based compilers - Add type() getter to SmiInfiniBand to fix -Wunused-private-field error Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
adam360x
approved these changes
Mar 12, 2026
marbre
requested changes
Mar 17, 2026
marbre
left a comment
Member
There was a problem hiding this comment.
This will need approval from above and dev ops will perform the merge! PR-title is ambiguous and PR description should rather clearly state which commits get cherry-picked from develop.
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
AINIC feature code needed for 7.12 release. Cherry-pick to 7.12 release.
Technical Details
Includes:
#3654
#3403
JIRA ID
SWDEV-544298
Test Plan
Test Result
Submission Checklist