picoe / Eto.Veldrid

Veldrid control for Eto.Forms
MIT License
15 stars 6 forks source link

Gtk/OpenGL backend crashes on nVidia 460 series #21

Closed philstopford closed 5 months ago

philstopford commented 3 years ago

Trying to run the test under a variety of Linux distributions and drivers, I see a fail of the form :

{{{ (TestEtoVeldrid.Gtk:5684): Gdk-ERROR **: 17:36:39.434: The program 'TestEtoVeldrid.Gtk' received an X Window System error. This probably reflects a bug in the program. The error was 'GLXBadContextTag'. (Details: serial 446 error_code 162 request_code 151 (GLX) minor_code 26) (Note to programmers: normally, X errors are reported asynchronously; that is, you will receive the error a while after causing it. To debug your program, run it with the GDK_SYNCHRONIZE environment variable to change this behavior. You can then get a meaningful backtrace from your debugger if you break on the gdk_x_error() function.) }}}

forcing Vulkan avoids this, but there are some issues there as well

cwensley commented 3 years ago

@philstopford Thanks for reporting the issue.

Do you have a way to reproduce this so I can test it?

philstopford commented 3 years ago

I used the Veldrid test application, altering the target framework to net5.0 from net472;netcoreapp3.1 In the attached, I forced the backend for Gtk to Vulkan

test_vulkan.zip

Video :

https://user-images.githubusercontent.com/1983851/104228156-0f6ddc00-5410-11eb-9adf-6ee19daa3460.mp4

philstopford commented 3 years ago

Removing the forced use of Vulkan in the MainForm.cs under test/TestEtoVeldrid, the GLX error is then obtained:

https://user-images.githubusercontent.com/1983851/104228883-15b08800-5411-11eb-9ddd-88f8a8634729.mp4

cwensley commented 3 years ago

@philstopford thanks for the info! what distro/version and graphics drivers are you using? Do other OpenGL applications work? I cannot replicate the OpenGL issue with Ubuntu 20.10 running in a VM, and Vulcan doesn't work at all for me due to missing drivers.

philstopford commented 3 years ago

This has been seen under Linux Mint 20, Ubuntu 20.10. I don't see it on my other machine that only has an Intel 7600U (620 graphics) in it, for the same operating systems.

I've tried with various nVidia drivers (460 series being the latest available under the environments).

glxgears runs OK.

cwensley commented 3 years ago

glxgears runs OK.

Hmm.. I wonder if there's a Gtk+ or GtkSharp example that we could try as well that uses the GLArea control. At least to rule out anything to do with Veldrid.

philstopford commented 3 years ago

I can build and run the Veldrid samples without issue, for net5.0, under Linux.

cwensley commented 3 years ago

... those do not use Gtk as far as I can tell. They use SDL2 to create the window.

philstopford commented 3 years ago

Makes me wonder about https://github.com/picoe/Eto.OpenTK/issues/30 now :D

cwensley commented 3 years ago

@philstopford could you give https://github.com/ebassi/glarea-example a try? (I just compiled it, using Flatpak didn't work) It should be the same as what we do to get the OpenGL backend going. I'm seeing the same behaviour when resizing where the window flickers, but I still don't see any crashes.

philstopford commented 3 years ago

https://user-images.githubusercontent.com/1983851/104361713-6fc85080-54d8-11eb-87c8-ee08aaf38dea.mp4

OK. Needed to install a whole bunch of developer packages. Built and running without issue. No crash, no black panel, resizes without flickering.

cwensley commented 3 years ago

@philstopford awesome, good to know that works for you so we should be able to get this working. The only difference I see is when the Veldrid initialization is done (during the first render vs. realize with the glarea app), which might have something to do with it. I'll make some changes in a PR so you can test it out.

philstopford commented 3 years ago

@cwensley : just wondering when you might have time for the PR? Just curious, not intended to be read any other way :)

philstopford commented 3 years ago

Testing : https://user-images.githubusercontent.com/1983851/105358557-f60d2280-5bbb-11eb-94c9-1f84f5d34cf0.mp4

cwensley commented 3 years ago

@philstopford hm, thanks but it looks like your testing Vulkan (which I didn't change). Could you test with OpenGL?

philstopford commented 3 years ago

OpenGL throws a GLX error and dies (as above).

https://user-images.githubusercontent.com/1983851/105380573-a9354600-5bd3-11eb-9270-d7e83fae1872.mp4

cwensley commented 3 years ago

@philstopford thanks, I'll look into it further. I am also updating Eto.OpenTK to use GLArea so once I get that going we can perhaps see if it is something Veldrid is doing.

philstopford commented 3 years ago

@cwensley : did you manage to dig further?

Beyley commented 2 years ago

I tested on my machine (GTX 1050ti with latest nvidia drivers) and i get the same GL error