On Sat, Sep 17, 2022 at 4:56 AM Andrey Konovalov
<[email protected]> wrote:
>
> This fixes the errors like:
>
> -----8<-----
> dragonboard-845c:~$ clinfo
> <snip>
>    Max work group size                             1024
> === CL_PROGRAM_BUILD_LOG ===
> <built-in>:1:10: fatal error: 'opencl-c.h' file not found
>    Preferred work group size multiple (kernel)     <getWGsizes:1504: create 
> ker>
>    Preferred / native vector sizes
>      char                                                16 / 16
> <snip>
> -----8<-----
>
> Here clinfo runs on target board and produces correct output except for
> the "Preferred work group size multiple (kernel)" item. This is the only
> item which requires clinfo to build and run a small OpenCL kernel. But
> building OpenCL program fails as clover can't find the include file.
>
> The reason is that the include search path is set at mesa build time by
> setting CLANG_RESOURCE_DIR to "$(llvm-config --libdir)something" and
> passing it in cpp args. This results in path to sysroot included into
> CLANG_RESOURCE_DIR:
>
> -----8<-----
> dragonboard-845c:~$ strace clinfo 2>&1|grep include
> newfstatat(AT_FDCWD, 
> "/workdir/master.test/build-rpb/tmp-rpb-glibc/work/armv8-2>
> newfstatat(AT_FDCWD, "/usr/local/include", 0xfffffc3bad68, 0) = -1 ENOENT (No 
> s>
> newfstatat(AT_FDCWD, 
> "/workdir/master.test/build-rpb/tmp-rpb-glibc/work/armv8-2>
> newfstatat(AT_FDCWD, "/usr/include", {st_mode=S_IFDIR|0755, st_size=12288, 
> ...}>
> openat(AT_FDCWD, "/usr/include/opencl-c.h", O_RDONLY|O_CLOEXEC) = -1 ENOENT 
> (No>
> -----8<-----
>
> Hence clover fails to locate /usr/lib/clang/14.0.6/include/opencl-c.h.
>
> Microsoft/Intel CLC *should* have the same problem, as the code in
> compiler/clc/clc_helpers.cpp is pretty close to the one in
> gallium/frontends/clover/llvm/invocation.cpp. Except for the case when
> the contents of opencl-c.h is compiled into the CLC library (seems to be
> the most common configuration for Windows), and the problem with locating
> the include file on the target fs doesn't exist.
>
> This patch is RFC for two reasons:
> * I am not sure if using hardcoded "/usr/lib" is good enough
> * The compiler/clc/clc_helpers.cpp part is not tested. Maybe splitting
>   the patch into two - the clover and the Microsoft/Intel CLC parts separated 
> -
>   would make more sense.
>
> Last note for those to try reproducing the build with clover:
> clover uses libclc from meta-clang. meta-clang master branch has moved to
> clang 15.0.0 recently, which breaks mesa build as the mesa fixes to account
> for clang 15.0.0 changes have been merged into mesa main branch, but have not
> yet made it into the last mesa release.
> My temporary solution is rolling meta-clang back to the commit just before the
> 14.0.6 -> 15.0.0 update, and cherry-picking "llvm-config: Replace TARGET_*
> flags with normal equivalent flags". The latter is not required in my case,
> it just makes llvm-config wrapper from meta-clang (the one used in this build)
> to look closer to the llvm-config wrapper from oe-core.
>
> Andrey Konovalov (1):
>   mesa: fix building OpenCL programs
>
>  ...-meson.CLANG_RESOURCE_DIR-workaround.patch | 42 +++++++++++++++++++
>  meta/recipes-graphics/mesa/mesa.inc           |  1 +
>  2 files changed, 43 insertions(+)
>  create mode 100644 
> meta/recipes-graphics/mesa/files/0001-meson.CLANG_RESOURCE_DIR-workaround.patch
>

I am not able to find the patch with above changes. Did you miss sending it ?


> --
> 2.25.1
>
>
> 
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#170840): 
https://lists.openembedded.org/g/openembedded-core/message/170840
Mute This Topic: https://lists.openembedded.org/mt/93741464/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to