Skip to content

[AMD-SMI] AI-NIC Cleanup - #3983

Closed
gabrpham wants to merge 2 commits into
release/therock-7.12from
users/gabrpham/AINIC_cherry-pick
Closed

[AMD-SMI] AI-NIC Cleanup#3983
gabrpham wants to merge 2 commits into
release/therock-7.12from
users/gabrpham/AINIC_cherry-pick

Conversation

@gabrpham

Copy link
Copy Markdown
Contributor

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

ajanicijamd and others added 2 commits March 12, 2026 00:15
#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>

@marbre marbre left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@marifamd marifamd changed the title Users/gabrpham/ainic cherry pick [AMD-SMI] AI-NIC Cleanup Mar 23, 2026
@gabrpham gabrpham closed this Apr 2, 2026
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