Open Sivecano opened 2 months ago
Did this get fixed by 14e1a85910a837840b54473394f1c6a7e53f71cb?
The issue persists. I'm trying with 69e58bc, also on Arch, but with the less open Nvidia driver. I tried removing the GTK version check from the commit you mentioned and added set_required_version(3, 3)
. Neither changed anything.
I can also reproduce this on 69e58bc, with the closed-source nvidia driver (no nvidia-run
).
added set_required_version(3, 3)
Where? It needs to be done before creating the GL context, so the same place as gtk_gl_area_set_allowed_apis
should work.
Try running Dune 3D with the GDK_DEBUG=opengl
environment variable set and paste the output.
Running Fedora 39 here and getting the same problem with the flatpak version. Running RTX 3060 with proprietary nvidia drivers. Here's the output of trying to run it with the GDK_DEBUG env set:
EGL API version 1.5 found
- Vendor: NVIDIA
- Version: 1.5
- Device: /dev/dri/renderD128, 226 128
- Client APIs: OpenGL_ES OpenGL
- Extensions:
EGL_ANDROID_native_fence_sync
EGL_EXT_buffer_age
EGL_EXT_client_sync
EGL_EXT_create_context_robustness
EGL_EXT_image_dma_buf_import
EGL_EXT_image_dma_buf_import_modifiers
EGL_EXT_output_base
EGL_EXT_present_opaque
EGL_EXT_stream_acquire_mode
EGL_EXT_sync_reuse
EGL_IMG_context_priority
EGL_KHR_config_attribs
EGL_KHR_context_flush_control
EGL_KHR_create_context
EGL_KHR_create_context_no_error
EGL_KHR_fence_sync
EGL_KHR_get_all_proc_addresses
EGL_KHR_gl_colorspace
EGL_KHR_gl_renderbuffer_image
EGL_KHR_gl_texture_2D_image
EGL_KHR_gl_texture_3D_image
EGL_KHR_gl_texture_cubemap_image
EGL_KHR_image
EGL_KHR_image_base
EGL_KHR_image_pixmap
EGL_KHR_no_config_context
EGL_KHR_partial_update
EGL_KHR_reusable_sync
EGL_KHR_stream
EGL_KHR_stream_attrib
EGL_KHR_stream_consumer_gltexture
EGL_KHR_stream_cross_process_fd
EGL_KHR_stream_fifo
EGL_KHR_stream_producer_eglsurface
EGL_KHR_surfaceless_context
EGL_KHR_swap_buffers_with_damage
EGL_KHR_wait_sync
EGL_MESA_image_dma_buf_export
EGL_NV_nvrm_fence_sync
EGL_NV_output_drm_flip_event
EGL_NV_post_sub_buffer
EGL_NV_quadruple_buffer
EGL_NV_robustness_video_memory_purge
EGL_NV_stream_attrib
EGL_NV_stream_consumer_eglimage
EGL_NV_stream_consumer_gltexture_yuv
EGL_NV_stream_cross_display
EGL_NV_stream_cross_object
EGL_NV_stream_cross_process
EGL_NV_stream_cross_system
EGL_NV_stream_dma
EGL_NV_stream_fifo_next
EGL_NV_stream_fifo_synchronous
EGL_NV_stream_flush
EGL_NV_stream_metadata
EGL_NV_stream_origin
EGL_NV_stream_remote
EGL_NV_stream_reset
EGL_NV_stream_socket
EGL_NV_stream_socket_inet
EGL_NV_stream_socket_unix
EGL_NV_stream_sync
EGL_NV_system_time
EGL_NV_triple_buffer
EGL_WL_bind_wayland_display
EGL_WL_wayland_eglstream
- Selected fbconfig: R8G8B8A8, depth 0, stencil 0
high depth: none
Creating EGL context version 2.0 (debug:no, forward:no, legacy:no, es:yes)
Created EGL context[0x5621c05d7ef1]
Using OpenGL backend EGL
OpenGL ES version: 3.2 (core)
* GLSL version: OpenGL ES GLSL ES 3.20
* Max texture size: 32768
Enabled features (use GDK_GL_DISABLE env var to disable):
debug: YES
unpack-subimage: YES
half-float: YES
sync: YES
base-instance: YES
buffer-storage: YES
Creating EGL context version 3.0 (debug:no, forward:no, legacy:no, es:yes)
Created EGL context[0x5621c0c350a1]
OpenGL ES version: 3.2 (core)
* GLSL version: OpenGL ES GLSL ES 3.20
* Max texture size: 32768
Enabled features (use GDK_GL_DISABLE env var to disable):
debug: YES
unpack-subimage: YES
half-float: YES
sync: YES
base-instance: YES
buffer-storage: YES
Creating EGL context version 3.2 (debug:no, forward:no, legacy:no, es:no)
Creating EGL context version 3.0 (debug:no, forward:no, legacy:yes, es:no)
(snipped out the other errors as they are the same as before)
edit: I just compiled it myself and it actually launched without issue, so evidently something between the latest release and the latest commit solved it at least for my situation.
edit: I just compiled it myself and it actually launched without issue, so evidently something between the latest release and the latest commit solved it at least for my situation.
This makes it look more like a flatpak problem then. There are no relevant commits since version 1.1: https://github.com/dune3d/dune3d/commits/main/
I was looking for this in the debug output:
realize
Creating EGL context version 3.2 (debug:no, forward:no, legacy:no, es:no)
Created EGL context[0x5becc96a0d80]
OpenGL version: 4.6 (core)
* GLSL version: 4.60
* Max texture size: 16384
Legacy:yes looks wrong to me in your output.
On my machine it works when I launch it with GDK_DEBUG="gl-prefer-gl"
. Updating GTK to 4.14.4
did nothing.
This may be an issue with GTK (like most of my computer issues for some reason). When I request an OpenGL 3.3 context in a minimal GTK4 application, it will create an openGL ES 3.2 context instead and replace the GLArea with an error message in the GUI: https://gist.github.com/nameless-tee/985b7712a66b6e6cda577f8cc9c9d223
There is already an issue on the GTK issue tracker: https://gitlab.gnome.org/GNOME/gtk/-/issues/6423
Just came here to confirm the same issue. Flatpak gives a compile error:
Compile failure in vertex shader: 0(2) : error C0201: unsupported version 330
0(3) : error C7532: global type vec2 requires "#version 100" or later
0(4) : error C7532: global type vec3 requires "#version 100" or later
0(4) : error C5060: out can't be used with non-varying color_to_fragment
0(9) : error C7532: global variable gl_VertexID requires "#version 130" or later
0(9) : error C0000: ... or #extension GL_EXT_gpu_shader4 : enable
0(10) : error C7532: global function pow requires "#version 100" or later
0(15) : error C7532: global variable gl_Position requires "#version 100" or later
...
On Ubuntu 24.04 - Wayland.
Adding GDK_DEBUG=gl-prefer-gl
as @nameless-tee suggested fix the issue for me.
Can someone of you try the above branch? This moves the call to gtk_gl_area_set_allowed_apis
to the ctor, maybe the current location was too late.
Can someone of you try the above branch? This moves the call to
gtk_gl_area_set_allowed_apis
to the ctor, maybe the current location was too late.
No discernable difference in the output :s
Now with some more debug output on that branch.
Now with some more debug output on that branch.
get_context()
returns a std::shared_ptr
pointing at null, causing it to crash before outputting anything new.
realize
Creating EGL context version 3.2 (debug:no, forward:no, legacy:no, es:no)
Creating EGL context version 3.0 (debug:no, forward:no, legacy:yes, es:no)
Thread 1 "dune3d" received signal SIGSEGV, Segmentation fault.
0x00007ffff6d787d8 in Gdk::GLContext::is_legacy() const () from /usr/lib/libgtkmm-4.0.so.0
(gdb) bt
#0 0x00007ffff6d787d8 in Gdk::GLContext::is_legacy() const () at /usr/lib/libgtkmm-4.0.so.0
#1 0x00005555556cfdd5 in dune3d::Canvas::on_realize (this=0x555556bc9b10) at ../src/canvas/canvas.cpp:662
#2 0x00007ffff6d09c2f in Gtk::Widget_Class::realize_callback(_GtkWidget*) () at /usr/lib/libgtkmm-4.0.so.0
#3 0x00007ffff6f848d3 in ??? () at /usr/lib/libgobject-2.0.so.0
Edit: Isn't it funny that make_current()
doesn't even complain? I guess all the openGL calls are made to some other context. Maybe you could fix this for now by manipulating the GDK_DEBUG
env at entry and wait until this is resolved in GTK?
Here is my truly terrible workaround in case anyone is desperate enough: https://gist.github.com/nameless-tee/da554375b2a9c9daf9f36db68e4bf9c5
Might be a tall order, but if I had a suitable nvidia machine at hand I'd figure out what exactly that environment variable is doing to fix it by debugging gtk/adding printfs. Just staring at the gtk source code didn't get me any further.
Either there's some API of GtkGLArea we're not using correctly or a bugfix for gtk will fall out of it. Wouldn't be the first time that one of my CAD applications resulted in patches in Gtk's OpenGL machinery...
Same error here on Fedora 40 with GTX1080 nvidia propitary drivers...
User Logs:
--Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(46) : error C7548: '>>' requires "#extension GL_EXT_gpu_shader4 : enable" before use
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(46) : error C7548: '&' requires "#extension GL_EXT_gpu_shader4 : enable" before use
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(46) : error C7011: implicit cast from "uint" to "float"
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(47) : error C7548: '>>' requires "#extension GL_EXT_gpu_shader4 : enable" before use
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(47) : error C7548: '&' requires "#extension GL_EXT_gpu_shader4 : enable" before use
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(47) : error C7011: implicit cast from "uint" to "float"
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(48) : error C7548: '>>' requires "#extension GL_EXT_gpu_shader4 : enable" before use
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(48) : error C7548: '&' requires "#extension GL_EXT_gpu_shader4 : enable" before use
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(48) : error C7011: implicit cast from "uint" to "float"
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(49) : error C7548: '>>' requires "#extension GL_EXT_gpu_shader4 : enable" before use
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(49) : error C7548: '&' requires "#extension GL_EXT_gpu_shader4 : enable" before use
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(49) : error C7011: implicit cast from "uint" to "float"
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(57) : error C7532: global variable gl_Position requires "#version 100" or later
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(57) : error C7532: global type vec4 requires "#version 100" or later
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(58) : error C7532: global variable gl_VertexID requires "#version 130" or later
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(58) : error C0000: ... or #extension GL_EXT_gpu_shader4 : enable
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(58) : error C7532: global type int requires "#version 100" or later
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]:
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: Compile failure in vertex shader: 0(2) : error C0201: unsupported version 330
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(2) : error C0000: syntax error, unexpected '(', expecting "::" at token "("
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(6) : error C7532: global type vec4 requires "#version 100" or later
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(6) : error C5060: out can't be used with non-varying p1_to_geom
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(7) : error C5060: out can't be used with non-varying p2_to_geom
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(8) : error C7532: global type uint requires "#version 130" or later
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(8) : error C0000: ... or #extension GL_EXT_gpu_shader4 : enable
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(8) : error C5060: out can't be used with non-varying flags_to_geom
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(9) : error C5060: out can't be used with non-varying pick_to_geom
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(12) : error C7532: global type mat4 requires "#version 100" or later
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(14) : error C7532: global type float requires "#version 100" or later
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(28) : error C0000: syntax error, unexpected '(', expecting "::" at token "("
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(34) : error C7532: global type vec3 requires "#version 100" or later
Mai 10 11:36:13 fedora org.gnome.Software.desktop[65934]: 0(36) : error C1503: undefined variable "colors"
application crashes on startup when trying to run on archlinux using the
nvidia-open
driver with the following error:I might look into why this is happening. some preliminary googling suggests that the OpenGL version in the context may not be hinted correctly and defaults to like OpenGL 1.0. seems like a relatively easy fix, just haven't found where yet.