Closed jDietschi closed 1 year ago
collect2: fatal error: ld terminated with signal 9 [Killed]
The linker command seems to have been killed externally. Did you maybe run out of memory?
I don't think so I just ran another attempt without the kernel downgrade and got the same Error And is this really compatible for Raspberry Pi 3A+?
VC4CLStdLib and VC4CL build without any erros.
VC4C CMakeError.log
Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /home/admin/opencl/VC4C/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake cmTC_33e6d/fast && /usr/bin/gmake -f CMakeFiles/cmTC_33e6d.dir/build.make CMakeFiles/cmTC_33e6d.dir/build
gmake[1]: Entering directory '/home/admin/opencl/VC4C/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_33e6d.dir/src.c.o
/usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -o CMakeFiles/cmTC_33e6d.dir/src.c.o -c /home/admin/opencl/VC4C/build/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_33e6d
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_33e6d.dir/link.txt --verbose=1
/usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -rdynamic CMakeFiles/cmTC_33e6d.dir/src.c.o -o cmTC_33e6d
/usr/bin/ld: CMakeFiles/cmTC_33e6d.dir/src.c.o: in function `main':
src.c:(.text+0x40): undefined reference to `pthread_create'
/usr/bin/ld: src.c:(.text+0x4c): undefined reference to `pthread_detach'
/usr/bin/ld: src.c:(.text+0x58): undefined reference to `pthread_cancel'
/usr/bin/ld: src.c:(.text+0x68): undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_33e6d.dir/build.make:106: cmTC_33e6d] Error 1
gmake[1]: Leaving directory '/home/admin/opencl/VC4C/build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:140: cmTC_33e6d/fast] Error 2
my swapfile is 4Gigabyte
admin@raspi01:~/opencl/VC4C/build/CMakeFiles $ free -h
total used free shared buff/cache available
Mem: 426Mi 37Mi 148Mi 0.0Ki 240Mi 337Mi
Swap: 4.0Gi 18Mi 4.0Gi
What else could I do to avoid running out of memory?
I just ran the whole procedure again, this is my console output:
admin@raspi01:~ $ ls -l
total 4
drwxr-xr-x 5 admin admin 4096 Jun 19 06:21 opencl
admin@raspi01:~ $ cd opencl/
admin@raspi01:~/opencl $ cd VC4CLStdLib/
admin@raspi01:~/opencl/VC4CLStdLib $ cd build/
admin@raspi01:~/opencl/VC4CLStdLib/build $ cmake ..
-- build deb package...
-- Configuring done
-- Generating done
-- Build files have been written to: /home/admin/opencl/VC4CLStdLib/build
admin@raspi01:~/opencl/VC4CLStdLib/build $ make
[100%] Built target VC4CLStdLib
admin@raspi01:~/opencl/VC4CLStdLib/build $ sudo install make
install: missing destination file operand after 'make'
Try 'install --help' for more information.
admin@raspi01:~/opencl/VC4CLStdLib/build $ sudo make install
[100%] Built target VC4CLStdLib
Install the project...
-- Install configuration: ""
-- Up-to-date: /usr/local/include/vc4cl-stdlib
-- Up-to-date: /usr/local/include/vc4cl-stdlib/_geometric.h
-- Up-to-date: /usr/local/include/vc4cl-stdlib/_intrinsics.h
-- Up-to-date: /usr/local/include/vc4cl-stdlib/_synchronization.h
-- Up-to-date: /usr/local/include/vc4cl-stdlib/_float_float.h
-- Up-to-date: /usr/local/include/vc4cl-stdlib/_conversions.h
-- Up-to-date: /usr/local/include/vc4cl-stdlib/_clcxx_mangling.h
-- Up-to-date: /usr/local/include/vc4cl-stdlib/_common.h
-- Up-to-date: /usr/local/include/vc4cl-stdlib/_work_items.h
-- Up-to-date: /usr/local/include/vc4cl-stdlib/VC4CLStdLib.h
-- Up-to-date: /usr/local/include/vc4cl-stdlib/defines.h
-- Up-to-date: /usr/local/include/vc4cl-stdlib/_async.h
-- Up-to-date: /usr/local/include/vc4cl-stdlib/opencl-c.h
-- Up-to-date: /usr/local/include/vc4cl-stdlib/_config.h
-- Up-to-date: /usr/local/include/vc4cl-stdlib/_extensions.h
-- Up-to-date: /usr/local/include/vc4cl-stdlib/_printf.h
-- Up-to-date: /usr/local/include/vc4cl-stdlib/_spir_mangling.h
-- Up-to-date: /usr/local/include/vc4cl-stdlib/_atomics.h
-- Up-to-date: /usr/local/include/vc4cl-stdlib/_vector.h
-- Up-to-date: /usr/local/include/vc4cl-stdlib/_images.h
-- Up-to-date: /usr/local/include/vc4cl-stdlib/_math.h
-- Up-to-date: /usr/local/include/vc4cl-stdlib/_integer.h
-- Up-to-date: /usr/local/include/vc4cl-stdlib/_relational.h
-- Up-to-date: /usr/local/include/vc4cl-stdlib/_overloads.h
admin@raspi01:~/opencl/VC4CLStdLib/build $ sudo ldconfig
admin@raspi01:~/opencl/VC4CLStdLib/build $ cd ..
admin@raspi01:~/opencl/VC4CLStdLib $ cd ..
admin@raspi01:~/opencl $ cd VC4C
admin@raspi01:~/opencl/VC4C $ cd build/
admin@raspi01:~/opencl/VC4C/build $ cmake ..
CMake Deprecation Warning at CMakeLists.txt:4 (cmake_policy):
The OLD behavior for policy CMP0026 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
-- VC4CL standard library headers found: /home/admin/opencl/VC4C/../VC4CLStdLib/include/
-- Using CMake 3.14+ FetchContent to include dependencies...
-- CLang compiler found: /usr/bin/clang
-- LLVM-dis found: /usr/bin/llvm-dis-6.0
-- LLVM-as found: /usr/bin/llvm-as-6.0
-- LLVM-link found: /usr/bin/llvm-link-6.0
-- Compiling LLVM library front-end with LLVM in version 11.0.1 located in '/usr/lib/llvm-11/lib'
-- found clang-format: /usr/bin/clang-format
-- Configuring done
-- Generating done
-- Build files have been written to: /home/admin/opencl/VC4C/build
admin@raspi01:~/opencl/VC4C/build $ make
[ 1%] Performing update step for 'cpplog-project'
hint: Pulling without specifying how to reconcile divergent branches is
hint: discouraged. You can squelch this message by running one of the following
hint: commands sometime before your next pull:
hint:
hint: git config pull.rebase false # merge (the default strategy)
hint: git config pull.rebase true # rebase
hint: git config pull.ff only # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
From https://github.com/doe300/cpplog
* branch HEAD -> FETCH_HEAD
Already up to date.
[ 1%] No patch step for 'cpplog-project'
[ 1%] Performing configure step for 'cpplog-project'
-- Configuring done
-- Generating done
-- Build files have been written to: /home/admin/opencl/VC4C/build/cpplog/src/cpplog-project-build
[ 2%] Performing build step for 'cpplog-project'
[ 50%] Built target cpplog-static
[100%] Built target cpplog
[ 3%] Built target cpplog-project-build
[ 48%] Built target VC4CC
[ 48%] Built target GetGitCommit
Scanning dependencies of target VC4C
[ 48%] Building CXX object src/CMakeFiles/VC4C.dir/main.cpp.o
[ 48%] Linking CXX executable vc4c
[ 48%] Built target VC4C
[ 50%] Built target qpu_emulator
[ 88%] Built target TestData
[ 89%] Performing update step for 'cpptest-lite-project'
hint: Pulling without specifying how to reconcile divergent branches is
hint: discouraged. You can squelch this message by running one of the following
hint: commands sometime before your next pull:
hint:
hint: git config pull.rebase false # merge (the default strategy)
hint: git config pull.rebase true # rebase
hint: git config pull.ff only # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
From https://github.com/doe300/cpptest-lite
* branch HEAD -> FETCH_HEAD
Already up to date.
[ 89%] No patch step for 'cpptest-lite-project'
[ 89%] Performing configure step for 'cpptest-lite-project'
-- Configuring done
-- Generating done
-- Build files have been written to: /home/admin/opencl/VC4C/build/cpptest-lite/src/cpptest-lite-project-build
[ 90%] Performing build step for 'cpptest-lite-project'
[100%] Built target cpptest-lite
[ 91%] Built target cpptest-lite-project-build
[ 92%] Linking CXX executable TestVC4C
[100%] Built target TestVC4C
admin@raspi01:~/opencl/VC4C/build $ sudo make install
[ 1%] Performing update step for 'cpplog-project'
hint: Pulling without specifying how to reconcile divergent branches is
hint: discouraged. You can squelch this message by running one of the following
hint: commands sometime before your next pull:
hint:
hint: git config pull.rebase false # merge (the default strategy)
hint: git config pull.rebase true # rebase
hint: git config pull.ff only # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
From https://github.com/doe300/cpplog
* branch HEAD -> FETCH_HEAD
Already up to date.
[ 1%] No patch step for 'cpplog-project'
[ 1%] Performing configure step for 'cpplog-project'
-- Configuring done
-- Generating done
-- Build files have been written to: /home/admin/opencl/VC4C/build/cpplog/src/cpplog-project-build
[ 2%] Performing build step for 'cpplog-project'
[ 50%] Built target cpplog-static
[100%] Built target cpplog
[ 3%] Built target cpplog-project-build
[ 48%] Built target VC4CC
[ 48%] Built target GetGitCommit
Scanning dependencies of target VC4C
[ 48%] Building CXX object src/CMakeFiles/VC4C.dir/main.cpp.o
[ 48%] Linking CXX executable vc4c
[ 48%] Built target VC4C
[ 50%] Built target qpu_emulator
[ 88%] Built target TestData
[ 89%] Performing update step for 'cpptest-lite-project'
hint: Pulling without specifying how to reconcile divergent branches is
hint: discouraged. You can squelch this message by running one of the following
hint: commands sometime before your next pull:
hint:
hint: git config pull.rebase false # merge (the default strategy)
hint: git config pull.rebase true # rebase
hint: git config pull.ff only # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
From https://github.com/doe300/cpptest-lite
* branch HEAD -> FETCH_HEAD
Already up to date.
[ 89%] No patch step for 'cpptest-lite-project'
[ 89%] Performing configure step for 'cpptest-lite-project'
-- Configuring done
-- Generating done
-- Build files have been written to: /home/admin/opencl/VC4C/build/cpptest-lite/src/cpptest-lite-project-build
[ 90%] Performing build step for 'cpptest-lite-project'
[100%] Built target cpptest-lite
[ 91%] Built target cpptest-lite-project-build
[100%] Built target TestVC4C
Install the project...
-- Install configuration: "Debug"
-- Up-to-date: /usr/local/lib/cmake/mpark_variant/mpark_variant-targets.cmake
-- Up-to-date: /usr/local/include/mpark
-- Up-to-date: /usr/local/include/mpark/config.hpp
-- Up-to-date: /usr/local/include/mpark/lib.hpp
-- Up-to-date: /usr/local/include/mpark/in_place.hpp
-- Up-to-date: /usr/local/include/mpark/variant.hpp
-- Up-to-date: /usr/local/lib/cmake/mpark_variant/mpark_variant-config.cmake
-- Up-to-date: /usr/local/lib/cmake/mpark_variant/mpark_variant-config-version.cmake
-- Up-to-date: /usr/local/lib/libVC4CC.so.0.4.9999
-- Up-to-date: /usr/local/lib/libVC4CC.so.1.2
-- Up-to-date: /usr/local/lib/libVC4CC.so
-- Installing: /usr/local/bin/vc4c
-- Set runtime path of "/usr/local/bin/vc4c" to "/usr/local/lib"
-- Up-to-date: /usr/local/share/vc4cc/VC4CC-targets.cmake
-- Installing: /usr/local/share/vc4cc/VC4CC-targets-debug.cmake
-- Up-to-date: /usr/local/include/vc4cc
-- Up-to-date: /usr/local/include/vc4cc/Precompiler.h
-- Up-to-date: /usr/local/include/vc4cc/CompilationError.h
-- Up-to-date: /usr/local/include/vc4cc/Compiler.h
-- Up-to-date: /usr/local/include/vc4cc/tools.h
-- Up-to-date: /usr/local/include/vc4cc/VC4C.h
-- Up-to-date: /usr/local/include/vc4cc/config.h
-- Up-to-date: /usr/local/lib/libvc4c_testdata.a
-- Up-to-date: /usr/local/share/vc4cc/TestData-target.cmake
-- Installing: /usr/local/share/vc4cc/TestData-target-debug.cmake
-- Up-to-date: /usr/local/include/vc4cc/TestData.h
admin@raspi01:~/opencl/VC4C/build $ sudo ldconfig
admin@raspi01:~/opencl/VC4C/build $ cd CMakeFiles/
admin@raspi01:~/opencl/VC4C/build/CMakeFiles $ nano CMakeError.log
admin@raspi01:~/opencl/VC4C/build/CMakeFiles $ cd ..
admin@raspi01:~/opencl/VC4C/build $ cd ..
admin@raspi01:~/opencl/VC4C $ cd ..
admin@raspi01:~/opencl $ cd build
-bash: cd: build: No such file or directory
admin@raspi01:~/opencl $ cd VC4CL
admin@raspi01:~/opencl/VC4CL $ cd build/
admin@raspi01:~/opencl/VC4CL/build $ cmake ..
-- Found headers for OpenCL up to version 2.2 located in /usr/include
-- VC4C library found: /home/admin/opencl/VC4C/build/src/libVC4CC.so
-- VC4C compiler header found at: /home/admin/opencl/VC4C/include/VC4C.h
-- VC4C test data library found: /home/admin/opencl/VC4C/build/test/libvc4c_testdata.a
-- VC4C test data header found: /home/admin/opencl/VC4C/build/test/TestData.h
-- vcsm library found at: /usr/lib/arm-linux-gnueabihf/libvcsm.so
-- found clang-format: /usr/bin/clang-format
-- Configuring done
-- Generating done
-- Build files have been written to: /home/admin/opencl/VC4CL/build
admin@raspi01:~/opencl/VC4CL/build $ make
[ 0%] Built target GetGitCommit
Scanning dependencies of target VC4CL
[ 2%] Building CXX object src/CMakeFiles/VC4CL.dir/common.cpp.o
[ 5%] Linking CXX shared library libVC4CL.so
[ 82%] Built target VC4CL
[ 85%] Linking CXX executable vc4cl_dump_analyzer
[ 88%] Built target vc4cl_dump_analyzer
[ 91%] Linking CXX executable v3d_profile
[ 94%] Built target v3d_profile
[ 97%] Linking CXX executable v3d_info
[100%] Built target v3d_info
admin@raspi01:~/opencl/VC4CL/build $ sudo make install
[ 0%] Built target GetGitCommit
Scanning dependencies of target VC4CL
[ 2%] Building CXX object src/CMakeFiles/VC4CL.dir/common.cpp.o
[ 5%] Linking CXX shared library libVC4CL.so
[ 82%] Built target VC4CL
[ 85%] Linking CXX executable vc4cl_dump_analyzer
[ 88%] Built target vc4cl_dump_analyzer
[ 91%] Linking CXX executable v3d_profile
[ 94%] Built target v3d_profile
[ 97%] Linking CXX executable v3d_info
[100%] Built target v3d_info
Install the project...
-- Install configuration: "Debug"
-- Installing: /usr/local/lib/libVC4CL.so.0.4.9999
-- Up-to-date: /usr/local/lib/libVC4CL.so.1.2
-- Set runtime path of "/usr/local/lib/libVC4CL.so.0.4.9999" to "/usr/local/lib"
-- Up-to-date: /usr/local/lib/libVC4CL.so
-- Up-to-date: /usr/local/share/vc4cl/VC4CL-targets.cmake
-- Installing: /usr/local/share/vc4cl/VC4CL-targets-debug.cmake
-- Installing: /usr/local/bin/v3d_info
-- Set runtime path of "/usr/local/bin/v3d_info" to "/usr/local/lib"
-- Installing: /usr/local/bin/v3d_profile
-- Set runtime path of "/usr/local/bin/v3d_profile" to "/usr/local/lib"
-- Installing: /usr/local/bin/vc4cl_dump_analyzer
-- Set runtime path of "/usr/local/bin/vc4cl_dump_analyzer" to "/usr/local/lib"
From the last log you posted, it looks like it worked, didn't it?
It looks like the building worked correctly. All the output was successfull. running clinfo still gives me the output platforms
Number of platforms 0`
To be able to use VC4CL globally, you'll need to configure it with the CMake switch BUILD_ICD=ON
, rebuild and reinstall. Then it should be listed (although it requires root rights).
Alternatively of course you could LD_PRELOAD
the library before any OpenCL-client process invocation.
Thanks, I'll try that right away!
Currently running the commands
mkdir build
cd build
cmake --BUILD_ICD=ON --DMULTI_THREADED=OFF ..
make
sudo make install
sudo ldconfig
for each directory (VC4CLStdLib, VC4C, VC4CL).
Unfortunately I still get the "Number of platforms: 0" output on clinfo.
the CMakeError.log in VC4C/build/CMakeFiles contains again this output
Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /root/opencl/VC4C/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake cmTC_832f8/fast && /usr/bin/gmake -f CMakeFiles/cmTC_832f8.dir/build.make CMakeFiles/cmTC_832f8.dir/build
gmake[1]: Entering directory '/root/opencl/VC4C/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_832f8.dir/src.c.o
/usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -o CMakeFiles/cmTC_832f8.dir/src.c.o -c /root/opencl/VC4C/build/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_832f8
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_832f8.dir/link.txt --verbose=1
/usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -rdynamic CMakeFiles/cmTC_832f8.dir/src.c.o -o cmTC_832f8
/usr/bin/ld: CMakeFiles/cmTC_832f8.dir/src.c.o: in function `main':
src.c:(.text+0x40): undefined reference to `pthread_create'
/usr/bin/ld: src.c:(.text+0x4c): undefined reference to `pthread_detach'
/usr/bin/ld: src.c:(.text+0x58): undefined reference to `pthread_cancel'
/usr/bin/ld: src.c:(.text+0x68): undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_832f8.dir/build.make:106: cmTC_832f8] Error 1
gmake[1]: Leaving directory '/root/opencl/VC4C/build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:140: cmTC_832f8/fast] Error 2
Source file was:
#include <pthread.h>
void* test_func(void* data)
{
return data;
}
int main(void)
{
pthread_t thread;
pthread_create(&thread, NULL, test_func, NULL);
pthread_detach(thread);
pthread_cancel(thread);
pthread_join(thread, NULL);
pthread_atfork(NULL, NULL, NULL);
pthread_exit(NULL);
return 0;
}
Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /root/opencl/VC4C/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake cmTC_12eea/fast && /usr/bin/gmake -f CMakeFiles/cmTC_12eea.dir/build.make CMakeFiles/cmTC_12eea.dir/build
gmake[1]: Entering directory '/root/opencl/VC4C/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_12eea.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_12eea.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.18/Modules/CheckFunctionExists.c
Linking C executable cmTC_12eea
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_12eea.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_12eea.dir/CheckFunctionExists.c.o -o cmTC_12eea -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
gmake[1]: *** [CMakeFiles/cmTC_12eea.dir/build.make:106: cmTC_12eea] Error 1
gmake[1]: Leaving directory '/root/opencl/VC4C/build/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:140: cmTC_12eea/fast] Error 2
The CMakeError.log is irrelevant. This is from an internal CMake capabilities test.
Can you run the clinfo with the OCL_ICD_ENABLE_TRACE=1
and VC4CL_DEBUG=api
environment variables?
Also, does the file /etc/OpenCL/vendors/VC4CL.icd
exist and what is its content? Should be the path to the VC4CL library.
Hi @doe300
After recompiling the whole projekt using the BUILD_ICD=ON switch it seems functional!
Thank you so much for your support.
my /etc/OpenCL/vendors/VC4CL.icd
file does correctly show the path to the VC4CL library:
/usr/local/libVC4CL.so
When building the VC4C Library (running make) it fails while trying to Link CXX shared library libVC4CC.so with the same error as #157
The output in VC4C/build/CMakeFiles/CMakeError.log is the same as in issue
Using this install routine:
(The kernel downgrade was included due to the following entry: #https://github.com/Idein/rpi-vcsm/issues/2 Even if it is concerning another project, the output remains the same without the downgrade Using cmake -DMULTI_THREADED=OFF .. as seen in other (older) issues)
uname -a
clang version:
gcc version:
/proc/cpuinfo
Is this project supported (buildable) on Raspberry Pi 3A+ and if so, how can I install it?
Thanks for this great Projekt and thanks in advance!