Skip to content

Add mcTVM MACA lib64 discovery#35

Open
ghangz wants to merge 2 commits into
MetaX-MACA:devfrom
ghangz:mengz/mctvm-find-maca-lib64
Open

Add mcTVM MACA lib64 discovery#35
ghangz wants to merge 2 commits into
MetaX-MACA:devfrom
ghangz:mengz/mctvm-find-maca-lib64

Conversation

@ghangz

@ghangz ghangz commented Jul 1, 2026

Copy link
Copy Markdown

Summary

  • This change improves FindMACA.cmake library discovery so mcTVM can find MACA lib64 layouts reliably in MetaX compilation containers.
  • The change is limited to MACA build discovery or guarded setup logic and keeps existing default behavior compatible.
  • Main files: cmake/utils/FindMACA.cmake

Validation

  • Verified on Gitee.AI MetaX GPU resources in the mcTVM TileLang/MACA TVM build batch, 6/6 PASS.
  • Branch validation command: CMake configure and mxcc compile smoke validation in the MACA TVM build image.
  • Pull request text is ASCII-only to avoid encoding issues on web forms and API clients.

Review notes

  • Source branch: ghangz:mengz/mctvm-find-maca-lib64
  • Target branch: MetaX-MACA/mcTVM:dev
  • Maintainers can modify this branch if follow-up adjustments are needed.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the MACA library search logic in FindMACA.cmake to look into multiple library paths (lib, lib64, and lib/x86_64-linux-gnu) and adds additional status messages. The review feedback recommends wrapping the library paths and message variable expansions in double quotes to ensure robustness when paths contain spaces.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +48 to +52
set(__maca_library_paths
${__maca_sdk}/lib
${__maca_sdk}/lib64
${__maca_sdk}/lib/x86_64-linux-gnu
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

When defining list variables containing paths, it is important to wrap each path in double quotes. If ${__maca_sdk} contains spaces, the unquoted paths will be split into multiple list elements incorrectly, which can cause find_library to fail.

    set(__maca_library_paths
      "${__maca_sdk}/lib"
      "${__maca_sdk}/lib64"
      "${__maca_sdk}/lib/x86_64-linux-gnu"
    )

Comment thread cmake/utils/FindMACA.cmake Outdated
endif()
endif(__maca_sdk)
if(MACA_FOUND)
message(STATUS "Found MACA SDK=" ${__maca_sdk})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

To prevent issues when ${__maca_sdk} contains spaces (which would cause CMake to split it into multiple arguments and concatenate them without spaces in the output), it is safer and more idiomatic to wrap the variable expansion inside the double-quoted string.

    message(STATUS "Found MACA SDK=${__maca_sdk}")

Comment thread cmake/utils/FindMACA.cmake Outdated
message(STATUS "Found MACA SDK=" ${__maca_sdk})
message(STATUS "Found MACA_INCLUDE_DIRS=" ${MACA_INCLUDE_DIRS})
message(STATUS "Found MACA_MACAMCC_LIBRARY=" ${MACA_MACAMCC_LIBRARY})
message(STATUS "Found MACA_HCA_LIBRARY=" ${MACA_HCA_LIBRARY})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

To prevent issues when ${MACA_HCA_LIBRARY} contains spaces, it is safer and more idiomatic to wrap the variable expansion inside the double-quoted string.

    message(STATUS "Found MACA_HCA_LIBRARY=${MACA_HCA_LIBRARY}")

@ghangz ghangz changed the title Add mcTVM mctvm find MACA lib64 Add mcTVM MACA lib64 discovery Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant