Closed yitingw1 closed 8 months ago
@yitingw1, Looks like actual problem is below error not "CL/cl.h file is missing" which is analyzed above. I have captured below log from CMake output you have pasted above.
CMake Error at /usnfs/yitingw1/workspace/software/pti-gpu/build_utils/CMakeLists.txt:688 (message): Level Zero loader is not found. You may need to install oneAPI Level Zero loader to fix this issue.
CL/cl.h file missing gets resolved during 'make' hence you should ignore it. Make sure your PVC system has oneAPI tools and L0 installed correctly and load oneAPI environment before unitrace build.
Let me know if you still see the issue.
@Sarbojit2019 I'm sure the PVC system has oneAPI tools and L0 installed correctly and load oneAPI environment before unitrace build.
source /opt/intel/oneapi/setvars.sh
:: initializing oneAPI environment ... bash: BASH_VERSION = 5.1.16(1)-release args: Using "$@" for setvars.sh arguments: :: advisor -- latest :: ccl -- latest :: compiler -- latest :: dal -- latest :: debugger -- latest :: dev-utilities -- latest :: dnnl -- latest :: dpcpp-ct -- latest :: dpl -- latest :: ipp -- latest :: ippcp -- latest :: mkl -- latest :: mpi -- latest :: tbb -- latest :: vtune -- latest :: oneAPI environment initialized ::
dpkg -l | grep -i level-zero
ii intel-level-zero-gpu 1.3.27642.40-803~22.04 amd64 Intel(R) Graphics Compute Runtime for oneAPI Level Zero. ii intel-level-zero-gpu-dev 1.3.27642.40-803~22.04 amd64 Intel(R) Graphics Compute Runtime for oneAPI Level Zero ii intel-level-zero-gpu-raytracing 1.0.0~u22.04 amd64 Level Zero Ray Tracing Support library ii level-zero 1.14.0-744~22.04 amd64 Intel(R) Graphics Compute Runtime for oneAPI Level Zero. ii level-zero-dev 1.14.0-744~22.04 amd64 Intel(R) Graphics Compute Runtime for oneAPI Level Zero.
I'm afraid that you may not fully understand my question. I know CL/cl.h file missing gets resolved during 'make'. What I have seen is that the makefile may not deal with it properly.
I looked into the unitrace/CMakeLists.txt and found the error occured in Line109 FindOpenCLHeaders(unitrace_tool). It was in macro(FindOpenCLHeaders TARGET) in build_utils/CMakeLists.txt.
The error occurs in line77 when CHECK_INCLUDE_FILE_CXX(CL/cl.h OpenCL_INCLUDE_DIRS) fails to find CL/cl.h. Then it runs if-statement in line 89. It is supposed to download cl_headers to ${CMAKE_BINARY_DIR} through add_custom_command in line100 but it fails to do that. I have checked ${CMAKE_BINARY_DIR}, there is no OpenCL-Headers Dir.
And even I downloaded OpenCL-Headers Dir and got CL Dir through python get_ocl_headers.py
@yitingw1, In your first response the log shared has Level-zero error but you are referring OpenCL error which is very confusing. Please share the build log (cmake and make) along with command you have used to run them.
Unless I see the error log it is hard to guess why did it fail even after supplying header files which were needed (as you mentioned in your comment).
@Sarbojit2019 Thanks for classifying the difference between successful logs and failed logs. They use different GNU and C/CXX compilers.
After using GNU 11.4.0 and C(CXX) compilers in /usr/bin/cc(c++), unitrace can build successfully. Both CL/cl.h
and Level Zero loader
can be found now.
@yitingw1, Glad to hear that problem is resolved. Can you close the ticket please?
I am trying to build the unitrace tool on PVC. One PVC succeeded while another failed. I followed https://github.com/intel/pti-gpu/tree/master/tools/unitrace. After the terminal runs
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_WITH_MPI=0 ..
, it showsLooking for C++ include CL/cl.h - not found
.More details can be found here:
I have seen 'CMakeError.log' which shows
fatal error: CL/cl.h: No such file or directory
. I have triedsudo apt-get install opencl-headers
which is useless.Then I looked into the unitrace/CMakeLists.txt and found the error occured in Line109 FindOpenCLHeaders(unitrace_tool). It was in
macro(FindOpenCLHeaders TARGET)
in build_utils/CMakeLists.txt. The error occurs in line77 whenCHECK_INCLUDE_FILE_CXX(CL/cl.h OpenCL_INCLUDE_DIRS)
fails to find CL/cl.h. Then it runs if-statement in line 89. It is supposed to downloadcl_headers
to${CMAKE_BINARY_DIR}
throughadd_custom_command
in line100 but it fails to do that. I have checked${CMAKE_BINARY_DIR}
, there is no OpenCL-Headers Dir. And even I downloaded OpenCL-Headers Dir and got CL Dir throughpython get_ocl_headers.py <include_path> <build_path>
,cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_WITH_MPI=0 ..
was still failed with the same error.