package/libgl-headers: introduce as a new virtual package for providers of OpenGL-compatible headers
PATCH 1/6 package/libgl-headers: introduce as a new virtual package for providers of OpenGL-compatible headers
Currently, there can be more than one provider of OpenGL/EGL API headers (GL/gl.h, etc.)
These are usually the same everywhere, as there are universal (as universal OpenGL is) but to avoid excessive patching and dependency mangling, a virtual package "libgl-headers" was born to provide these generic API headers.
Not to confuse with private Mesa headers or other vendor-specific stuff, but these are always in different header files.
--- package/opengl/Config.in | 1 + package/opengl/libgl-headers/Config.in | 6 ++++++ package/opengl/libgl-headers/libgl-headers.mk | 7 +++++++ 3 files changed, 14 insertions(+) create mode 100644 package/opengl/libgl-headers/Config.in create mode 100644 package/opengl/libgl-headers/libgl-headers.mk
package/opengl/Config.in +1 -0
@@ -1,4 +1,5 @@ source "package/opengl/libgl/Config.in" +source "package/opengl/libgl-headers/Config.in" source "package/opengl/libegl/Config.in" source "package/opengl/libgles/Config.in" source "package/opengl/libopencl/Config.in"
package/opengl/libgl-headers/Config.in new file +6 -0
@@ -0,0 +1,6 @@ +config BR2_PACKAGE_HAS_LIBGL_HEADERS + bool + +config BR2_PACKAGE_PROVIDES_LIBGL_HEADERS + string + depends on BR2_PACKAGE_HAS_LIBGL_HEADERS
package/opengl/libgl-headers/libgl-headers.mk new file +7 -0
@@ -0,0 +1,7 @@ +################################################################################ +# +# libgl-headers +# +################################################################################ + +$(eval $(virtual-package))
Signature · 38 lines
2.26.2 -- CONFIDENTIALITY NOTICE ------------------------------------ This E-mail is intended only to be read or used by the addressee.The information contained in this E-mail message may be confidential information. If you are not the intended recipient, any use, interference with, distribution, disclosure or copying of this material is unauthorized and prohibited. Confidentiality attached to this communication is not waived or lost by reason of the mistaken delivery to you. If you have received this message in error, please delete it and notify us by return E-mail or telephone NOVOMATIC Technologies Poland S.A. +48 12 258 00 50. Any E-mail attachment may contain software viruses which could damage your own computer system. Whilst reasonable precaution has been taken to minimize this risk, we cannot accept liability for any damage which you sustain as a result of software viruses. You should therefore carry out your own virus checks before opening any attachments. ------------------------------------ NOVOMATIC Technologies Poland S.A., Poland, Krakowska 368, 32-080 Zabierz?w
PATCH 2/6 package/mesa3d-headers: make it a provider for libgl-headers
This is the first - and most obvious - provider for GL API headers. Should work as usual, transparently for any package requirung it, used mostly where Mesa itself can't be installed.
--- package/mesa3d-headers/Config.in | 7 +++++++ package/mesa3d-headers/mesa3d-headers.mk | 1 + 2 files changed, 8 insertions(+)
package/mesa3d-headers/Config.in +7 -0
@@ -7,3 +7,10 @@ config BR2_PACKAGE_MESA3D_HEADERS This package only installs headers needed by other packages. http://mesa3d.org + +if BR2_PACKAGE_MESA3D_HEADERS + +config BR2_PACKAGE_PROVIDES_LIBGL_HEADERS + default "mesa3d-headers" + +endif
package/mesa3d-headers/mesa3d-headers.mk +1 -0
@@ -18,6 +18,7 @@ MESA3D_HEADERS_SITE = https://mesa.freedesktop.org/archive MESA3D_HEADERS_DL_SUBDIR = mesa3d MESA3D_HEADERS_LICENSE = MIT, SGI, Khronos MESA3D_HEADERS_LICENSE_FILES = docs/license.html +MESA3D_HEADERS_PROVIDES = libgl-headers # Only installs header files MESA3D_HEADERS_INSTALL_STAGING = YES
Signature · 38 lines
2.26.2 -- CONFIDENTIALITY NOTICE ------------------------------------ This E-mail is intended only to be read or used by the addressee.The information contained in this E-mail message may be confidential information. If you are not the intended recipient, any use, interference with, distribution, disclosure or copying of this material is unauthorized and prohibited. Confidentiality attached to this communication is not waived or lost by reason of the mistaken delivery to you. If you have received this message in error, please delete it and notify us by return E-mail or telephone NOVOMATIC Technologies Poland S.A. +48 12 258 00 50. Any E-mail attachment may contain software viruses which could damage your own computer system. Whilst reasonable precaution has been taken to minimize this risk, we cannot accept liability for any damage which you sustain as a result of software viruses. You should therefore carry out your own virus checks before opening any attachments. ------------------------------------ NOVOMATIC Technologies Poland S.A., Poland, Krakowska 368, 32-080 Zabierz?w
PATCH 3/6 package/libglvnd: new package
In reply to Jakub SkrzypnikThis is libglvnd, an GL Vendor-Neutral-Dispatcher.
It allows us to have more than one GL provider on the running system, mostly for x86 images which can be applied to various boards with different GPUs, but might be also used on ARM for example, as long as proprietary vendor GL providers comply to this standard.
Currently, it's used by Mesa and NVIDIA, but there are some efforts on other projects like RaspberryPi VideoCore or i.MX Vivante/Etnaviv GPUs.
It delivers own copy of OpenGL/EGL headers and technically works as a "dispatcher" residing in libraries: libGLX.so, libGL.so, libOpenGL.so, libEGL*.so, etc.
If there's a call on them, it's forwarded to chosen provider, for example libGL_mesa.so when Mesa is chosen.
The provider selection on X11 is done by talking to GLX extension, on systems using OpenGLES it's done in the same way as Vulkan or OpenCL providers are - by ICD definitions, provided by them.
--- package/Config.in | 1 + package/libglvnd/Config.in | 21 +++++++++++++++++++++ package/libglvnd/libglvnd.hash | 1 + package/libglvnd/libglvnd.mk | 19 +++++++++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 package/libglvnd/Config.in create mode 100644 package/libglvnd/libglvnd.hash create mode 100644 package/libglvnd/libglvnd.mk
package/Config.in +1 -0
@@ -311,6 +311,7 @@ comment "Graphic libraries" source "package/imagemagick/Config.in" source "package/linux-fusion/Config.in" source "package/lite/Config.in" + source "package/libglvnd/Config.in" source "package/mesa3d/Config.in" source "package/mesa3d-headers/Config.in" source "package/ocrad/Config.in"
package/libglvnd/Config.in new file +21 -0
@@ -0,0 +1,21 @@ +config BR2_PACKAGE_LIBGLVND + bool "libglvnd" + select BR2_PACKAGE_XLIB_LIBXEXT + select BR2_PACKAGE_XLIB_LIBX11 + select BR2_PACKAGE_XLIB_XORGPROTO + +if BR2_PACKAGE_LIBGLVND + +config BR2_PACKAGE_PROVIDES_LIBGL_HEADERS + default "libglvnd" + +config BR2_PACKAGE_PROVIDES_LIBGL + default "libglvnd" + +config BR2_PACKAGE_PROVIDES_LIBGLES + default "libglvnd" + +config BR2_PACKAGE_PROVIDES_LIBEGL + default "libglvnd" + +endif
package/libglvnd/libglvnd.hash new file +1 -0
@@ -0,0 +1 @@ +sha256 b26c931ff79feced0d1ac69332797a08427308fa85541282ee9995680c880b24 libglvnd-v1.3.1.tar.gz
package/libglvnd/libglvnd.mk new file +19 -0
@@ -0,0 +1,19 @@ +################################################################################ +# +# libglvnd +# +################################################################################ + +LIBGLVND_VERSION = 1.3.1 +LIBGLVND_SOURCE = libglvnd-v$(LIBGLVND_VERSION).tar.gz +LIBGLVND_SITE = https://gitlab.freedesktop.org/glvnd/libglvnd/-/archive/v$(LIBGLVND_VERSION) +LIBGLVND_LICENSE = MIT +LIBGLVND_LICENSE_FILES = LICENSE +LIBGLVND_INSTALL_STAGING = YES +LIBGLVND_PROVIDES = libgl-headers libgl libgles libegl +LIBGLVND_DEPENDENCIES = \ + xlib_libX11 \ + xlib_libXext \ + xorgproto + +$(eval $(meson-package))
Signature · 38 lines
2.26.2 -- CONFIDENTIALITY NOTICE ------------------------------------ This E-mail is intended only to be read or used by the addressee.The information contained in this E-mail message may be confidential information. If you are not the intended recipient, any use, interference with, distribution, disclosure or copying of this material is unauthorized and prohibited. Confidentiality attached to this communication is not waived or lost by reason of the mistaken delivery to you. If you have received this message in error, please delete it and notify us by return E-mail or telephone NOVOMATIC Technologies Poland S.A. +48 12 258 00 50. Any E-mail attachment may contain software viruses which could damage your own computer system. Whilst reasonable precaution has been taken to minimize this risk, we cannot accept liability for any damage which you sustain as a result of software viruses. You should therefore carry out your own virus checks before opening any attachments. ------------------------------------ NOVOMATIC Technologies Poland S.A., Poland, Krakowska 368, 32-080 Zabierz?w
PATCH 4/6 package/mesa3d: make it aware of libglvnd and support it when present
In reply to Jakub SkrzypnikMesa is the first GLVND provider and supports it natively when being configured with -Dglvnd=true option.
To not break existing way of operation, its compatibility is enabled only when BR2_PACKAGE_LIBGLVND is selected.
--- package/mesa3d/Config.in | 2 ++ package/mesa3d/mesa3d.mk | 9 +++++++++ 2 files changed, 11 insertions(+)
package/mesa3d/Config.in +2 -0
@@ -442,6 +442,7 @@ config BR2_PACKAGE_MESA3D_OPENGL_ES endif # BR2_PACKAGE_MESA3D_DRIVER +if !BR2_PACKAGE_LIBGLVND config BR2_PACKAGE_PROVIDES_LIBGL default "mesa3d" if BR2_PACKAGE_MESA3D_OPENGL_GLX
@@ -450,6 +451,7 @@ config BR2_PACKAGE_PROVIDES_LIBEGL config BR2_PACKAGE_PROVIDES_LIBGLES default "mesa3d" if BR2_PACKAGE_MESA3D_OPENGL_ES +endif config BR2_PACKAGE_PROVIDES_LIBOPENCL default "mesa3d" if BR2_PACKAGE_MESA3D_OPENCL
package/mesa3d/mesa3d.mk +9 -0
@@ -50,6 +50,8 @@ ifeq ($(BR2_PACKAGE_MESA3D_NEEDS_ELFUTILS),y) MESA3D_DEPENDENCIES += elfutils endif + + ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_GLX),y) # Disable-mangling not yet supported by meson build system. # glx:
@@ -275,4 +277,11 @@ else MESA3D_CONF_OPTS += -Dzstd=false endif +ifeq ($(BR2_PACKAGE_LIBGLVND),y) +MESA3D_DEPENDENCIES += libglvnd +MESA3D_CONF_OPTS += -Dglvnd=true +MESA3D_WITH_GLVND_PROVIDES = $(filter-out libgl libegl libgles,$(MESA3D_PROVIDES)) +MESA3D_PROVIDES := $(MESA3D_WITH_GLVND_PROVIDES) +endif + $(eval $(meson-package))
Signature · 38 lines
2.26.2 -- CONFIDENTIALITY NOTICE ------------------------------------ This E-mail is intended only to be read or used by the addressee.The information contained in this E-mail message may be confidential information. If you are not the intended recipient, any use, interference with, distribution, disclosure or copying of this material is unauthorized and prohibited. Confidentiality attached to this communication is not waived or lost by reason of the mistaken delivery to you. If you have received this message in error, please delete it and notify us by return E-mail or telephone NOVOMATIC Technologies Poland S.A. +48 12 258 00 50. Any E-mail attachment may contain software viruses which could damage your own computer system. Whilst reasonable precaution has been taken to minimize this risk, we cannot accept liability for any damage which you sustain as a result of software viruses. You should therefore carry out your own virus checks before opening any attachments. ------------------------------------ NOVOMATIC Technologies Poland S.A., Poland, Krakowska 368, 32-080 Zabierz?w
PATCH 5/6 package/x11r7/xserver_xorg-server: disable GLAMOR support with NVIDIA drivers
In reply to Jakub SkrzypnikNVIDIA GLX extension doesn't support GLAMOR and won't let compile X11 server.
Even if there's libglvnd enabled and you have Mesa together with it, running X11 with GLAMOR enabled will crash on loading NVIDIA's own GLX extension.
--- package/x11r7/xserver_xorg-server/xserver_xorg-server.mk | 4 ++++ 1 file changed, 4 insertions(+)
package/x11r7/xserver_xorg-server/xserver_xorg-server.mk +4 -0
@@ -191,7 +191,11 @@ XSERVER_XORG_SERVER_DEPENDENCIES += xlib_libxshmfence XSERVER_XORG_SERVER_CONF_OPTS += --enable-dri3 ifeq ($(BR2_PACKAGE_HAS_LIBEGL)$(BR2_PACKAGE_HAS_LIBGL)$(BR2_PACKAGE_LIBEPOXY),yyy) XSERVER_XORG_SERVER_DEPENDENCIES += libepoxy +ifeq ($(BR2_PACKAGE_NVIDIA_DRIVER_XORG),y) +XSERVER_XORG_SERVER_CONF_OPTS += --disable-glamor +else XSERVER_XORG_SERVER_CONF_OPTS += --enable-glamor +endif else XSERVER_XORG_SERVER_CONF_OPTS += --disable-glamor endif
Signature · 38 lines
2.26.2 -- CONFIDENTIALITY NOTICE ------------------------------------ This E-mail is intended only to be read or used by the addressee.The information contained in this E-mail message may be confidential information. If you are not the intended recipient, any use, interference with, distribution, disclosure or copying of this material is unauthorized and prohibited. Confidentiality attached to this communication is not waived or lost by reason of the mistaken delivery to you. If you have received this message in error, please delete it and notify us by return E-mail or telephone NOVOMATIC Technologies Poland S.A. +48 12 258 00 50. Any E-mail attachment may contain software viruses which could damage your own computer system. Whilst reasonable precaution has been taken to minimize this risk, we cannot accept liability for any damage which you sustain as a result of software viruses. You should therefore carry out your own virus checks before opening any attachments. ------------------------------------ NOVOMATIC Technologies Poland S.A., Poland, Krakowska 368, 32-080 Zabierz?w
PATCH 6/6 package/nvidia-driver: update to 390.132, 435.21, 440.82
In reply to Jakub SkrzypnikUpdate NVIDIA to latest version of 390.xx branch (so called "legacy").
This is the last branch supporting i386.
Additionaly, there's an option to select "long-lived" and "short-lived" version branches for newer NVIDIA drivers.
The installation workflow was redone to make it less complex and support multiple versions, specified symlinks and so on.
On x86_64, a no-compat32 binaries are downloaded to avoid cluttering build environment with multilib support.
Now requires libglvnd as it already was "stealthly" delivered by NVIDIA in its software bundle without being notived.
On the longer term, this Makefile should use ".manifest" from installation binary, but dealing with it without nvidia-installer is very comples, leads to various problems and has a lot of edge-cases resolved in the installer on its own.
--- .../390.132/0001-kernel-416.patch | 33 + .../390.132/0002-kernel-55.patch | 1286 +++++++++++++++++ .../390.132/0003-kernel-56.patch | 415 ++++++ .../435.21/0001-kernel-5.4.patch | 142 ++ package/nvidia-driver/Config.in | 61 +- package/nvidia-driver/egl.pc | 10 - package/nvidia-driver/gl.pc | 11 - package/nvidia-driver/nvidia-driver.hash | 6 +- package/nvidia-driver/nvidia-driver.mk | 366 +++-- 9 files changed, 2145 insertions(+), 185 deletions(-) create mode 100644 package/nvidia-driver/390.132/0001-kernel-416.patch create mode 100644 package/nvidia-driver/390.132/0002-kernel-55.patch create mode 100644 package/nvidia-driver/390.132/0003-kernel-56.patch create mode 100644 package/nvidia-driver/435.21/0001-kernel-5.4.patch delete mode 100644 package/nvidia-driver/egl.pc delete mode 100644 package/nvidia-driver/gl.pc
package/nvidia-driver/390.132/0001-kernel-416.patch new file +33 -0
@@ -0,0 +1,33 @@ +diff --git a/kernel/common/inc/nv-linux.h b/kernel/common/inc/nv-linux.h +index 10fc418..22ef968 100644 +--- a/kernel/common/inc/nv-linux.h ++++ b/kernel/common/inc/nv-linux.h +@@ -175,7 +175,11 @@ static inline uid_t __kuid_val(kuid_t uid) + + #if defined(NV_VM_INSERT_PAGE_PRESENT) + #include <linux/pagemap.h> ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0) + #include <linux/dma-mapping.h> ++#else ++#include <linux/dma-direct.h> ++#endif + #endif + + #if defined(CONFIG_SWIOTLB) && defined(NVCPU_AARCH64) +diff --git a/kernel/conftest.sh b/kernel/conftest.sh +index b23dbb4..42dc576 100755 +--- a/kernel/conftest.sh ++++ b/kernel/conftest.sh +@@ -1906,7 +1906,12 @@ compile_test() { + # Determine if the phys_to_dma function is present. + # + CODE=" ++ #include <linux/version.h> ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0) + #include <linux/dma-mapping.h> ++#else ++ #include <linux/dma-direct.h> ++#endif + void conftest_phys_to_dma(void) { + phys_to_dma(); + }"
package/nvidia-driver/390.132/0002-kernel-55.patch new file +1286 -0
1,286 lines not on this page · raw message
package/nvidia-driver/390.132/0003-kernel-56.patch new file +415 -0
415 lines not on this page · raw message
package/nvidia-driver/435.21/0001-kernel-5.4.patch new file +142 -0
142 lines not on this page · raw message
package/nvidia-driver/Config.in +32 -29
82 lines not on this page · raw message
package/nvidia-driver/egl.pc deleted +0 -10
@@ -1,10 +0,0 @@ -prefix=/usr -exec_prefix=${prefix} -libdir=${exec_prefix}/lib -includedir=${prefix}/include - -Name: egl -Description: Nvidia OpenGL library -Version: 1 -Cflags: -I${includedir} -Libs: -L${libdir} -lEGL
package/nvidia-driver/gl.pc deleted +0 -11
@@ -1,11 +0,0 @@ -prefix=/usr -exec_prefix=${prefix} -libdir=${exec_prefix}/lib -includedir=${prefix}/include - -Name: gl -Description: Nvidia OpenGL library -Version: 10.4.2 -Libs: -L${libdir} -lGL -lm -lXext -lX11 -ldl -Cflags: -I${includedir} -DEGL_NO_X11 -glx_tls: no
package/nvidia-driver/nvidia-driver.hash +4 -2
@@ -1,4 +1,6 @@ # Locally computed -sha256 6f4af70ee3d03ed31c497a5d555164c56057b53ecedfc0d2c8de4b0b90728805 NVIDIA-Linux-x86-390.67.run -sha256 6df2ca1a7420b6751bcaf257d321b14f4e5f7ca54d77a43514912a3792ece65a NVIDIA-Linux-x86_64-390.67.run +sha256 51adb28f0ed4548f35a88a93ad6767ebd807fa14f418bf5e51a6d63a3ff7f275 NVIDIA-Linux-x86-390.132.run +sha256 caee54f0ee5f6171a61b25670d309d1abe16d59fc7bec0577794b1a52c09244a NVIDIA-Linux-x86_64-435.21-no-compat32.run +sha256 89feda0c3e54c9c0d0528760bbb5cf4d8e57408fb3df2728653f3a1b73c110a9 NVIDIA-Linux-x86_64-440.82-no-compat32.run +sha256 b6b4b8af37e78e026c9ebdf4a5c64ea412dfcb710931dd028c22dac228de659d NVIDIA-Linux-x86_64-390.132-no-compat32.run sha256 bd28b0c5aeeb00eb11d3ec6f6f3449d4b3a40100914258332734a53527997526 LICENSE
package/nvidia-driver/nvidia-driver.mk +233 -133
405 lines not on this page · raw message
Signature · 38 lines
2.26.2 -- CONFIDENTIALITY NOTICE ------------------------------------ This E-mail is intended only to be read or used by the addressee.The information contained in this E-mail message may be confidential information. If you are not the intended recipient, any use, interference with, distribution, disclosure or copying of this material is unauthorized and prohibited. Confidentiality attached to this communication is not waived or lost by reason of the mistaken delivery to you. If you have received this message in error, please delete it and notify us by return E-mail or telephone NOVOMATIC Technologies Poland S.A. +48 12 258 00 50. Any E-mail attachment may contain software viruses which could damage your own computer system. Whilst reasonable precaution has been taken to minimize this risk, we cannot accept liability for any damage which you sustain as a result of software viruses. You should therefore carry out your own virus checks before opening any attachments. ------------------------------------ NOVOMATIC Technologies Poland S.A., Poland, Krakowska 368, 32-080 Zabierz?w
PATCH 1/6 package/libgl-headers: introduce as a new virtual package for providers of OpenGL-compatible headers
In reply to Jakub SkrzypnikJakub, All,
On 2020-05-12 15:28 +0200, Jakub Skrzypnik spake thusly:
Quoted 8 lines
Currently, there can be more than one provider of OpenGL/EGL API headers (
GL/gl.h, etc.)These are usually the same everywhere, as there are universal (as universal OpenGL is) but to avoid excessive patching and dependency mangling, a virtual package "libgl-headers" was born to provide these generic API headers.
Not to confuse with private Mesa headers or other vendor-specific stuff, but these are always in different header files.
I don't think we need this libgl-headers package.
Instead, let's handle this like we handle the GL provider selection when libglvnd is enabled. For example, in nvidia-driver, you'd do something like:
select BR2_PACKAGE_MESA3D_HEADERS if !BR2_PACKAGE_LIBGLVND
So, patches 1 and 2 in this series should be dropped, and the rest of the series adapted accoridngly.
Regards,
Yann E. MORIN.
Quoted 83 lines
Signed-off-by Jakub Skrzypnik <[email protected]>--- package/opengl/Config.in | 1 + package/opengl/libgl-headers/Config.in | 6 ++++++ package/opengl/libgl-headers/libgl-headers.mk | 7 +++++++ 3 files changed, 14 insertions(+) create mode 100644 package/opengl/libgl-headers/Config.in create mode 100644 package/opengl/libgl-headers/libgl-headers.mkpackage/opengl/Config.in +1
-0@@ -1,4 +1,5 @@ source "package/opengl/libgl/Config.in" +source "package/opengl/libgl-headers/Config.in" source "package/opengl/libegl/Config.in" source "package/opengl/libgles/Config.in" source "package/opengl/libopencl/Config.in"package/opengl/libgl-headers/Config.in new file +6
-0@@ -0,0 +1,6 @@ +config BR2_PACKAGE_HAS_LIBGL_HEADERS + bool + +config BR2_PACKAGE_PROVIDES_LIBGL_HEADERS + string + depends on BR2_PACKAGE_HAS_LIBGL_HEADERSpackage/opengl/libgl-headers/libgl-headers.mk new file +7
-0@@ -0,0 +1,7 @@ +################################################################################ +# +# libgl-headers +# +################################################################################ + +$(eval $(virtual-package))Signature · 38 lines
2.26.2 -- CONFIDENTIALITY NOTICE ------------------------------------ This E-mail is intended only to be read or used by the addressee.The information contained in this E-mail message may be confidential information. If you are not the intended recipient, any use, interference with, distribution, disclosure or copying of this material is unauthorized and prohibited. Confidentiality attached to this communication is not waived or lost by reason of the mistaken delivery to you. If you have received this message in error, please delete it and notify us by return E-mail or telephone NOVOMATIC Technologies Poland S.A. +48 12 258 00 50. Any E-mail attachment may contain software viruses which could damage your own computer system. Whilst reasonable precaution has been taken to minimize this risk, we cannot accept liability for any damage which you sustain as a result of software viruses. You should therefore carry out your own virus checks before opening any attachments. ------------------------------------ NOVOMATIC Technologies Poland S.A., Poland, Krakowska 368, 32-080 Zabierz?w
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
v2 cover Initial GLVND support + NVIDIA drivers upgrade
In reply to Jakub SkrzypnikHello everyone!
This set of patches went a wild ride within last couple of weeks, being tested and revised at least a few times, but in this form they're ready to be reviewed I think.
They are related to two important tings I'd like to explain and discuss here:
* Firstly, here comes support for GLVND which is a GL Vendor-Neutral disaptches, initially proposed by NVIDIA, currently done within the Freedestop/RedHat project team as libglvnd.
It's useful not only for NVIDIA (they were first to adopt it though) but might be also beneficial for others, for example allowing you to deliver an image running on multiple machines with different GPUs and their respective OpenGL providers, which happens quite often on x86_64 and was the major reason to implement it in Buildroot for me.
On the other hand, if your board has multiple GPUs it also helps a lot - for example when you have a "display" unit and "compute/accel" graphics units from different vendors. Happens on some ARM boards recently and there are already efforts to integrate it in these GL stacks.
The only EXT needed by GL provider is to implement GL_EXT_libglvnd which is a dummy extension allowing GL lib to "register" to let it receive GL calls.
Currently it's supported by all Mesa-compatible drivers and NVIDIA
In practive it's very simple, the libglvnd delivers its own set of "dummy" libraries:
- libGL.so
- libGLX.so
- libOpenGL.so
- libEGL.so
and needs the actual providers to be present as they already are but with names like libGLX_nvidia.so.
It allows developers to link against vendor-neutral dummy libs and open GL contexts without thinking about target GPU too much as long as it supports desired GL/EGL standard.
Also delivers GL API headers (GL/gl.h, GL/egl.h, etc.) so removes need of mesa3d-headers in GLVND-supported drivers.
If any other proprietary GL provider beyond Mesa and NVIDIA gets support for it, I'll happily adopt its definition in Buildroot.
Mesa has glvnd suppoort when there's "-Dglvnd=true" switch in its build config, which gets enabled when you select libglvnd as package or any other pkg supporting it.
* The second one is to update NVIDIA from old 390-series release to 390.132 which is a current one in "legacy" branch, and to introduce the concept of "version branches" witizn its Buildroot package:
- "legacy" (390.xx) - it's what we currently have, the last version supporting i386 (which is adjusted properly in makefile/kconfig) yet still needed as supporting older cards
- "long lived" (43x.xx) - will be chosen by default, supports both i386 and x86_64, has support for majority of GPUs but doesn't get ad-hoc performance fixes
- "short lived" (440.xx) - the "bleeding edge" branch but not that much, first to support RTX raytracing cards as well as fixes from independent developers complaining about NVIDIA performance
Selecting the version might help adjust your build to the specific requirements of the application running on your image.
Also, the nvidia-driver got hard dependency on libglvnd. NVIDIA did a weird trick bundling the libglvnd already in their builds but without any notice, hiding it inside libraries. In general it's advised to run against the upstream implementation and works fine there.
The controversal question might be why I didn't used "manifests" from NVIDIA installer as Makefile inputs and did the "library list" on my own. This manner was thoroughly discussed on IRC at least a few times so I'll just put some points here without elaborating on them too much:
- it's not reliable, the format is made to be understood only by nvidia-installer
- there are some quirks in installer itself to deal with files in way not directly exposed by manifests
- not all "modules" are defined correctly and not every "file class" is whatt always it says, making the input painful to parse
- in general, we might succeed with it (and the problem might be approached next time for sure) but doing all the workarounds and hacks for each module/lib won't make the Makefile easier
- not all libraries (for example the libglxserver) are even SONAMEd so we can't symlink them "smart" so I did list of manual symlinks for them.
I hope these patches will get positively reviewed and merged, because these are my first contributions to Buildroot and while they don't really look so complicated, it took me a considerable amount of time to actually prepare them within the rules and style of Buildroot, also getting me a solid re-introduction to Makefile after a few years ;)
With regards,
Kuba
Jakub Skrzypnik (4):
package/libglvnd: new package
package/mesa3d: make it aware of libglvnd and support it when present package/x11r7/xserver_xorg-server: disable GLAMOR support with NVIDIA
drivers
package/nvidia-driver: update to 390.132, 435.21, 440.82
package/Config.in | 1 + package/libglvnd/Config.in | 18 + package/libglvnd/libglvnd.hash | 1 + package/libglvnd/libglvnd.mk | 19 + package/mesa3d/Config.in | 2 + package/mesa3d/mesa3d.mk | 9 + .../390.132/0001-kernel-416.patch | 33 + .../390.132/0002-kernel-55.patch | 1286 +++++++++++++++++ .../390.132/0003-kernel-56.patch | 415 ++++++ .../435.21/0001-kernel-5.4.patch | 142 ++ package/nvidia-driver/Config.in | 60 +- package/nvidia-driver/egl.pc | 10 - package/nvidia-driver/gl.pc | 11 - package/nvidia-driver/nvidia-driver.hash | 7 +- package/nvidia-driver/nvidia-driver.mk | 366 +++-- .../xserver_xorg-server.mk | 4 + 16 files changed, 2199 insertions(+), 185 deletions(-) create mode 100644 package/libglvnd/Config.in create mode 100644 package/libglvnd/libglvnd.hash create mode 100644 package/libglvnd/libglvnd.mk create mode 100644 package/nvidia-driver/390.132/0001-kernel-416.patch create mode 100644 package/nvidia-driver/390.132/0002-kernel-55.patch create mode 100644 package/nvidia-driver/390.132/0003-kernel-56.patch create mode 100644 package/nvidia-driver/435.21/0001-kernel-5.4.patch delete mode 100644 package/nvidia-driver/egl.pc delete mode 100644 package/nvidia-driver/gl.pc
Signature · 38 lines
Changes v1 -> v2: - removed redundant libgl-headers virtual pkg (suggested by y_morin) -- CONFIDENTIALITY NOTICE ------------------------------------ This E-mail is intended only to be read or used by the addressee.The information contained in this E-mail message may be confidential information. If you are not the intended recipient, any use, interference with, distribution, disclosure or copying of this material is unauthorized and prohibited. Confidentiality attached to this communication is not waived or lost by reason of the mistaken delivery to you. If you have received this message in error, please delete it and notify us by return E-mail or telephone NOVOMATIC Technologies Poland S.A. +48 12 258 00 50. Any E-mail attachment may contain software viruses which could damage your own computer system. Whilst reasonable precaution has been taken to minimize this risk, we cannot accept liability for any damage which you sustain as a result of software viruses. You should therefore carry out your own virus checks before opening any attachments. ------------------------------------ NOVOMATIC Technologies Poland S.A., Poland, Krakowska 368, 32-080 Zabierz?w
PATCH v2 1/4 package/libglvnd: new package
--- package/Config.in | 1 + package/libglvnd/Config.in | 18 ++++++++++++++++++ package/libglvnd/libglvnd.hash | 1 + package/libglvnd/libglvnd.mk | 19 +++++++++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 package/libglvnd/Config.in create mode 100644 package/libglvnd/libglvnd.hash create mode 100644 package/libglvnd/libglvnd.mk
package/Config.in +1 -0
@@ -311,6 +311,7 @@ comment "Graphic libraries" source "package/imagemagick/Config.in" source "package/linux-fusion/Config.in" source "package/lite/Config.in" + source "package/libglvnd/Config.in" source "package/mesa3d/Config.in" source "package/mesa3d-headers/Config.in" source "package/ocrad/Config.in"
package/libglvnd/Config.in new file +18 -0
@@ -0,0 +1,18 @@ +config BR2_PACKAGE_LIBGLVND + bool "libglvnd" + select BR2_PACKAGE_XLIB_LIBXEXT + select BR2_PACKAGE_XLIB_LIBX11 + select BR2_PACKAGE_XLIB_XORGPROTO + +if BR2_PACKAGE_LIBGLVND + +config BR2_PACKAGE_PROVIDES_LIBGL + default "libglvnd" + +config BR2_PACKAGE_PROVIDES_LIBGLES + default "libglvnd" + +config BR2_PACKAGE_PROVIDES_LIBEGL + default "libglvnd" + +endif
package/libglvnd/libglvnd.hash new file +1 -0
@@ -0,0 +1 @@ +sha256 b26c931ff79feced0d1ac69332797a08427308fa85541282ee9995680c880b24 libglvnd-v1.3.1.tar.gz
package/libglvnd/libglvnd.mk new file +19 -0
@@ -0,0 +1,19 @@ +################################################################################ +# +# libglvnd +# +################################################################################ + +LIBGLVND_VERSION = 1.3.1 +LIBGLVND_SOURCE = libglvnd-v$(LIBGLVND_VERSION).tar.gz +LIBGLVND_SITE = https://gitlab.freedesktop.org/glvnd/libglvnd/-/archive/v$(LIBGLVND_VERSION) +LIBGLVND_LICENSE = MIT +LIBGLVND_LICENSE_FILES = LICENSE +LIBGLVND_INSTALL_STAGING = YES +LIBGLVND_PROVIDES = libgl libgles libegl +LIBGLVND_DEPENDENCIES = \ + xlib_libX11 \ + xlib_libXext \ + xorgproto + +$(eval $(meson-package))
Signature · 38 lines
2.26.2 -- CONFIDENTIALITY NOTICE ------------------------------------ This E-mail is intended only to be read or used by the addressee.The information contained in this E-mail message may be confidential information. If you are not the intended recipient, any use, interference with, distribution, disclosure or copying of this material is unauthorized and prohibited. Confidentiality attached to this communication is not waived or lost by reason of the mistaken delivery to you. If you have received this message in error, please delete it and notify us by return E-mail or telephone NOVOMATIC Technologies Poland S.A. +48 12 258 00 50. Any E-mail attachment may contain software viruses which could damage your own computer system. Whilst reasonable precaution has been taken to minimize this risk, we cannot accept liability for any damage which you sustain as a result of software viruses. You should therefore carry out your own virus checks before opening any attachments. ------------------------------------ NOVOMATIC Technologies Poland S.A., Poland, Krakowska 368, 32-080 Zabierz?w
PATCH v2 2/4 package/mesa3d: make it aware of libglvnd and support it when present
In reply to Jakub Skrzypnik--- package/mesa3d/Config.in | 2 ++ package/mesa3d/mesa3d.mk | 9 +++++++++ 2 files changed, 11 insertions(+)
package/mesa3d/Config.in +2 -0
@@ -442,6 +442,7 @@ config BR2_PACKAGE_MESA3D_OPENGL_ES endif # BR2_PACKAGE_MESA3D_DRIVER +if !BR2_PACKAGE_LIBGLVND config BR2_PACKAGE_PROVIDES_LIBGL default "mesa3d" if BR2_PACKAGE_MESA3D_OPENGL_GLX
@@ -450,6 +451,7 @@ config BR2_PACKAGE_PROVIDES_LIBEGL config BR2_PACKAGE_PROVIDES_LIBGLES default "mesa3d" if BR2_PACKAGE_MESA3D_OPENGL_ES +endif config BR2_PACKAGE_PROVIDES_LIBOPENCL default "mesa3d" if BR2_PACKAGE_MESA3D_OPENCL
package/mesa3d/mesa3d.mk +9 -0
@@ -50,6 +50,8 @@ ifeq ($(BR2_PACKAGE_MESA3D_NEEDS_ELFUTILS),y) MESA3D_DEPENDENCIES += elfutils endif + + ifeq ($(BR2_PACKAGE_MESA3D_OPENGL_GLX),y) # Disable-mangling not yet supported by meson build system. # glx:
@@ -275,4 +277,11 @@ else MESA3D_CONF_OPTS += -Dzstd=false endif +ifeq ($(BR2_PACKAGE_LIBGLVND),y) +MESA3D_DEPENDENCIES += libglvnd +MESA3D_CONF_OPTS += -Dglvnd=true +MESA3D_WITH_GLVND_PROVIDES = $(filter-out libgl libegl libgles,$(MESA3D_PROVIDES)) +MESA3D_PROVIDES := $(MESA3D_WITH_GLVND_PROVIDES) +endif + $(eval $(meson-package))
Signature · 38 lines
2.26.2 -- CONFIDENTIALITY NOTICE ------------------------------------ This E-mail is intended only to be read or used by the addressee.The information contained in this E-mail message may be confidential information. If you are not the intended recipient, any use, interference with, distribution, disclosure or copying of this material is unauthorized and prohibited. Confidentiality attached to this communication is not waived or lost by reason of the mistaken delivery to you. If you have received this message in error, please delete it and notify us by return E-mail or telephone NOVOMATIC Technologies Poland S.A. +48 12 258 00 50. Any E-mail attachment may contain software viruses which could damage your own computer system. Whilst reasonable precaution has been taken to minimize this risk, we cannot accept liability for any damage which you sustain as a result of software viruses. You should therefore carry out your own virus checks before opening any attachments. ------------------------------------ NOVOMATIC Technologies Poland S.A., Poland, Krakowska 368, 32-080 Zabierz?w
PATCH v2 3/4 package/x11r7/xserver_xorg-server: disable GLAMOR support with NVIDIA drivers
In reply to Jakub Skrzypnik--- package/x11r7/xserver_xorg-server/xserver_xorg-server.mk | 4 ++++ 1 file changed, 4 insertions(+)
package/x11r7/xserver_xorg-server/xserver_xorg-server.mk +4 -0
@@ -191,7 +191,11 @@ XSERVER_XORG_SERVER_DEPENDENCIES += xlib_libxshmfence XSERVER_XORG_SERVER_CONF_OPTS += --enable-dri3 ifeq ($(BR2_PACKAGE_HAS_LIBEGL)$(BR2_PACKAGE_HAS_LIBGL)$(BR2_PACKAGE_LIBEPOXY),yyy) XSERVER_XORG_SERVER_DEPENDENCIES += libepoxy +ifeq ($(BR2_PACKAGE_NVIDIA_DRIVER_XORG),y) +XSERVER_XORG_SERVER_CONF_OPTS += --disable-glamor +else XSERVER_XORG_SERVER_CONF_OPTS += --enable-glamor +endif else XSERVER_XORG_SERVER_CONF_OPTS += --disable-glamor endif
Signature · 38 lines
2.26.2 -- CONFIDENTIALITY NOTICE ------------------------------------ This E-mail is intended only to be read or used by the addressee.The information contained in this E-mail message may be confidential information. If you are not the intended recipient, any use, interference with, distribution, disclosure or copying of this material is unauthorized and prohibited. Confidentiality attached to this communication is not waived or lost by reason of the mistaken delivery to you. If you have received this message in error, please delete it and notify us by return E-mail or telephone NOVOMATIC Technologies Poland S.A. +48 12 258 00 50. Any E-mail attachment may contain software viruses which could damage your own computer system. Whilst reasonable precaution has been taken to minimize this risk, we cannot accept liability for any damage which you sustain as a result of software viruses. You should therefore carry out your own virus checks before opening any attachments. ------------------------------------ NOVOMATIC Technologies Poland S.A., Poland, Krakowska 368, 32-080 Zabierz?w
PATCH v2 3/4 package/x11r7/xserver_xorg-server: disable GLAMOR support with NVIDIA drivers
Jakub, Bernd, All,
On 2020-05-17 22:40 +0200, Jakub Skrzypnik spake thusly:
Quoted 1 line
Signed-off-by Jakub Skrzypnik <[email protected]>
Jakub: this patch needs a commit message that explains why we need to disable glamor.
Bernd: you've hacked the Xorg stack quite extensively; do you have an opinion on this?
Note that his change is totally decorelated from the libglvnd efforts in this series (I guess Jakub has the issue while working on the nvidia driver, the reason why this patch is here...)
Regards,
Yann E. MORIN.
Quoted 59 lines
--- package/x11r7/xserver_xorg-server/xserver_xorg-server.mk | 4 ++++ 1 file changed, 4 insertions(+)package/x11r7/xserver_xorg-server/xserver_xorg-server.mk +4
-0@@ -191,7 +191,11 @@ XSERVER_XORG_SERVER_DEPENDENCIES += xlib_libxshmfence XSERVER_XORG_SERVER_CONF_OPTS += --enable-dri3 ifeq ($(BR2_PACKAGE_HAS_LIBEGL)$(BR2_PACKAGE_HAS_LIBGL)$(BR2_PACKAGE_LIBEPOXY),yyy) XSERVER_XORG_SERVER_DEPENDENCIES += libepoxy +ifeq ($(BR2_PACKAGE_NVIDIA_DRIVER_XORG),y) +XSERVER_XORG_SERVER_CONF_OPTS += --disable-glamor +else XSERVER_XORG_SERVER_CONF_OPTS += --enable-glamor +endif else XSERVER_XORG_SERVER_CONF_OPTS += --disable-glamor endifSignature · 38 lines
2.26.2 -- CONFIDENTIALITY NOTICE ------------------------------------ This E-mail is intended only to be read or used by the addressee.The information contained in this E-mail message may be confidential information. If you are not the intended recipient, any use, interference with, distribution, disclosure or copying of this material is unauthorized and prohibited. Confidentiality attached to this communication is not waived or lost by reason of the mistaken delivery to you. If you have received this message in error, please delete it and notify us by return E-mail or telephone NOVOMATIC Technologies Poland S.A. +48 12 258 00 50. Any E-mail attachment may contain software viruses which could damage your own computer system. Whilst reasonable precaution has been taken to minimize this risk, we cannot accept liability for any damage which you sustain as a result of software viruses. You should therefore carry out your own virus checks before opening any attachments. ------------------------------------ NOVOMATIC Technologies Poland S.A., Poland, Krakowska 368, 32-080 Zabierz?w
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v2 4/4 package/nvidia-driver: update to 390.132, 435.21, 440.82
In reply to Jakub Skrzypnik--- .../390.132/0001-kernel-416.patch | 33 + .../390.132/0002-kernel-55.patch | 1286 +++++++++++++++++ .../390.132/0003-kernel-56.patch | 415 ++++++ .../435.21/0001-kernel-5.4.patch | 142 ++ package/nvidia-driver/Config.in | 60 +- package/nvidia-driver/egl.pc | 10 - package/nvidia-driver/gl.pc | 11 - package/nvidia-driver/nvidia-driver.hash | 7 +- package/nvidia-driver/nvidia-driver.mk | 366 +++-- 9 files changed, 2145 insertions(+), 185 deletions(-) create mode 100644 package/nvidia-driver/390.132/0001-kernel-416.patch create mode 100644 package/nvidia-driver/390.132/0002-kernel-55.patch create mode 100644 package/nvidia-driver/390.132/0003-kernel-56.patch create mode 100644 package/nvidia-driver/435.21/0001-kernel-5.4.patch delete mode 100644 package/nvidia-driver/egl.pc delete mode 100644 package/nvidia-driver/gl.pc
package/nvidia-driver/390.132/0001-kernel-416.patch new file +33 -0
@@ -0,0 +1,33 @@ +diff --git a/kernel/common/inc/nv-linux.h b/kernel/common/inc/nv-linux.h +index 10fc418..22ef968 100644 +--- a/kernel/common/inc/nv-linux.h ++++ b/kernel/common/inc/nv-linux.h +@@ -175,7 +175,11 @@ static inline uid_t __kuid_val(kuid_t uid) + + #if defined(NV_VM_INSERT_PAGE_PRESENT) + #include <linux/pagemap.h> ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0) + #include <linux/dma-mapping.h> ++#else ++#include <linux/dma-direct.h> ++#endif + #endif + + #if defined(CONFIG_SWIOTLB) && defined(NVCPU_AARCH64) +diff --git a/kernel/conftest.sh b/kernel/conftest.sh +index b23dbb4..42dc576 100755 +--- a/kernel/conftest.sh ++++ b/kernel/conftest.sh +@@ -1906,7 +1906,12 @@ compile_test() { + # Determine if the phys_to_dma function is present. + # + CODE=" ++ #include <linux/version.h> ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0) + #include <linux/dma-mapping.h> ++#else ++ #include <linux/dma-direct.h> ++#endif + void conftest_phys_to_dma(void) { + phys_to_dma(); + }"
package/nvidia-driver/390.132/0002-kernel-55.patch new file +1286 -0
1,286 lines not on this page · raw message
package/nvidia-driver/390.132/0003-kernel-56.patch new file +415 -0
415 lines not on this page · raw message
package/nvidia-driver/435.21/0001-kernel-5.4.patch new file +142 -0
142 lines not on this page · raw message
package/nvidia-driver/Config.in +31 -29
87 lines not on this page · raw message
package/nvidia-driver/egl.pc deleted +0 -10
@@ -1,10 +0,0 @@ -prefix=/usr -exec_prefix=${prefix} -libdir=${exec_prefix}/lib -includedir=${prefix}/include - -Name: egl -Description: Nvidia OpenGL library -Version: 1 -Cflags: -I${includedir} -Libs: -L${libdir} -lEGL
package/nvidia-driver/gl.pc deleted +0 -11
@@ -1,11 +0,0 @@ -prefix=/usr -exec_prefix=${prefix} -libdir=${exec_prefix}/lib -includedir=${prefix}/include - -Name: gl -Description: Nvidia OpenGL library -Version: 10.4.2 -Libs: -L${libdir} -lGL -lm -lXext -lX11 -ldl -Cflags: -I${includedir} -DEGL_NO_X11 -glx_tls: no
package/nvidia-driver/nvidia-driver.hash +5 -2
@@ -1,4 +1,7 @@ # Locally computed -sha256 6f4af70ee3d03ed31c497a5d555164c56057b53ecedfc0d2c8de4b0b90728805 NVIDIA-Linux-x86-390.67.run -sha256 6df2ca1a7420b6751bcaf257d321b14f4e5f7ca54d77a43514912a3792ece65a NVIDIA-Linux-x86_64-390.67.run +sha256 edd415acf2f75a659e0f3b4f27c1fab770cf21614e84a18152d94f0d004a758e NVIDIA-Linux-x86_64-440.82.run +sha256 fac7c02ccd35c7043f4e1add0224a7380d0bd1e4aa15ca6bc3012c758ec1776c NVIDIA-Linux-x86_64-435.21.run +sha256 b6532de659f96f7859f9d59ae30ab93d0a07141d37f229a570b30f96a5d2ff61 NVIDIA-Linux-x86_64-390.132.run +sha256 51adb28f0ed4548f35a88a93ad6767ebd807fa14f418bf5e51a6d63a3ff7f275 NVIDIA-Linux-x86-390.132.run +sha256 caee54f0ee5f6171a61b25670d309d1abe16d59fc7bec0577794b1a52c09244a NVIDIA-Linux-x86_64-435.21-no-compat32.run sha256 bd28b0c5aeeb00eb11d3ec6f6f3449d4b3a40100914258332734a53527997526 LICENSE
package/nvidia-driver/nvidia-driver.mk +233 -133
405 lines not on this page · raw message
Signature · 38 lines
2.26.2 -- CONFIDENTIALITY NOTICE ------------------------------------ This E-mail is intended only to be read or used by the addressee.The information contained in this E-mail message may be confidential information. If you are not the intended recipient, any use, interference with, distribution, disclosure or copying of this material is unauthorized and prohibited. Confidentiality attached to this communication is not waived or lost by reason of the mistaken delivery to you. If you have received this message in error, please delete it and notify us by return E-mail or telephone NOVOMATIC Technologies Poland S.A. +48 12 258 00 50. Any E-mail attachment may contain software viruses which could damage your own computer system. Whilst reasonable precaution has been taken to minimize this risk, we cannot accept liability for any damage which you sustain as a result of software viruses. You should therefore carry out your own virus checks before opening any attachments. ------------------------------------ NOVOMATIC Technologies Poland S.A., Poland, Krakowska 368, 32-080 Zabierz?w