currently im working on an avalonia application using the avalonia template from the apolloX extension. everytime i launch the application i get a message that glx based rendering could not be initialized. is anyone else facing that issue or having an idea what could lead to that behavior?
heres the error:
[OpenGL] Unable to initialize GLX-based rendering: 'System.EntryPointNotFoundException: Unable to find an entry point named 'glXGetProcAddress' in shared library 'libGL.so.1'.
at Avalonia.X11.Glx.GlxInterface.GlxGetProcAddress(Utf8Buffer buffer)
at Avalonia.OpenGL.GlInterfaceBase`1.<>c__DisplayClass2_0.<ConvertNative>b__0(String proc) in /_/src/Avalonia.OpenGL/GlInterfaceBase.cs:line 67
at Avalonia.OpenGL.GlEntryPointAttribute.GetProcAddress(Func`2 getProcAddress) in /_/src/Avalonia.OpenGL/GlEntryPointAttribute.cs:line 40
at Avalonia.OpenGL.GlInterfaceBase`1..ctor(Func`2 getProcAddress, TContext context) in /_/src/Avalonia.OpenGL/GlInterfaceBase.cs:line 50
at Avalonia.X11.Glx.GlxDisplay..ctor(X11Info x11, IList`1 probeProfiles) in /_/src/Avalonia.X11/Glx/GlxDisplay.cs:line 20
at Avalonia.X11.Glx.GlxPlatformOpenGlInterface.TryCreate(X11Info x11, IList`1 glProfiles) in /_/src/Avalonia.X11/Glx/GlxPlatformFeature.cs:line 34'
after i updated my project to the current version of the avalonia mvvm template the stack changed a bit:
[OpenGL] Unable to initialize GLX-based rendering: 'Avalonia.OpenGL.OpenGlException: Unable to find a suitable GL function for CreateContextAttribsARB
at Avalonia.OpenGL.GlInterfaceBase`1..ctor(Func`2 getProcAddress, TContext context) in /_/src/Avalonia.OpenGL/GlInterfaceBase.cs:line 58
at Avalonia.OpenGL.GlInterfaceBase..ctor(Func`2 getProcAddress) in /_/src/Avalonia.OpenGL/GlInterfaceBase.cs:line 11
at Avalonia.X11.Glx.GlxInterface..ctor() in /_/src/Avalonia.X11/Glx/Glx.cs:line 110
at Avalonia.X11.Glx.GlxDisplay..ctor(X11Info x11, IList`1 probeProfiles) in /_/src/Avalonia.X11/Glx/GlxDisplay.cs:line 20
at Avalonia.X11.Glx.GlxPlatformOpenGlInterface.TryCreate(X11Info x11, IList`1 glProfiles) in /_/src/Avalonia.X11/Glx/GlxPlatformFeature.cs:line 34'
i also tried with the default template project without making any changes:
Starting: "ssh" -T -q -p 2223 -i /home/dog/testprojects/ToradexStartupProject200/.conf/id_rsa -o StrictHostKeyChecking=no -o "UserKnownHostsFile /dev/null" torizon@colibri-imx8x-07252196 "/vsdbg/vsdbg --interpreter=vscode"
-------------------------------------------------------------------
You may only use the Microsoft .NET Core Debugger (vsdbg) with
Visual Studio Code, Visual Studio or Visual Studio for Mac software
to help you develop and test your applications.
-------------------------------------------------------------------
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.Private.CoreLib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/home/torizon/app/ToradexStartupProject200.dll'. Symbols loaded.
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.Runtime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/home/torizon/app/Avalonia.DesktopRuntime.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/home/torizon/app/Avalonia.Controls.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/netstandard.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/home/torizon/app/Avalonia.Base.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.ObjectModel.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/home/torizon/app/Avalonia.Styling.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/home/torizon/app/Avalonia.Input.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/home/torizon/app/Avalonia.Interactivity.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/home/torizon/app/Avalonia.Layout.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/home/torizon/app/Avalonia.Visuals.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/home/torizon/app/Avalonia.Animation.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.ComponentModel.Primitives.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.Collections.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/home/torizon/app/Avalonia.Desktop.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/home/torizon/app/Avalonia.ReactiveUI.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/home/torizon/app/Avalonia.X11.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.Runtime.InteropServices.RuntimeInformation.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/home/torizon/app/Avalonia.Skia.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/home/torizon/app/Avalonia.OpenGL.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/home/torizon/app/System.Reactive.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.Threading.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.Private.Uri.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.Linq.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.ComponentModel.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.Runtime.Extensions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.Xml.XDocument.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.Private.Xml.Linq.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.Private.Xml.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.Memory.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.Text.Encoding.Extensions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.Threading.Thread.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.Runtime.InteropServices.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/home/torizon/app/Avalonia.FreeDesktop.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/home/torizon/app/Tmds.DBus.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.Collections.Concurrent.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.Diagnostics.TraceSource.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
[X11Platform] SMLib/ICELib reported a new error: SESSION_MANAGER environment variable not definedEGL: Warning: No default display support on wayland
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.Diagnostics.StackTrace.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.Reflection.Metadata.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.Collections.Immutable.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.IO.Compression.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
[OpenGL] Unable to initialize EGL-based rendering: 'Avalonia.OpenGL.OpenGlException: eglGetDisplay failed with error EGL_SUCCESS (0x3000)
at Avalonia.OpenGL.Egl.EglDisplay.CreateDisplay(EglInterface egl, Int32 platformType, IntPtr platformDisplay, Int32[] attrs) in /_/src/Avalonia.OpenGL/Egl/EglDisplay.cs:line 43
at Avalonia.OpenGL.Egl.EglDisplay..ctor(EglInterface egl, Boolean supportsSharing, Int32 platformType, IntPtr platformDisplay, Int32[] attrs) in /_/src/Avalonia.OpenGL/Egl/EglDisplay.cs:line 48
at Avalonia.OpenGL.Egl.EglDisplay..ctor(EglInterface egl, Boolean supportsSharing) in /_/src/Avalonia.OpenGL/Egl/EglDisplay.cs:line 22
at Avalonia.OpenGL.Egl.EglDisplay..ctor(Boolean supportsSharing) in /_/src/Avalonia.OpenGL/Egl/EglDisplay.cs:line 144
at Avalonia.OpenGL.Egl.EglDisplay..ctor() in /_/src/Avalonia.OpenGL/Egl/EglDisplay.cs:line 139
at Avalonia.OpenGL.Egl.EglPlatformOpenGlInterface.<>c.<TryCreate>b__15_0() in /_/src/Avalonia.OpenGL/Egl/EglPlatformOpenGlInterface.cs:line 29
at Avalonia.OpenGL.Egl.EglPlatformOpenGlInterface.TryCreate(Func`1 displayFactory) in /_/src/Avalonia.OpenGL/Egl/EglPlatformOpenGlInterface.cs:line 34'
Loaded '/home/torizon/app/SkiaSharp.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/home/torizon/app/Splat.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/home/torizon/app/ReactiveUI.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.ComponentModel.TypeConverter.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
LogHost: Initializing to normal mode (.cctor)
Loaded '/home/torizon/app/Avalonia.Markup.Xaml.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/home/torizon/app/Avalonia.Themes.Fluent.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.Runtime.CompilerServices.Unsafe.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/home/torizon/app/Avalonia.Markup.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.Threading.Tasks.Extensions.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/home/torizon/app/Avalonia.Diagnostics.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/dotnet/shared/Microsoft.NETCore.App/6.0.5/System.Buffers.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Loaded '/home/torizon/app/HarfBuzzSharp.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
my project differ in a way that i wanted to get my avalonia application separated from the toradex startup confiugrations. so i splitted that into two different project that are referenced
yes, we tried the framebuffer template in the past but there we were not able to get the touch input to work and with the other template it was working. that was the reason for us to work with that template. and on the other hand, we wanted to take advantage of the 2d acceleration.
thanks for your answer. i also tried to not use glx and use egl instead like it is set up in the avalonia template, but this will also result in init exceptions stated above. so it is not just about glx at this point if i understand it right.
i also modified my project to use linux framebuffer. it was working in general but it seemed to be even less performant than running the application on weston without a working graphics acceleration.
i am also confused now since i saw the post here (https://community.nxp.com/t5/i-MX-Processors/X11-support-for-iMX8-and-iMX8M/td-p/822981) where the tech support of nxp also stated frame buffer as not supported
So, make sure you are using DRM mode, if you are not already. And, if you are already using it let me know, because that’s the mode we’ve tested with the best performance, and we have to look into it if you’re having issues.
@matheus.tx and @tisis2
I have to select an open source C#/.NET GUI library or platform for developing a simple GUI application using a touchscreen 10.1’’ or 7’’ and with Todarex’s Verdin SOM i.MX 8M Plus.
Can you give me some hints because I don’t know which solution is the more stable nowadays.
Is it Avalonia (.NET 8 C# Avalonia GTK MVVM or .NET 8 C# Avalonia Frame Buffer) or is it Uno Platform ( .NET 8 C# Uno Platform 5.x Skia.GTK or .NET 8. C# Uno Platform Frame Buffer) ?
I do not want to face bugs because I have to time left to waste, so your experience and advises will be really appreciated.
Avalonia (.NET 8 C# Avalonia GTK) with GTK might be more stable and have better community support on Linux-based systems like Torizon. Uno can be more complex to set up and may have a steeper learning curve if you are unfamiliar with UWP and XAML. However, both are equally performant in my opinion. You may want to evaluate quickly using our template applications from the VSCode IDE extension.
I’ve found a developer (Telegram: Contact @drwenz : Markus Wenzl) on Telegram who has designed an impressive UI using Avalonia. He is member of Toradex’s Community as well @DrWenz.
I will try to ask him the right learning path and code samples to develop UI applications for Toradex’s SOM using Avalonia.
If you have further information, @rudhi.tx, on how I can get access to code samples or tutorials about Avalonia for beginners and Torizon , you’ll make my day.
Many thanks again.
I keep in touch with you about what’s going on about this topic. This might interest the community.
Nice that you found another user successfully running an Avalonia app on a Toradex hardware! Also, thanks for sharing it.
We do not have any tutorials on Avalonia, however I find some sample projects and documentation on the official website of Avalonia. Perhaps, those would be helpful for you:
Anyway, I will keep you updated if I find something else on this topic since @DrWenz sent me a message on Telegram saying that Avalonia with FrameBuffer or Direct Rendering Mode was really efficient.
Here is his message on the 28th of June, 2024.
Hello Francois, nice to e-meet you :)
I put a looooooot of effort in Avalonia for Embedded Devices, my biggest pain point was the startup time back on old version of AvaloniaUI. But for the current state of Avalonia its a pleasure to work with.
When it comes to embedded devices, especially when you directly render to fb or drm you need to keep a few things in mind.
There is no really a "Window" like on the desktop, means dialogs, notifications, overlays etc needs to be inside a single view.
What will be the usage of your embedded device? :)
I have found out a github repo with an application built using Avalonia, which can run on Windows or Linux, which shows the beautiful UI that you can create. I will try to make it work under Torizon. This might interest @matheus.tx.