Open mattmcadoo opened 2 months ago
Hi @mattmcadoo
It looks like you're getting this error when building Comgr from source? Can you share the branch you're using to build, and the CMake command you're using?
If your Comgr and LLVM sources are from the same branch, they should both support gfx1152. (Example https://github.com/ROCm/llvm-project/blob/77cf9ad00e298ed06e06aec0f81009510f545714/llvm/include/llvm/BinaryFormat/ELF.h#L792)
Thanks!
I'm using the 6.2.1 tarball that's posted 5 days ago.
This is the CMake command and some additional output:
cmake -C /var/tmp/portage/dev-libs/rocm-comgr-6.2.1/work/llvm-project-rocm-6.2.1/amd/comgr_build/gentoo_common_config.cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr -DLLVM_DIR=/usr/lib/llvm/18 -DCMAKE_STRIP= -DBUILD_TESTING=OFF -DCOMGR_BUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=/var/tmp/portage/dev-libs/rocm-comgr-6.2.1/work/llvm-project-rocm-6.2.1/amd/comgr_build/gentoo_toolchain.cmake /var/tmp/portage/dev-libs/rocm-comgr-6.2.1/work/llvm-project-rocm-6.2.1/amd/comgr
loading initial cache file /var/tmp/portage/dev-libs/rocm-comgr-6.2.1/work/llvm-project-rocm-6.2.1/amd/comgr_build/gentoo_common_config.cmake
Comgr Version: 2.8.0
-- The C compiler identification is GNU 14.2.1
-- The CXX compiler identification is GNU 14.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/x86_64-pc-linux-gnu-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/x86_64-pc-linux-gnu-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test HAVE_FFI_CALL
-- Performing Test HAVE_FFI_CALL - Success
-- Found FFI: /usr/lib64/libffi.so
-- Performing Test Terminfo_LINKABLE
-- Performing Test Terminfo_LINKABLE - Success
-- Found Terminfo: /usr/lib64/libtinfo.so
-- Found ZLIB: /usr/lib64/libz.so (found version "1.3.1")
-- Found zstd: /usr/lib64/libzstd.so
-- Found LibXml2: /usr/lib64/libxml2.so (found version "2.12.8")
------------LLVM_DIR: /usr/lib/llvm/18/lib64/cmake/llvm
---LLVM_INCLUDE_DIRS: /usr/lib/llvm/18/include
---LLVM_LIBRARY_DIRS: /usr/lib/llvm/18/lib64
-----------Clang_DIR: /usr/lib/llvm/18/lib64/cmake/clang
--CLANG_INCLUDE_DIRS: /usr/lib/llvm/18/include
----LLD_INCLUDE_DIRS: /usr/lib/llvm/18/include
---AMDDeviceLibs_DIR: /usr/lib64/cmake/AMDDeviceLibs
------------ROCM_DIR: /usr/share/rocm/cmake
----COMGR_GIT_COMMIT: not-available
----COMGR_GIT_BRANCH: not-available
-- <<< Gentoo configuration >>>
Build type Release
Install path /usr
Compiler flags:
C -march=native -O2 -pipe
C++ -march=native -O2 -pipe
Linker flags:
Executable -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs
Module -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs
Shared -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs
I'm getting the same error with 6.2.2 release tarball.
-DLLVM_DIR=/usr/lib/llvm/18
Is this the 6.2.1/6.2.2 ROCm LLVM? Or a system LLVM? I'm not familiar with the Gentoo CMake config, but Comgr does need to build against a compatible version of the AMD LLVM fork
System LLVM. There was a patch by the Gentoo devs that worked with version 6.1.2, but it fails to be applied to 6.2.x of ROCm. https://github.com/gentoo/gentoo/blob/master/dev-libs/rocm-comgr/files/rocm-comgr-6.1.0-llvm-18-compat.patch They don't include a build for the AMD LLVM fork because of cohabitation problems with the upstream LLVM on the same system, as noted on this older bug report with Gentoo: https://bugs.gentoo.org/851702
Do you have the hash/version number of your system LLVM? You may need to port this patch to it:
Problem Description
FAILED: CMakeFiles/amd_comgr.dir/src/comgr-metadata.cpp.o /usr/bin/x86_64-pc-linux-gnu-g++ -DAMD_COMGR_BUILD -DAMD_COMGR_EXPORT -D_GNU_SOURCE -D_GNU_SOURCE -DSTDC_CONSTANT_MACROS -DSTDC_FORMAT_MACROS -DSTDC_LIMIT_MACROS -DSTDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I/usr/lib/llvm/18/include -I/var/tmp/portage/dev-libs/rocm-comgr-6.2.1/work/llvm-project-rocm-6.2.1/amd/comgr/src -I/var/tmp/portage/dev-libs/rocm-comgr-6.2.1/work/llvm-project-rocm-6.2.1/amd/comgr_build/include -march=native -O2 -pipe -std=c++17 -fPIC -DAMD_COMGR_GIT_COMMIT=not-available -DAMD_COMGR_GIT_BRANCH=not-available -fno-rtti -Wall -Wno-attributes -fms-extensions -fvisibility=hidden -fno-strict-aliasing -MD -MT CMakeFiles/amd_comgr.dir/src/comgr-metadata.cpp.o -MF CMakeFiles/amd_comgr.dir/src/comgr-metadata.cpp.o.d -o CMakeFiles/amd_comgr.dir/src/comgr-metadata.cpp.o -c /var/tmp/portage/dev-libs/rocm-comgr-6.2.1/work/llvm-project-rocm-6.2.1/amd/comgr/src/comgr-metadata.cpp /var/tmp/portage/dev-libs/rocm-comgr-6.2.1/work/llvm-project-rocm-6.2.1/amd/comgr/src/comgr-isa-metadata.def:92:60: error: ‘EF_AMDGPU_MACH_AMDGCN_GFX1152’ is not a member of ‘llvm::ELF’; did you mean ‘EF_AMDGPU_MACH_AMDGCN_GFX1151’? 92 | HANDLE_ISA("amdgcn-amd-amdhsa-", "gfx1152", false, false, EF_AMDGPU_MACH_AMDGCN_GFX1152, true, 65536, 32, 4, 40, 1024, 106, 800, 106, 16, 1024, 256) | ^
~~~~~~~~ /var/tmp/portage/dev-libs/rocm-comgr-6.2.1/work/llvm-project-rocm-6.2.1/amd/comgr/src/comgr-metadata.cpp:381:9: note: in definition of macro ‘HANDLE_ISA’ 381 | ELF::ELF_MACHINE, \ | ^~~Operating System
Gentoo
CPU
AMD Ryzen Threadripper PRO 3955WX
GPU
AMD Radeon Pro W6800
ROCm Version
ROCm 6.2.0
ROCm Component
llvm-project
Steps to Reproduce
Compile error:
(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support
Additional Information
CPU: AMD Ryzen Threadripper PRO 3955WX s (32) @ 4.403GHz GPU: AMD ATI Radeon Pro W5500