clinfo can't find VideoCore on Raspi 3B+, and return `Number of platforms 0`
physpeach opened this issue · 5 comments
physpeach commented
I have referenced mainly two links below for installing VC4CL on Raspi 3B+ (debian).
- https://github.com/doe300/VC4CL/wiki/How-to-get
- https://qengineering.eu/install-opencl-on-raspberry-pi-3.html
Build seems to be successful, and I can see libVC4CL.so
.
But clinfo
returns Number of platforms 0
.
Is there anything I am not aware of?
Here's my process for building from plain debian.
$ sudo apt update
$ sudo apt upgrade
$ sudo apt -y install cmake git
$ sudo apt -y install ocl-icd-opencl-dev ocl-icd-dev opencl-headers
$ sudo apt -y install clinfo
$ sudo apt -y install libraspberrypi-dev
$ sudo apt -y install clang clang-format clang-tidy
$ mkdir ~/github/vc4c
$ cd ~/github/vc4c
$ git clone git@github.com/doe300/VC4CLStdLib.git
$ git clone git@github.com/doe300/VC4CL.git
$ git clone git@github.com/doe300/VC4C.git
$ cd VC4CLStdLib
$ mkdir build
$ cd build
$ cmake ..
$ make -j2
$ sudo make install
$ sudo ldconfig
$ cd ../../VC4C
$ mkdir build
$ cd build
$ cmake ..
$ make -j2
$ sudo make install
$ sudo ldconfig
$ cd ../../opencl/VC4CL
$ mkdir build
$ cd build
$ cmake ..
$ make
$ sudo make install
$ sudo ldconfig
$ sudo LD_PRELOAD=src/libVC4CL.so clinfo
Number of platforms 0
This is the first time to submit a issue on Github.
doe300 commented
Can you check following:
- Does the file
/etc/OpenCL/vendors/VC4CL.icd
exist and contain the correct path to the installed VC4CL.so library? - What is the output of e.g.
nm -D <path/to/the>/libVC4CL.so | grep 'clCreateKernel'
?
physpeach commented
/etc/OpenCL/...
does not exist.- below
$ nm -D /usr/local/lib/libVC4CL.so | grep 'clCreateKernel'
00151adc T clCreateKernel
00151fd0 T clCreateKernelsInProgram
- I found
/usr/local/include/vc4cc
and/usr/local/include/vc4cl-stdlib
Thank you for fast comment.
physpeach commented
I've rebuilt and installed VC4CL for checking message.
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
-- Up-to-date: /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"
doe300 commented
So it looks like the symbols in the VC4CL library mismatch with what clinfo expects.
There are two different ways that should solve this:
- Rebuild VC4CL (no need to rebuild VC4C) with the CMake flag
-DBUILD_ICD=ON
and install it again. Now the/etc/OpenCL/...
file should exist and clinfo should be able to find the platform via the ICD loader. (the global way) - Run clinfo with
LD_PRELOAD=<path/to/VC4CL/build/src/lib>/OpenCL.so
(or alternativelyLD_LIBRARY_PATH=<path/to/VC4CL/build/src/lib>
). This is a symlink to thelibVC4CL.so
you tried before, but with the library name that clinfo expects. (the local way)
physpeach commented
The problem has been solved.
Many thanks