[Buildroot] [PATCH v4 10/11] package/mesa3d: enable OpenCL support

Erik Larsson karl.erik.larsson at gmail.com
Mon Apr 2 05:23:23 UTC 2018


Hi Valentin, Thomas, all!

2018-04-01 23:32 GMT+02:00 Thomas Petazzoni <thomas.petazzoni at bootlin.com>:
> Hello,
>
> On Thu, 29 Mar 2018 13:33:45 +0200, Valentin Korenblit wrote:
>
>> diff --git a/package/mesa3d/Config.in b/package/mesa3d/Config.in
>> index e99e737d31..bad7ac4339 100644
>> --- a/package/mesa3d/Config.in
>> +++ b/package/mesa3d/Config.in
>> @@ -33,6 +33,22 @@ config BR2_PACKAGE_MESA3D_LLVM
>>  comment "mesa3d w/ llvm needs llvm"
>>       depends on !BR2_PACKAGE_LLVM_ARCH_SUPPORTS
>>
>> +config BR2_PACKAGE_MESA3D_OPENCL
>> +     bool "mesa3d OpenCL"
>
> Just:
>
>         bool "OpenCL"
>
>> +     depends on BR2_PACKAGE_MESA3D_GALLIUM_DRIVER_R600
>
> This is certainly not really understanding how OpenCL works, but why do
> you need this Gallium driver compiled in? Does the result only works on
> a system with an AMD GPU ?

What about creating a virtual package for OpenCL just as with OpenVG?

I've started to work on patch series were OpenCL is a virtual package
but I'm not 100% finished. I still need more testing and add some
packages that do not use the new virtual package of OpenCL. I also
need to add more platforms that provide OpenCL. I've pushed some
patches to GitHub that is my draft/work-in-progress branch,
https://github.com/ortogonal/buildroot/commits/wip/opencl. If you like
it I can speed up the work with it!

>
>> +     depends on BR2_PACKAGE_MESA3D_LLVM
>> +     depends on BR2_USE_WCHAR #elfutils
>> +     depends on BR2_TOOLCHAIN_USES_UCLIBC || BR2_TOOLCHAIN_USES_GLIBC
>> +     depends on !BR2_bfin #elfutils
>> +     select BR2_PACKAGE_ELFUTILS
>
> Interesting that elfutils is needed here.
>
>> diff --git a/package/mesa3d/mesa3d.mk b/package/mesa3d/mesa3d.mk
>> index 498ad57eed..1df28c43cb 100644
>> --- a/package/mesa3d/mesa3d.mk
>> +++ b/package/mesa3d/mesa3d.mk
>> @@ -233,4 +233,13 @@ else
>>  MESA3D_CONF_OPTS += --disable-lmsensors
>>  endif
>>
>> +# Clover requires libelf
>
> Comment not really useful, it's obvious from the code below.
>
>> +ifeq ($(BR2_PACKAGE_MESA3D_OPENCL),y)
>> +MESA3D_DEPENDENCIES += clang elfutils libclc
>> +MESA3D_CONF_OPTS += --enable-opencl \
>> +     --with-clang-libdir=$(STAGING_DIR)/usr/lib
>> +else
>> +MESA3D_CONF_OPTS += --disable-opencl
>> +endif
>> +
>>  $(eval $(autotools-package))
>
> Thanks!
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
> Embedded Linux and Kernel engineering
> https://bootlin.com
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

Regards,
Erik


More information about the buildroot mailing list