-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Issue]: build fails to non-existing llvm path #85
Comments
Hi @jdgh000 I think there should be a /opt/rocm/llvm/lib/cmake/llvm and find_package normally returns that as LLVM_DIR. |
i am not understanding your evaluation at all and makes no sense at all!?. I already mentioned where it is having error in my original description. Regardless, llvm-devel installed with no expectation it will solve and after installation, you were wrong, and I was right, it made no difference. |
Hi @jdgh000, LLVM_DIR is a cache variable set by cmake find_package call here: In the find_package call, the PATHS is set to ${ROCM_PATH}/llvm. That means it is expected that the config file is found under /opt/rocm. In that case LLVM_DIR would be set to /opt/rocm/llvm/lib64/cmake/llvm and HIP_LLVM_ROOT, (the argument passed to the script hip_embed_pch.sh) points to /opt/rocm/llvm which would make sense. A note that the above LLVM_DIR cmake variable is not to be confused with the 4th parameter LLVM_DIR that is used in hip_embed_pch.sh and that is actually the HIP_LLVM_ROOT. In your case find_package(LLVM) instead of returning the llvm configuration under /opt/rocm it returns one found in /usr After installing rocm-llvm-dev can you please confirm that /opt/rocm/llvm/lib/cmake/llvm or (/opt/rocm/llvm/lib64/cmake/llvm) exists on your machine. If it exists please try again with a clean cmake build (LLVM_DIR is a cache variable) PS. I think the find_package call here https://github.com/ROCm/clr/blob/develop/hipamd/src/CMakeLists.txt#L182 |
I actually step back to build instruction for clr using published instruction steps instead of trying to build from hipamd directory. But I see exactly same error occurs in cmake stage. Linux cmake .. -DCLR_BUILD_HIP=ON -DHIP_COMMON_DIR=/home/nonroot/git/HIP |
do we have update here? |
Hi @jdgh000 can you modify your cmake command to this and confirm if it works: In that case I will follow-up with a fix as setting the CMAKE_PREFIX_PATH should not be required, as per the published instructions. |
this appears working however this time, getting another error about max vs. fmax in header: -- Found OpenGL: /usr/lib64/libOpenGL.so -- Found Git: /usr/bin/git (found version "2.43.0")
|
I think that the cause for the max vs. fmax error is this:
Please double check that the path to the VERSION file exists and the permissions are correct. |
the file is there, it is unclear how it is resulting, i checkoud HIP as is, no modification done whatsoever but it can not process it: [root@localhost build]# cat ../hipamd/CMakeLists.txt | grep -n VERSION | grep ^87: |
are you checking on your end? I am just wondering/surprised why kept thinking this is my environment and check this. This is clearly the issue with your end. |
If the file is checkout as it is from the repo, with no modifications, it should work. I can't reproduce the issue on my end. cmake --version |
I have hard time relating what you are saying. I already provided logs and version and you still arguing against facts that it should work. What do you mean by that?
|
Hi @jdgh000,
cmake generates a file hip_version.h under the clr build directory that adds definitions based on the information read from the VERSION file. For example:
hip_version.h is then used by clang to setup the right include files for the hip version you are trying to build, among other places this file is being used. I am using Ubuntu 22.04.3, rocm 6.0, cmake version 3.22.1
Following the steps above, I do not get the file VERSION cannot be read error and the configuration plus build runs successfully. |
i installed rocm6.0 on ubntu 22.04 but it says missing file make.in but it is there:
|
Also seeing VERSION read fail randomly, the file is there but why it is not reading? what should be the permission?
|
Hi @jdgh000, sorry for the lack of responses; are you still experiencing the same issue? Based on your log, something seems to be quite off.
This line seem to suggest that the HIP common directory is /home/nonroot/git/codelab-scripts/build-install-scripts/rocm/ROCm-6.0/clr/HIP. However, based on your command, looks like it is set to
I suspect it might have something to do with CMake caching issue. I would suggest try cleaning the build directory with Hope this helps! Thanks! |
let me look at it and come back! it has been a while. |
Problem Description
Tried building hipamd in clr but failing because LLVM_DIR is apparently wrongly set or not set:
From clr/hipamd
mkdir build
cd build
cmake ..
./..'
/home/nonroot/build-install-scripts/rocm/ROCm-6.1/clr/hipamd/src/hip_embed_pch.sh: line 148: /usr/lib64/cmake/llvm/../../../bin/clang: No such file or directory
in that script file called hip_embed_pch.sh, the path is set in $LLVM_DIR/bin/clang which itself seems to be called from main CMakeLists.txt.
hip_embed_pch.sh USAGE:
echo "Usage: $(basename "$0") HIP_BUILD_INC_DIR HIP_INC_DIR HIP_AMD_INC_DIR LLVM_DIR [option] [RTC_LIB_OUTPUT]"
This is called from cmake as:
183: execute_process(COMMAND sh -c "${CMAKE_CURRENT_SOURCE_DIR}/hip_embed_pch.sh
${HIP_COMMON_INCLUDE_DIR}
${PROJECT_BINARY_DIR}/include
${PROJECT_SOURCE_DIR}/include
${HIP_LLVM_ROOT}"
COMMAND_ECHO STDERR RESULT_VARIABLE EMBED_PCH_RC WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
set(HIP_LLVM_ROOT "${LLVM_DIR}/../../..")
HIP_LLVM_ROOT is defined here in same cmake:
179: if(NOT DEFINED HIP_LLVM_ROOT)
180: set(HIP_LLVM_ROOT "${LLVM_DIR}/../../..")
but it is unclear what LLVM_DIR should be, by default path of rocm installation, it seems LLVM_DIR=/opt/rocm-6.1.0/llvm which I could pass on to cmake as env param but going back three folders up will land in / which is not going to work.
OS:
NAME="CentOS Stream"
VERSION="9"
CPU:
model name : Intel(R) Xeon(R) Gold 6132 CPU @ 2.60GHz
GPU:
Name: Intel(R) Xeon(R) Gold 6132 CPU @ 2.60GHz
Marketing Name: Intel(R) Xeon(R) Gold 6132 CPU @ 2.60GHz
Name: Intel(R) Xeon(R) Gold 6132 CPU @ 2.60GHz
Marketing Name: Intel(R) Xeon(R) Gold 6132 CPU @ 2.60GHz
Name: gfx908
Marketing Name: AMD Instinct MI100
Name: amdgcn-amd-amdhsa--gfx908:sramecc+:xnack-
Name: gfx908
Marketing Name: AMD Instinct MI100
Name: amdgcn-amd-amdhsa--gfx908:sramecc+:xnack-
Operating System
Centos 9
CPU
Intel(R) Xeon(R) Gold 6132 CPU @ 2.60GHz
GPU
AMD Instinct MI100
ROCm Version
ROCm 6.1.0
ROCm Component
clr
Steps to Reproduce
from clr/hipamd/ ; mkdir build ; cd build
(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: