Skip to contentSkip to conversation

package/opengl/libopenvx: new virtual package

PATCH In review Refik Tuzakli 3 participants 6 messages Feb 9, 2020 – Aug 5, 2021 Arm i.MX and Layerscape

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 package/opengl/libopenvx: new virtual package

---
 DEVELOPERS                            | 1 +
 package/opengl/Config.in              | 1 +
 package/opengl/libopenvx/Config.in    | 6 ++++++
 package/opengl/libopenvx/libopenvx.mk | 7 +++++++
 4 files changed, 15 insertions(+)
 create mode 100644 package/opengl/libopenvx/Config.in
 create mode 100644 package/opengl/libopenvx/libopenvx.mk
DEVELOPERS +1 -0
index cb13035bc4..fa9043b0c4 100644
@@ -2076,6 +2076,7 @@ F:	package/uhttpd/
 F:	package/ustream-ssl/
 
 N:	Refik Tuzakli <[email protected]>
+F:	package/opengl/libopenvx
 F:	package/paho-mqtt-cpp/
 
 N:	R??mi R??rolle <[email protected]>
package/opengl/Config.in +1 -0
index cbc001427d..10bdefdb39 100644
@@ -4,3 +4,4 @@ source "package/opengl/libgles/Config.in"
 source "package/opengl/libopencl/Config.in"
 source "package/opengl/libopenvg/Config.in"
 source "package/opengl/libopenmax/Config.in"
+source "package/opengl/libopenvx/Config.in"
package/opengl/libopenvx/Config.in new file +6 -0
new file mode 100644
index 0000000000..58d497130e
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_HAS_LIBOPENVX
+	bool
+
+config BR2_PACKAGE_PROVIDES_LIBOPENVX
+	string
+	depends on BR2_PACKAGE_HAS_LIBOPENVX
package/opengl/libopenvx/libopenvx.mk new file +7 -0
new file mode 100644
index 0000000000..25ef639d3c
@@ -0,0 +1,7 @@
+################################################################################
+#
+# libopenvx
+#
+################################################################################
+
+$(eval $(virtual-package))
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/3 package/opengl/libvulkan: new virtual package

---
 DEVELOPERS                         | 1 +
 package/opengl/Config.in           | 1 +
 package/opengl/libvulkan/Config.in | 6 ++++++
 3 files changed, 8 insertions(+)
 create mode 100644 package/opengl/libvulkan/Config.in
DEVELOPERS +1 -0
index fa9043b0c4..7703d5fa3e 100644
@@ -2077,6 +2077,7 @@ F:	package/ustream-ssl/
 
 N:	Refik Tuzakli <[email protected]>
 F:	package/opengl/libopenvx
+F:	package/opengl/libvulkan/
 F:	package/paho-mqtt-cpp/
 
 N:	R??mi R??rolle <[email protected]>
package/opengl/Config.in +1 -0
index 10bdefdb39..af34fb6a46 100644
@@ -5,3 +5,4 @@ source "package/opengl/libopencl/Config.in"
 source "package/opengl/libopenvg/Config.in"
 source "package/opengl/libopenmax/Config.in"
 source "package/opengl/libopenvx/Config.in"
+source "package/opengl/libvuulkan/Config.in"
package/opengl/libvulkan/Config.in new file +6 -0
new file mode 100644
index 0000000000..c0cae4681b
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_HAS_LIBVULKAN
+	bool
+
+config BR2_PACKAGE_PROVIDES_LIBVULKAN
+	string
+	depends on BR2_PACKAGE_HAS_LIBVULKAN
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/3 package/opengl/libvulkan: new virtual package

Hello Refik,

Quoted 25 lines · Refik Tuzakli
---
 DEVELOPERS                         | 1 +
 package/opengl/Config.in           | 1 +
 package/opengl/libvulkan/Config.in | 6 ++++++
 3 files changed, 8 insertions(+)
 create mode 100644 package/opengl/libvulkan/Config.in
DEVELOPERS +1 -0
index fa9043b0c4..7703d5fa3e 100644
@@ -2077,6 +2077,7 @@ F:	package/ustream-ssl/
 
 N:	Refik Tuzakli <[email protected]>
 F:	package/opengl/libopenvx
+F:	package/opengl/libvulkan/
 F:	package/paho-mqtt-cpp/
 
 N:	R?mi R?rolle <[email protected]>
package/opengl/Config.in +0 -0
index 10bdefdb39..af34fb6a46 100644

package/opengl/Config.in source "package/opengl/libopencl/Config.in" · line 8

Quoted 4 lines
package/opengl/Config.in +1 -0
@@ -5,3 +5,4 @@ source "package/opengl/libopencl/Config.in"
 source "package/opengl/libopenvg/Config.in"
 source "package/opengl/libopenmax/Config.in"
 source "package/opengl/libopenvx/Config.in"
+source "package/opengl/libvuulkan/Config.in"

s/libvuulkan/libvulkan/ ?

Regards,
Peter

Quoted 12 lines
package/opengl/libvulkan/Config.in new file +6 -0
new file mode 100644
index 0000000000..c0cae4681b
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_HAS_LIBVULKAN
+	bool
+
+config BR2_PACKAGE_PROVIDES_LIBVULKAN
+	string
+	depends on BR2_PACKAGE_HAS_LIBVULKAN
#3 lore raw

PATCH 3/3 package/freescale-imx/imx-gpu-viv: add options for new feture

In reply to Refik Tuzakli

NXP supply new fetures with new gpu driver. This patch adds options to select the library needed and saves space on target.

---
 package/freescale-imx/imx-gpu-viv/Config.in   |  54 +++++++++
 .../freescale-imx/imx-gpu-viv/imx-gpu-viv.mk  | 103 ++++++++++++++++--
 2 files changed, 145 insertions(+), 12 deletions(-)
package/freescale-imx/imx-gpu-viv/Config.in +54 -0
index a2deaf2e12..d206c04e6e 100644
@@ -90,4 +90,58 @@ config BR2_PACKAGE_IMX_GPU_VIV_GMEM_INFO
 	  Copy the gmem_info tool to the target which provides
 	  information about GPU memory consumption.
 
+config BR2_PACKAGE_IMX_GPU_VIV_LIBOPENCL
+	bool "install libopencl"
+	select BR2_PACKAGE_HAS_LIBOPENCL
+	help
+	  OpenCL (Open Computing Language) is the open, royalty-free
+	  standard for cross-platform, parallel programming of diverse
+	  processors found in personal computers, servers, mobile
+	  devices and embedded platforms. OpenCL greatly improves the
+	  speed and responsiveness of a wide spectrum of applications in
+	  numerous market categories including gaming and entertainment
+	  titles, scientific and medical software, professional creative
+	  tools, vision processing, and neural network training and
+	  inferencing.
+
+config BR2_PACKAGE_PROVIDES_LIBOPENCL
+	depends on BR2_PACKAGE_IMX_GPU_VIV_LIBOPENCL
+	default "imx-gpu-viv"
+
+config BR2_PACKAGE_IMX_GPU_VIV_LIBOPENVX
+	bool "install libopenvx"
+	select BR2_PACKAGE_HAS_LIBOPENVX
+	help
+	  OpenVX is an open, royalty-free standard for cross platform
+	  acceleration of computer vision applications. OpenVX enables
+	  performance and power-optimized computer vision processing.
+
+config BR2_PACKAGE_PROVIDES_LIBOPENVX
+	depends on BR2_PACKAGE_IMX_GPU_VIV_LIBOPENVX
+	default "imx-gpu-viv"
+
+config BR2_PACKAGE_IMX_GPU_VIV_LIBVULKAN
+	bool "install libvulkan"
+	select BR2_PACKAGE_HAS_LIBVULKAN
+	help
+	  Vulkan is a new generation graphics and compute API that
+	  provides high-efficiency, cross-platform access to modern GPUs
+	  used in a wide variety of devices from PCs and consoles to
+	  mobile phones and embedded platforms.
+
+
+config BR2_PACKAGE_PROVIDES_LIBVULKAN
+	depends on BR2_PACKAGE_IMX_GPU_VIV_LIBVULKAN
+	default "imx-gpu-viv"
+
+config BR2_PACKAGE_IMX_GPU_VIV_LIBNN
+	bool "install libnn (experimental)"
+	depends on BR2_INSTALL_LIBSTDCPP
+	select BR2_PACKAGE_IMX_GPU_VIV_LIBOPENCL
+	select BR2_PACKAGE_IMX_GPU_VIV_LIBOPENVX
+	select BR2_PACKAGE_IMX_GPU_VIV_LIBVULKAN
+
+comment "libnn needs C++"
+	depends on !BR2_INSTALL_LIBSTDCPP
+
 endif
package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk +91 -12

134 lines not on this page · raw message

Signature · 1 line
2.17.1
#4 lore raw

PATCH 3/3 package/freescale-imx/imx-gpu-viv: add options for new feture

Hello Refik,

Quoted 108 lines · Refik Tuzakli

NXP supply new fetures with new gpu driver. This patch adds options to select the library needed and saves space on target.

---
 package/freescale-imx/imx-gpu-viv/Config.in   |  54 +++++++++
 .../freescale-imx/imx-gpu-viv/imx-gpu-viv.mk  | 103 ++++++++++++++++--
 2 files changed, 145 insertions(+), 12 deletions(-)
package/freescale-imx/imx-gpu-viv/Config.in +54 -0
index a2deaf2e12..d206c04e6e 100644
@@ -90,4 +90,58 @@ config BR2_PACKAGE_IMX_GPU_VIV_GMEM_INFO
 	  Copy the gmem_info tool to the target which provides
 	  information about GPU memory consumption.
 
+config BR2_PACKAGE_IMX_GPU_VIV_LIBOPENCL
+	bool "install libopencl"
+	select BR2_PACKAGE_HAS_LIBOPENCL
+	help
+	  OpenCL (Open Computing Language) is the open, royalty-free
+	  standard for cross-platform, parallel programming of diverse
+	  processors found in personal computers, servers, mobile
+	  devices and embedded platforms. OpenCL greatly improves the
+	  speed and responsiveness of a wide spectrum of applications in
+	  numerous market categories including gaming and entertainment
+	  titles, scientific and medical software, professional creative
+	  tools, vision processing, and neural network training and
+	  inferencing.
+
+config BR2_PACKAGE_PROVIDES_LIBOPENCL
+	depends on BR2_PACKAGE_IMX_GPU_VIV_LIBOPENCL
+	default "imx-gpu-viv"
+
+config BR2_PACKAGE_IMX_GPU_VIV_LIBOPENVX
+	bool "install libopenvx"
+	select BR2_PACKAGE_HAS_LIBOPENVX
+	help
+	  OpenVX is an open, royalty-free standard for cross platform
+	  acceleration of computer vision applications. OpenVX enables
+	  performance and power-optimized computer vision processing.
+
+config BR2_PACKAGE_PROVIDES_LIBOPENVX
+	depends on BR2_PACKAGE_IMX_GPU_VIV_LIBOPENVX
+	default "imx-gpu-viv"
+
+config BR2_PACKAGE_IMX_GPU_VIV_LIBVULKAN
+	bool "install libvulkan"
+	select BR2_PACKAGE_HAS_LIBVULKAN
+	help
+	  Vulkan is a new generation graphics and compute API that
+	  provides high-efficiency, cross-platform access to modern GPUs
+	  used in a wide variety of devices from PCs and consoles to
+	  mobile phones and embedded platforms.
+
+
+config BR2_PACKAGE_PROVIDES_LIBVULKAN
+	depends on BR2_PACKAGE_IMX_GPU_VIV_LIBVULKAN
+	default "imx-gpu-viv"
+
+config BR2_PACKAGE_IMX_GPU_VIV_LIBNN
+	bool "install libnn (experimental)"
+	depends on BR2_INSTALL_LIBSTDCPP
+	select BR2_PACKAGE_IMX_GPU_VIV_LIBOPENCL
+	select BR2_PACKAGE_IMX_GPU_VIV_LIBOPENVX
+	select BR2_PACKAGE_IMX_GPU_VIV_LIBVULKAN
+
+comment "libnn needs C++"
+	depends on !BR2_INSTALL_LIBSTDCPP
+
 endif
package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk +28 -0
index 646d4e3673..9e2e9f58e2 100644
@@ -56,7 +56,62 @@ define IMX_GPU_VIV_BUILD_CMDS
 	ln -sf libGLESv2-$(IMX_GPU_VIV_LIB_TARGET).so $(@D)/gpu-core/usr/lib/libGLESv2.so.2.0.0
 	ln -sf libGAL-$(IMX_GPU_VIV_LIB_TARGET).so $(@D)/gpu-core/usr/lib/libGAL.so
 	ln -sf libVDK-$(IMX_GPU_VIV_LIB_TARGET).so $(@D)/gpu-core/usr/lib/libVDK.so
+	$(if $(BR2_PACKAGE_IMX_GPU_VIV_VULKAN),
+		ln -sf libvulkan-$(IMX_GPU_VIV_LIB_TARGET).so $(@D)/gpu-core/usr/lib/libvulkan.so
+	)
+endef
+
+ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_LIBOPENCL),y)
+IMX_GPU_VIV_PROVIDES += libopencl
+define IMX_GPU_VIV_INSTALL_TARGET_LIBOPENCL
+	cp -dpfr $(@D)/gpu-core/usr/lib/libOpenCL* $(TARGET_DIR)/usr/lib
+	cp -dpfr $(@D)/gpu-core/usr/lib/libVivanteOpenCL* $(TARGET_DIR)/usr/lib
+endef
+define IMX_GPU_VIV_INSTALL_STAGING_LIBOPENCL
+	cp -dpfr $(@D)/gpu-core/usr/include/CL $(STAGING_DIR)/usr/include/
+endef
+endif
+
+ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_LIBOPENVX),y)
+IMX_GPU_VIV_PROVIDES += libopenvx
+define IMX_GPU_VIV_INSTALL_TARGET_LIBOPENVX
+	for lib in ovxlib OpenVX OpenVXU Ovx12VXCBinary-evis Ovx12VXCBinary-evis2 CLC; do \
+		cp -dpfr $(@D)/gpu-core/usr/lib/lib$${lib}.so $(TARGET_DIR)/usr/lib ; \
+	done
+endef
+define IMX_GPU_VIV_INSTALL_STAGING_LIBOPENVX
+	cp -dpfr $(@D)/gpu-core/usr/include/VX $(STAGING_DIR)/usr/include/
+	cp -dpfr $(@D)/gpu-core/usr/include/OVXLIB $(STAGING_DIR)/usr/include/
+endef
+endif

package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk define IMX_GPU_VIV_BUILD_CMDS · line 96

Quoted 10 lines
package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk +10 -0
+
+ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_LIBVULKAN),y)
+IMX_GPU_VIV_PROVIDES += libvulkan
+define IMX_GPU_VIV_INSTALL_TARGET_LIBVULKAN
+	cp -dpfr $(@D)/gpu-core/usr/lib/libvulkan-$(IMX_GPU_VIV_LIB_TARGET).so $(TARGET_DIR)/usr/lib
+	cp -dpfr $(@D)/gpu-core/usr/lib/libGLSLC.so $(TARGET_DIR)/usr/lib
+	cp -dpfr $(@D)/gpu-core/usr/lib/libSPIRV_viv.so $(TARGET_DIR)/usr/lib
+endef
+define IMX_GPU_VIV_INSTALL_STAGING_LIBVULKAN
+	cp -dpfr $(@D)/gpu-core/usr/include/vulkan $(STAGING_DIR)/usr/include/

Did not look at the details of the package yet (and no access to hardware to test at the moment), but some questions (started an RFC patch series for testing out Raspberry Pi 4 Vulkan support[3] - not yet running):

- are the header files copies of the original provided by [1]?
- any consumer/user example of the libraries? How does they fit into the vulkan-loader framework [2] (if they do)?
- are the provided headers/libs enough to enable e.g. Qt vulkan support/examples?

Regards,
Peter

Quoted 7 lines
package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk +7 -0
+endef
+endif
+
+ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_LIBNN),y)
+IMX_GPU_VIV_PROVIDES += libnn
+define IMX_GPU_VIV_INSTALL_TARGET_LIBNN
+	cp -dpfr $(@D)/gpu-core/usr/lib/libnnrt.so $(TARGET_DIR)/usr/lib

package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk define IMX_GPU_VIV_BUILD_CMDS · line 113

Quoted 10 lines
package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk +9 -0
+	cp -dpfr $(@D)/gpu-core/usr/lib/libneuralnetworks.so $(TARGET_DIR)/usr/lib
+	cp -dpfr $(@D)/gpu-core/usr/lib/libNNGPUBinary-lite.so $(TARGET_DIR)/usr/lib
+	cp -dpfr $(@D)/gpu-core/usr/lib/libNNGPUBinary-xsvx.so $(TARGET_DIR)/usr/lib
+	cp -dpfr $(@D)/gpu-core/usr/lib/libNNVXCBinary-evis.so $(TARGET_DIR)/usr/lib
+	cp -dpfr $(@D)/gpu-core/usr/lib/libNNGPUBinary-ulite.so $(TARGET_DIR)/usr/lib
+	cp -dpfr $(@D)/gpu-core/usr/lib/libNNVXCBinary-evis2.so $(TARGET_DIR)/usr/lib
 endef
+define IMX_GPU_VIV_INSTALL_STAGING_LIBVULKAN
+	cp -dpfr $(@D)/gpu-core/usr/include/nnrt $(STAGING_DIR)/usr/include/
+endef

s/IMX_GPU_VIV_INSTALL_STAGING_LIBVULKAN/IMX_GPU_VIV_INSTALL_STAGING_LIBNN/?

Regards,
Peter

[1] https://github.com/KhronosGroup/Vulkan-Headers
[2] https://github.com/KhronosGroup/Vulkan-Loader
[3] https://patchwork.ozlabs.org/project/buildroot/list/?series=221906&state=*

Quoted 79 lines
package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk +37 -12
+endif
 
 ifeq ($(IMX_GPU_VIV_LIB_TARGET),fb)
 define IMX_GPU_VIV_FIXUP_FB_HEADERS
@@ -88,7 +143,10 @@ endef
 endif
 
 define IMX_GPU_VIV_INSTALL_STAGING_CMDS
-	cp -r $(@D)/gpu-core/usr/* $(STAGING_DIR)/usr
+	cp -dpfr $(@D)/gpu-core/usr/lib $(STAGING_DIR)/usr
+	for lib in EGL GL GLES GLES2 GLES3 HAL KHR VG gbm.h gc_vdk.h gc_vdk_types.h vdk.h; do \
+		cp -dpfr $(@D)/gpu-core/usr/include/$${lib} $(STAGING_DIR)/usr/include/ ; \
+	done
 	$(IMX_GPU_VIV_FIXUP_FB_HEADERS)
 	$(IMX_GPU_VIV_FIXUP_PKGCONFIG)
 	for lib in egl gbm glesv1_cm glesv2 vg; do \
@@ -96,12 +154,21 @@ define IMX_GPU_VIV_INSTALL_STAGING_CMDS
 			$(@D)/gpu-core/usr/lib/pkgconfig/$${lib}.pc \
 			$(STAGING_DIR)/usr/lib/pkgconfig/$${lib}.pc; \
 	done
+	$(IMX_GPU_VIV_INSTALL_STAGING_LIBOPENCL)
+	$(IMX_GPU_VIV_INSTALL_STAGING_LIBOPENVX)
+	$(IMX_GPU_VIV_INSTALL_STAGING_LIBVULKAN)
+	$(IMX_GPU_VIV_INSTALL_STAGING_LIBNN)
 endef
 
 ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_EXAMPLES),y)
 define IMX_GPU_VIV_INSTALL_EXAMPLES
-	mkdir -p $(TARGET_DIR)/usr/share/examples/
-	cp -r $(@D)/gpu-demos/opt/* $(TARGET_DIR)/usr/share/examples/
+	mkdir -p $(TARGET_DIR)/usr/share/examples/viv_samples
+	cp -dpfr $(@D)/gpu-demos/opt/es20 $(TARGET_DIR)/usr/share/examples/viv_samples/
+	cp -dpfr $(@D)/gpu-demos/opt/tiger $(TARGET_DIR)/usr/share/examples/viv_samples/
+	cp -dpfr $(@D)/gpu-demos/opt/vdk $(TARGET_DIR)/usr/share/examples/viv_samples/
+ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_LIBOPENCL),y)
+	cp -dpfr $(@D)/gpu-demos/opt/cl11 $(TARGET_DIR)/usr/share/examples/viv_samples/
+endif
 endef
 endif
 
@@ -115,17 +182,29 @@ endif
 # Note that this is _required_, else ldconfig may create symlinks
 # to the wrong library
 define IMX_GPU_VIV_INSTALL_TARGET_CMDS
-	$(IMX_GPU_VIV_INSTALL_EXAMPLES)
-	$(IMX_GPU_VIV_INSTALL_GMEM_INFO)
-	cp -a $(@D)/gpu-core/usr/lib $(TARGET_DIR)/usr
+	cp -dpfr $(@D)/gpu-core/etc $(TARGET_DIR)/
+	for lib in dri pkgconfig libgbm.so libgbm_viv.so libVSC.so libOpenVG.so  libOpenVG.3d.so; do \
+		cp -dpfr $(@D)/gpu-core/usr/lib/$${lib} $(TARGET_DIR)/usr/lib ; \
+	done
 	for lib in EGL GAL GLESv2 VDK; do \
-		for f in $(TARGET_DIR)/usr/lib/lib$${lib}-*.so; do \
-			case $$f in \
-				*-$(IMX_GPU_VIV_LIB_TARGET).so) : ;; \
-				*) $(RM) $$f ;; \
-			esac; \
-		done; \
+		cp -dpfr $(@D)/gpu-core/usr/lib/lib$${lib}.so* $(TARGET_DIR)/usr/lib ; \
+		cp -dpfr $(@D)/gpu-core/usr/lib/lib$${lib}-$(IMX_GPU_VIV_LIB_TARGET).so $(TARGET_DIR)/usr/lib ; \
 	done
+	$(if $(BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_X11)$(BR2_PACKAGE_IMX_GPU_VIV_OUTPUT_WL),
+		cp -dpfr $(@D)/gpu-core/usr/lib/libGL.so* $(TARGET_DIR)/usr/lib ; \
+		cp -dpfr $(@D)/gpu-core/usr/lib/libGL-$(IMX_GPU_VIV_LIB_TARGET).so $(TARGET_DIR)/usr/lib ; \
+	)
+	cp -dpfr $(@D)/gpu-core/usr/lib/libGLES_C* $(TARGET_DIR)/usr/lib
+	cp -dpfr $(@D)/gpu-core/usr/lib/libGLESv1_C* $(TARGET_DIR)/usr/lib
+
+	$(IMX_GPU_VIV_INSTALL_EXAMPLES)
+	$(IMX_GPU_VIV_INSTALL_GMEM_INFO)
+
+	$(IMX_GPU_VIV_INSTALL_TARGET_LIBOPENCL)
+	$(IMX_GPU_VIV_INSTALL_TARGET_LIBOPENVX)
+	$(IMX_GPU_VIV_INSTALL_TARGET_LIBVULKAN)
+	$(IMX_GPU_VIV_INSTALL_TARGET_LIBNN)
+
 endef
 
 $(eval $(generic-package))
#5 lore raw

Re: [Buildroot] [PATCH v1 3/3] package/freescale-imx/imx-gpu-viv: add options for new feture

In reply to Refik Tuzakli

Hello Refik,

Quoted 4 lines · On Sun, 9 Feb 2020 16:44:08 +0300 Refik Tuzakli <[email protected]>…

NXP supply new fetures with new gpu driver. This patch adds options to select the library needed and saves space on target.

Thanks a lot for this patch. I started looking into it, and realized that now due to the massive amount of libraries installed by imx-gpu-viv, the TARGET_DIR/usr/lib folder weights a total of 190 MB! This is really huge, and we definitely want to make this more conditional as not everybody needs OpenVX, Vulkan, or the neural network stuff.

However, I think we would need to do that step by step, in multiple patches. First we should make conditional what the package already supports. The package currently provides:

IMX_GPU_VIV_PROVIDES = libegl libgles libopencl libopenvg

I think libegl and libgles should remain unconditional. However, we should make libopencl and libopenvg optional. When they are not enabled, then the libraries and headers should not be installed to STAGING_DIR. Indeed, we really want a hard build/link failure if somebody tries to build an OpenCL or OpenVG application and the corresponding options are not enabled. We cannot install "the whole imx-gpu-viv" to STAGING_DIR and only conditionally install to TARGET_DIR, because it means someone not enabling OpenCL would be able to build/link the application and it would only fail at runtime which is not great.

Then once we have this imx-gpu-viv package that has options for libopencl and libopenvg, you can create additional patches adding options for libvulkan, for libopenvx, for the neural network stuff.

Would you be willing to work on something like this ?

Also, one question is: are all these features available for all i.MX platforms? Vulkan, neural network stuff is available even on the older i.MX6 platforms that also use imx-gpu-viv ?

package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk define IMX_GPU_VIV_BUILD_CMDS · line 109

Quoted 10 lines
package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk +10 -0
+ifeq ($(BR2_PACKAGE_IMX_GPU_VIV_LIBNN),y)
+IMX_GPU_VIV_PROVIDES += libnn
+define IMX_GPU_VIV_INSTALL_TARGET_LIBNN
+	cp -dpfr $(@D)/gpu-core/usr/lib/libnnrt.so $(TARGET_DIR)/usr/lib
+	cp -dpfr $(@D)/gpu-core/usr/lib/libneuralnetworks.so $(TARGET_DIR)/usr/lib
+	cp -dpfr $(@D)/gpu-core/usr/lib/libNNGPUBinary-lite.so $(TARGET_DIR)/usr/lib
+	cp -dpfr $(@D)/gpu-core/usr/lib/libNNGPUBinary-xsvx.so $(TARGET_DIR)/usr/lib
+	cp -dpfr $(@D)/gpu-core/usr/lib/libNNVXCBinary-evis.so $(TARGET_DIR)/usr/lib
+	cp -dpfr $(@D)/gpu-core/usr/lib/libNNGPUBinary-ulite.so $(TARGET_DIR)/usr/lib
+	cp -dpfr $(@D)/gpu-core/usr/lib/libNNVXCBinary-evis2.so $(TARGET_DIR)/usr/lib

Do we need *all* those libraries in the target? Several of them have very similar names, they somehow look like alternatives of each other.

Quoted 2 lines

endef
+define IMX_GPU_VIV_INSTALL_STAGING_LIBVULKAN

Should have been LIBNN I guess.

package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk endef · line 146

Quoted 12 lines
package/freescale-imx/imx-gpu-viv/imx-gpu-viv.mk +4 -1
+	cp -dpfr $(@D)/gpu-core/usr/include/nnrt $(STAGING_DIR)/usr/include/
+endef
+endif
 
 ifeq ($(IMX_GPU_VIV_LIB_TARGET),fb)
 define IMX_GPU_VIV_FIXUP_FB_HEADERS
@@ -88,7 +143,10 @@ endef
 endif
 
 define IMX_GPU_VIV_INSTALL_STAGING_CMDS
-	cp -r $(@D)/gpu-core/usr/* $(STAGING_DIR)/usr
+	cp -dpfr $(@D)/gpu-core/usr/lib $(STAGING_DIR)/usr

See here? You are installing all libraries to $(STAGING_DIR), even the ones that are not in TARGET_DIR. It means you won't get link failures, but runtime failures (as I explained above).

Are you interested in improving your patch series along those lines ?

Also, Peter Seiderer comment on your patch in December, but you never replied.

Best regards,

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/buildroot