lamikr / rocm_sdk_builder

Other
113 stars 8 forks source link

cmake fails for AMDMIGraphX: ROCMTest not found #40

Closed Stefan-Olt closed 3 weeks ago

Stefan-Olt commented 3 weeks ago

I'm building for gfx1031 on Linux Mint (Ubuntu 22.04 LTS) and it now fails with AMDMIGraphX during the cmake configure:

CMake Error at CMakeLists.txt:311 (include):
  include could not find requested file:

    ROCMTest

and at the end

CMake Error at CMakeLists.txt:319 (rocm_enable_test_package):
  Unknown CMake command "rocm_enable_test_package".

I tried copying the ROCMTest.cmake I found in rocm-cmake, but then I get this error:

CMake Error at cmake/ROCMTest.cmake:25 (rocm_define_property):
  Unknown CMake command "rocm_define_property".
Call Stack (most recent call first):
  CMakeLists.txt:311 (include)

Any idea how to solve that?

lamikr commented 3 weeks ago

It does not find the /opt/rocm_sdk_611/share/rocmcmakebuildtools/cmake/ROCMTest.cmake or the execution of that script fails somewhere.

Can you try to add that path to binfo/035_AMDMIGraphX.binfo in CMAKE_PREFIX_PATH line. Something like:

BINFO_APP_CMAKE_CFG="${BINFO_APP_CMAKE_CFG} -DCMAKE_PREFIX_PATH=${INSTALL_DIR_PREFIX_SDK_ROOT}/lib64/cmake;${INSTALL_DIR_PREFIX_SDK_ROOT}/lib/cmake;${INSTALL_DIR_PREFIX_SDK_ROOT}/share/rocmcmakebuildtools/cmake"

If that does not help, you could try to add some breaks to ROCMTest.cmake to check if the script is executed but it just fails somehow. Easy way is to add messages which will stop it's execution.

like

message(FATAL_ERROR "stop location 1") Put that type of messages to different locations with different texts...

Stefan-Olt commented 3 weeks ago

That did not work (still couldn't find ROCMTest), but I figured out how to set the path, using this command: -DCMAKE_MODULE_PATH=${INSTALL_DIR_PREFIX_SDK_ROOT}/share/rocmcmakebuildtools/cmake After that it compiled and linked just fine

lamikr commented 3 weeks ago

Ok, I think the CMAKE_MODULE_PATH definition could then be added to binfo/035_AMDMIGraphX.binfo

And also one line comment above it that mentions that Mint 22.04 and Ubuntu 22.04 needs it. Do you want to send me that as a patch? I can then test some other distros that it does not break anything.

Stefan-Olt commented 3 weeks ago

Yes, that's were I put it. I will prepare a patch tomorrow

lamikr commented 3 weeks ago

This is now fixed.