Closed ianferreira closed 3 years ago
CXX said it cannot find hsa_signal_wait_scacquire, the declaration of hsa_signal_wait_scacquire is in the /opt/rocm/include/hsa/hsa.h provided by ROCR-Runtime. Please check if there is old version - e.g. ROCm-4.1 installed on system.
UPDATE:
checked ROCm-4.1, also had this function https://github.com/RadeonOpenCompute/ROCR-Runtime/blob/rocm-4.1.x/src/inc/hsa.h#L1994 .
Please check the /opt/rocm/include/hsa/hsa.h to find out if there is hsa_signal_wait_scacquire
or not. I suspect that this is other version of hsa.h.
I will try to put ROCm directory into rocm-build to try to reproduce this issue.
UPDATE: cannot reproduce on my environment. I created a clean ubuntu:20.04 docker and test.
~/rocm-build/build/rocclr ~/rocm-build/build/rocclr
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Code Object Manager found at /opt/rocm/lib/cmake/amd_comgr.
-- HSA Runtime found at /opt/rocm/lib/cmake/hsa-runtime64.
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
-- Found: /usr/lib/x86_64-linux-gnu/libnuma.so
-- Configuring done
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:
CPACK_GENERATOR
CPACK_PACKAGING_INSTALL_PREFIX
-- Build files have been written to: /home/work/rocm-build/build/rocclr
[39/47] Building CXX object CMakeFiles/amdrocclr_static.dir/device/device.cpp.o
/home/work/rocm-build/ROCm/ROCclr/device/device.cpp: In constructor 'amd::Device::Device()':
/home/work/rocm-build/ROCm/ROCclr/device/device.cpp:445:37: warning: 'void* memset(void*, int, size_t)' clearing an object of type 'struct device::Info' with no trivial copy-assignment; use assignment or value-initialization instead [-Wclass-memaccess]
445 | memset(&info_, '\0', sizeof(info_));
| ^
In file included from /home/work/rocm-build/ROCm/ROCclr/device/device.cpp:21:
/home/work/rocm-build/ROCm/ROCclr/device/device.hpp:222:8: note: 'struct device::Info' declared here
222 | struct Info : public amd::EmbeddedObject {
| ^~~~
[47/47] Linking CXX static library libamdrocclr_static.a
try again.
work@b8997d182ce7:~/rocm-build$ bash 18.rocclr.sh
Reading package lists... Done
Building dependency tree
Reading state information... Done
mesa-common-dev is already the newest version (20.2.6-0ubuntu0.20.04.1).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
~/rocm-build/build/rocclr ~/rocm-build/build/rocclr
-- Code Object Manager found at /opt/rocm/lib/cmake/amd_comgr.
-- HSA Runtime found at /opt/rocm/lib/cmake/hsa-runtime64.
-- Found: /usr/lib/x86_64-linux-gnu/libnuma.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/work/rocm-build/build/rocclr
ninja: no work to do.
We can modify ninja
to ninja -v
, it will print compiler command to stdout.
e.g.
/usr/bin/c++ -DATI_ARCH_X86 -DATI_BITS_64 -DATI_OS_LINUX -DCL_TARGET_OPENCL_VERSION=220 -DCL_USE_DEPRECATED_OPENCL_1_0_APIS -DCL_USE_DEPRECATED_OPENCL_1_1_APIS -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_USE_DEPRECATED_OPENCL_2_0_APIS -DCOMGR_DYN_DLL -DLITTLEENDIAN_CPU -DOPENCL_C_MAJOR=2 -DOPENCL_C_MINOR=0 -DOPENCL_EXPORTS -DOPENCL_MAJOR=2 -DOPENCL_MINOR=1 -DROCCLR_SUPPORT_NUMA_POLICY -DUSE_COMGR_LIBRARY -DVEGA10_ONLY=false -DWITH_LIGHTNING_COMPILER -DWITH_TARGET_AMDGCN -D__x86_64__ -I/home/work/rocm-build/ROCm/ROCclr -I/home/work/rocm-build/ROCm/ROCclr/include -I/home/work/rocm-build/ROCm/ROCm-OpenCL-Runtime/khronos/headers -I/home/work/rocm-build/ROCm/ROCm-OpenCL-Runtime/khronos/headers/opencl2.2 -I/opt/rocm/include -I/home/work/rocm-build/ROCm/ROCm-OpenCL-Runtime -I/home/work/rocm-build/ROCm/ROCclr/compiler/lib -I/home/work/rocm-build/ROCm/ROCclr/compiler/lib/include -I/home/work/rocm-build/ROCm/ROCclr/compiler/lib/backends/common -I/home/work/rocm-build/ROCm/ROCclr/elf -Idevice/rocm -I/opt/rocm/include/hsa -fPIC -Wall -Wno-strict-aliasing -Wno-unused-variable -std=c++11 -MD -MT device/rocm/CMakeFiles/oclrocm.dir/rocsignal.cpp.o -MF device/rocm/CMakeFiles/oclrocm.dir/rocsignal.cpp.o.d -o device/rocm/CMakeFiles/oclrocm.dir/rocsignal.cpp.o -c /home/work/rocm-build/ROCm/ROCclr/device/rocm/rocsignal.cpp
The rocsignal.cpp
includes rocsignal.hpp
, rocsignal.hpp
includes hsa.h
.
There is -I/opt/rocm/include/hsa
, so compiler can find hsa.h
.
But, why reports cannot find hsa_signal_wait_scacquire
, if it cannot find hsa.h, it should be cannot find hsa.h
.
So I am afraid there is other version of hsa.h in your environment.
I think making sure user purge any prior releases would be good tip
Environment
What is the expected behavior
Successfully build
Scripts 11-17 work well, breaks on 18.
What actually happens
bash 18.rocclr.sh
How to reproduce
bash 18.rocclr.sh