I migrated from Debian 12 Bookworm to Debian 13 Trixie on Raspberry Pi, libgtk-4-1/stable,now 4.18.6+ds-2 arm64 [installed]
Now I get this running any gtk python app:
Warning: GError set over the top of a previous GError or uninitialized memory.
This indicates a bug in someone’s code. You must ensure an error is NULL before it’s set.
The overwriting error message was: Unable to create a GL context
Here is a minimal example that triggers it:
import sys
import gi
gi.require_version(‘Gtk’, ‘4.0’)
from gi.repository import Gtk
class MainWindow(Gtk.ApplicationWindow):
def __init__(self, app):
super().__init__(application=app)
class MinimalApp(Gtk.Application):
def __init__(self):
super().__init__(application_id=“com.example.minimal”)
def do_activate(self):
self.window = MainWindow(self)
self.window.present()
def main():
app = MinimalApp()
return app.run(sys.argv)
if __name__ == “__main__”:
exit_code = main()
sys.exit(exit_code)
Not sure about the GError issue but seems like the GL context message has something to do with OpenGL so I ran the example with GDK_DEBUG=opengl:
Ok, I dug into this deeper on some of the Pi forums and I think the underlying trigger is a platform issue and the Trixie available GTK4 release is responding to that.
I ran the example above on a PI3b+ running Bookworm and did not get these messages. The last release of GTK4 on Bookworm was 4.8.3:libgtk-4-1/oldstable,now 4.8.3+ds-2+deb12u1 arm64 [installed,automatic]
I’m in the process of migrating to Trixie so that I can use later release of GTK4, specifically I need the new api introduced for FileDIalog in 4.10. I have only setup test platforms on Pi3b+ and Pizero 2w. Unfortunately, it appears these platforms are not able to provide an OpenGL interface that the most current releases of GTK4 will support or at least that is my conjecture. I have not migrated a PI5 to Trixie yet, but its OPenGL support appears compatible. Here is the info from glxinfo:
Pi3b+
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
Max core profile version: 0.0
Max compat profile version: 2.1
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 2.0
OpenGL version string: 2.1 Mesa 25.0.7-2+rpt3
OpenGL shading language version string: 1.20
OpenGL ES profile version string: OpenGL ES 2.0 Mesa 25.0.7-2+rpt3
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16
PI5:
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
Max core profile version: 3.1
Max compat profile version: 3.1
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.1
OpenGL core profile version string: 3.1 Mesa 24.2.8-1~bpo12+rpt4
OpenGL core profile shading language version string: 1.40
OpenGL version string: 3.1 Mesa 24.2.8-1~bpo12+rpt4
OpenGL shading language version string: 1.40
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 24.2.8-1~bpo12+rpt4
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
GL_EXT_separate_shader_objects, GL_EXT_shader_implicit_conversions,
PIzero 2w:
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
Max core profile version: 0.0
Max compat profile version: 2.1
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 2.0
OpenGL version string: 2.1 Mesa 25.0.7-2+rpt3
OpenGL shading language version string: 1.20
OpenGL ES profile version string: OpenGL ES 2.0 Mesa 25.0.7-2+rpt3
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16
I solved the problem by making the symptoms go away:
GSK_RENDERER=vulkan
This link was extremely helpful:
All of the PIs now have some level of vulkan renderer API installed and GTK seems to accept them all. However, not sure if all Pis are actually using the VPU/GPU to implement the API. I suspect that on the “less capable” models like PI 3B+ and PI zero/zero 2 the API just punts to some kind of software rendering. It is what it is…
Details:
PI5 Debian 12:
VK_LAYER_MESA_device_select (Linux device selection layer) Vulkan version 1.3.211, layer version 1:
VK_LAYER_MESA_overlay (Mesa Overlay layer) Vulkan version 1.3.211, layer version 1:
PI3b+ Debian 13:
VK_LAYER_MESA_device_select (Linux device selection layer) Vulkan version 1.4.303, layer version 1:
VK_LAYER_MESA_overlay (Mesa Overlay layer) Vulkan version 1.4.303, layer version 1:
A short update. I completed the migration on Pi5 from bookworm to trixie. This problem does not occur there. The OpenGL versioning under trixie is the same as under bookworm as listed above.