Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limited Support for graphical acceleration on downstream-based modules #51

Closed
brunoaamello opened this issue Apr 20, 2023 · 10 comments
Closed
Assignees
Labels
bug Something isn't working enhancement New feature or request Torizon 6.x.y Improve support to Torizon 6.x.y
Milestone

Comments

@brunoaamello
Copy link

There are templates that use the container wayland-base as a base for their application containers, regardless of SoC/SoM.
This results in limited hardware acceleration support for downstream-based modules (i.MX 8/i.MX 8M/i.MX 8X).

The downstream-based modules should use the container wayland-base-vivante instead, to allow hardware acceleration within the container.
As it is right now, the templates have hardware accelerated compositing, in the separate weston-vivante container, but the OpenGL provider in the application container itself is LLVMpipe, a software implementation.

The affected templates are:

The fix can be as simple as using a build arg for the GPU or may require further changes to these templates.

@microhobby microhobby added bug Something isn't working enhancement New feature or request labels Apr 20, 2023
@microhobby microhobby self-assigned this Apr 20, 2023
@microhobby
Copy link
Member

microhobby commented Apr 30, 2023

This is blocked because we are having some issues with the torizon/wayland-base-vivante:3 packages when trying to install qt6-base-dev:

root@ef1e75ce2d6c:/# apt install qt6-base-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 qt6-base-dev : Depends: libgl-dev
E: Unable to correct problems, you have held broken packages.

From #57

@microhobby
Copy link
Member

microhobby commented May 17, 2023

For the Qt6 we need to wait until we have the packages build with OpenGL ES support.
This is under WIP by the Toradex Debian Package team.

microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue May 18, 2023
This fixes the build for machines that use a different docker image
with special libs for the specific vendor GPU.

Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
@microhobby
Copy link
Member

microhobby commented May 18, 2023

@tronical Slint supports OpenGL ES? We need to toggle something to work?
I'm trying to run the Slint CPP with the Vivante GPU libraries and I'm getting:

thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: Other("Skia OpenGL Renderer: Failed to create OpenGL Window Surface: not found")', internal/core/window.rs:868:31
stack backtrace:
   0:     0xffff7ffec2e8 - std::backtrace_rs::backtrace::libunwind::trace::h133dba2ec81dba86
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0xffff7ffec2e8 - std::backtrace_rs::backtrace::trace_unsynchronized::hb45230733992545f
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0xffff7ffec2e8 - std::sys_common::backtrace::_print_fmt::h8a874ebe04d394ce
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:65:5
   3:     0xffff7ffec2e8 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h9b87a899c77ef3b5
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:44:22
   4:     0xffff8000cbd0 - core::fmt::write::h061a780c9b6fd754
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/fmt/mod.rs:1232:17
   5:     0xffff7ffe96ac - std::io::Write::write_fmt::h3f1f287b1848cd4f
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/io/mod.rs:1684:15
   6:     0xffff7ffec0f4 - std::sys_common::backtrace::_print::h100b30670f353331
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:47:5
   7:     0xffff7ffec0f4 - std::sys_common::backtrace::print::h29dfb2146a9553c9
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:34:9
   8:     0xffff7ffed5c4 - std::panicking::default_hook::{{closure}}::h45d6c2261e27eed0
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:271:22
   9:     0xffff7ffed308 - std::panicking::default_hook::h75e1432f64a5032c
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:290:9
  10:     0xffff7ffedb34 - std::panicking::rust_panic_with_hook::h5576bdd7c6e0d8fd
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:692:13
  11:     0xffff7ffeda24 - std::panicking::begin_panic_handler::{{closure}}::h4280476b458722ea
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:583:13
  12:     0xffff7ffec734 - std::sys_common::backtrace::__rust_end_short_backtrace::hb9c75d0d66f9b0dd
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/sys_common/backtrace.rs:150:18
  13:     0xffff7ffed770 - rust_begin_unwind
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/std/src/panicking.rs:579:5
  14:     0xffff7f60609c - core::panicking::panic_fmt::h727e74184e222656
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/panicking.rs:64:14
  15:     0xffff7f6063d4 - core::result::unwrap_failed::hdae050f7658acc01
                               at /rustc/84c898d65adf2f39a5a98507f1fe0ce10a2b8dbc/library/core/src/result.rs:1750:5
  16:     0xffff7fde46a4 - slint_windowrc_show
  17:     0xaaaad11f5158 - _ZNK5slint11private_api15WindowAdapterRc4showEv
                               at /usr/include/slint/slint.h:112:44
  18:     0xaaaad11f5298 - _ZN5slint6Window4showEv
                               at /usr/include/slint/slint.h:421:29
  19:     0xaaaad11fcbb4 - _ZN9AppWindow4showEv
                               at /app/build/arm64/appwindow.h:4660:18
  20:     0xaaaad11fcc08 - _ZN9AppWindow3runEv
                               at /app/build/arm64/appwindow.h:4672:9
  21:     0xaaaad11f3164 - main
                               at /app/src/main.cpp:15:12
  22:     0xffff7f137780 - <unknown>
  23:     0xffff7f137858 - __libc_start_main
  24:     0xaaaad11f2f70 - _start
  25:                0x0 - <unknown>
Aborted (core dumped)

@tronical
Copy link
Contributor

Yes, it uses EGL and GLESv2. Both libraries are opened dynamically at run-time. The error message suggests that libEGL.so could not be found on the system (at runtime).

I’ve run this code before on the vivante containers before without issues. Were there any changes?

@microhobby
Copy link
Member

I’ve run this code before on the vivante containers before without issues. Were there any changes?

Yes, the previous version probably was using software renderer, because we are not passing the -vivante GPU prefix to get the right Docker Image with the proprietary vendor libraries.

The Slint template from here: https://github.com/microhobby/vscode-torizon-templates/commits/gpu-prefix is the repo that we are working to fix this.

@microhobby
Copy link
Member

@tronical Yeah, there is an issue on my Dockerfile.debug that was not installing the Vivante libs correctly. Now I'm able to run the app with HW acceleration. Thanks!

@tronical
Copy link
Contributor

I’ve run this code before on the vivante containers before without issues. Were there any changes?

Yes, the previous version probably was using software renderer, because we are not passing the -vivante GPU prefix to get the right Docker Image with the proprietary vendor libraries.

I mean here for example: https://github.com/slint-ui/slint/pkgs/container/slint%2Ftorizon-demos-arm64-vivante

Based on https://github.com/slint-ui/slint/blob/master/docker/Dockerfile.torizon-demos

The Slint template from here: https://github.com/microhobby/vscode-torizon-templates/commits/gpu-prefix is the repo that we are working to fix this.

Thx. I can take a look at that next week.

@tronical
Copy link
Contributor

@tronical Yeah, there is an issue on my Dockerfile.debug that was not installing the Vivante libs correctly. Now I'm able to run the app with HW acceleration. Thanks!

Ah Great :)

microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue May 18, 2023
This fixes the build for machines that use a different docker image
with special libs for the specific vendor GPU.

Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue May 18, 2023
This is useful for machines that use proprietary GPU drivers and
libraries.

Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue May 18, 2023
This fixes the build for machines that use a different docker image
with special libs for the specific vendor GPU.

Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
@microhobby microhobby added the Torizon 6.x.y Improve support to Torizon 6.x.y label May 18, 2023
microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue May 19, 2023
This fixes the build for machines that use a different docker image
with special libs for the specific vendor GP

Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue May 19, 2023
This fixes the build for machines that use a different docker image
with special libs for the specific vendor GP

Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue May 19, 2023
Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue May 20, 2023
This fixes the build for machines that use a different docker image
with special libs for the specific vendor GPU.

Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue May 20, 2023
This fixes the build for machines that use a different docker image
with special libs for the specific vendor GPU.

NOTE: The Avalonia GTK uses XWayland, anyway, this should not
work with the Vivante GPU.

Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue May 21, 2023
This fixes the build for machines that use a different docker image
with special libs for the specific vendor GPU.

NOTE: The Avalonia GTK uses XWayland, anyway, this should not
work with the Vivante GPU.

Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue May 21, 2023
This fixes the build for machines that use a different docker image
with special libs for the specific vendor GPU.

NOTE: The Avalonia GTK uses XWayland, anyway, this should not
work with the Vivante GPU.

Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue May 21, 2023
This fixes the build for machines that use a different docker image
with special libs for the specific vendor GPU.

Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue May 21, 2023
This fixes the build for machines that use a different docker image
with special libs for the specific vendor GPU.

Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue May 21, 2023
This fixes the build for machines that use a different docker image
with special libs for the specific vendor GPU.

Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue May 22, 2023
Uno Platform does not support openGL ES 2.0, so does not make
sense to have this flags in launch.json for now.

Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>

diff --git a/dotnetUno/.vscode/launch.json b/dotnetUno/.vscode/launch.json
index 7617fed..f6c304e 100644
--- a/dotnetUno/.vscode/launch.json
+++ b/dotnetUno/.vscode/launch.json
@@ -8,7 +8,7 @@
       // Use IntelliSense to find out which attributes exist for C# debugging
       // Use hover for the description of the existing attributes
       // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
-      "name": "Skia.GTK openGL",
+      "name": "Debug Local",
       "type": "coreclr",
       "request": "launch",
       "preLaunchTask": "build-torizon-local",
@@ -18,28 +18,6 @@
       "env": {
         "DOTNET_MODIFIABLE_ASSEMBLIES": "debug",
         "GDK_BACKEND": "x11",
-        "UNO_DISABLE_OPENGL": "false",
-        "UNO_FULLSCREEN": "false"
-      },
-      "cwd": "${workspaceFolder}/__change__.Skia.Gtk",
-      // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
-      "console": "internalConsole",
-      "stopAtEntry": false
-    },
-    {
-      // Use IntelliSense to find out which attributes exist for C# debugging
-      // Use hover for the description of the existing attributes
-      // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
-      "name": "Skia.GTK noGL",
-      "type": "coreclr",
-      "request": "launch",
-      "preLaunchTask": "build-torizon-local",
-      // If you have changed target frameworks, make sure to update the program path.
-      "program": "${workspaceFolder}/__change__.Skia.Gtk/bin/Debug/net6.0/__change__.Skia.Gtk.dll",
-      "args": [],
-      "env": {
-        "DOTNET_MODIFIABLE_ASSEMBLIES": "debug",
-        "UNO_DISABLE_OPENGL": "true",
         "UNO_FULLSCREEN": "false"
       },
       "cwd": "${workspaceFolder}/__change__.Skia.Gtk",
@@ -58,8 +36,6 @@
       "env": {
         "DOTNET_MODIFIABLE_ASSEMBLIES": "debug",
         //"GDK_BACKEND": "x11",
-        //"GDK_GL": "gles",
-        "UNO_DISABLE_OPENGL": "true",
         "UNO_FULLSCREEN": "true"
       },
       "args": [],
@@ -94,7 +70,6 @@
       "env": {
         "DOTNET_MODIFIABLE_ASSEMBLIES": "debug",
         // "GDK_BACKEND": "x11",
-        "UNO_DISABLE_OPENGL": "true",
         "UNO_FULLSCREEN": "true"
       },
       "args": [],
@@ -130,7 +105,6 @@
         "DOTNET_MODIFIABLE_ASSEMBLIES": "debug",
         //"GDK_BACKEND": "x11",
         //"GDK_GL": "gles",
-        "UNO_DISABLE_OPENGL": "true",
         "UNO_FULLSCREEN": "true"
       },
       "args": [],
diff --git a/dotnetUno/__change__.Skia.Gtk/Program.cs b/dotnetUno/__change__.Skia.Gtk/Program.cs
index caf2e7d..cca7b89 100644
--- a/dotnetUno/__change__.Skia.Gtk/Program.cs
+++ b/dotnetUno/__change__.Skia.Gtk/Program.cs
@@ -15,16 +15,8 @@ namespace __change__.Skia.Gtk
 			};

 			var host = new GtkHost(() => new App(), args);
-
-			if (!Environment.GetEnvironmentVariable("UNO_DISABLE_OPENGL")
-				.Equals("true"))
-			{
-				host.RenderSurfaceType = RenderSurfaceType.OpenGL;
-			}
-			else
-			{
-				host.RenderSurfaceType = RenderSurfaceType.Software;
-			}
+			// FIXME: if your machine supports openGL remove this
+			host.RenderSurfaceType = RenderSurfaceType.Software;

 			host.Run();
 		}
microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue May 22, 2023
If we are not using the downstream Vivante GPU drivers we need to
install the mesa drivers to have OpenGL support.

Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit that referenced this issue Jun 13, 2023
This fixes the build for machines that use a different docker image
with special libs for the specific vendor GPU.

Related-to: #51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit that referenced this issue Jun 13, 2023
This fixes the build for machines that use a different docker image
with special libs for the specific vendor GP

Related-to: #51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit that referenced this issue Jun 13, 2023
Related-to: #51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit that referenced this issue Jun 13, 2023
This fixes the build for machines that use a different docker image
with special libs for the specific vendor GPU.

Related-to: #51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit that referenced this issue Jun 13, 2023
This fixes the build for machines that use a different docker image
with special libs for the specific vendor GPU.

NOTE: The Avalonia GTK uses XWayland, anyway, this should not
work with the Vivante GPU.

Related-to: #51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit that referenced this issue Jun 13, 2023
This fixes the build for machines that use a different docker image
with special libs for the specific vendor GPU.

Related-to: #51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit that referenced this issue Jun 13, 2023
This fixes the build for machines that use a different docker image
with special libs for the specific vendor GPU.

Related-to: #51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit that referenced this issue Jun 13, 2023
Uno Platform does not support openGL ES 2.0, so does not make
sense to have this flags in launch.json for now.

Related-to: #51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>

diff --git a/dotnetUno/.vscode/launch.json b/dotnetUno/.vscode/launch.json
index 7617fed..f6c304e 100644
--- a/dotnetUno/.vscode/launch.json
+++ b/dotnetUno/.vscode/launch.json
@@ -8,7 +8,7 @@
       // Use IntelliSense to find out which attributes exist for C# debugging
       // Use hover for the description of the existing attributes
       // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
-      "name": "Skia.GTK openGL",
+      "name": "Debug Local",
       "type": "coreclr",
       "request": "launch",
       "preLaunchTask": "build-torizon-local",
@@ -18,28 +18,6 @@
       "env": {
         "DOTNET_MODIFIABLE_ASSEMBLIES": "debug",
         "GDK_BACKEND": "x11",
-        "UNO_DISABLE_OPENGL": "false",
-        "UNO_FULLSCREEN": "false"
-      },
-      "cwd": "${workspaceFolder}/__change__.Skia.Gtk",
-      // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
-      "console": "internalConsole",
-      "stopAtEntry": false
-    },
-    {
-      // Use IntelliSense to find out which attributes exist for C# debugging
-      // Use hover for the description of the existing attributes
-      // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
-      "name": "Skia.GTK noGL",
-      "type": "coreclr",
-      "request": "launch",
-      "preLaunchTask": "build-torizon-local",
-      // If you have changed target frameworks, make sure to update the program path.
-      "program": "${workspaceFolder}/__change__.Skia.Gtk/bin/Debug/net6.0/__change__.Skia.Gtk.dll",
-      "args": [],
-      "env": {
-        "DOTNET_MODIFIABLE_ASSEMBLIES": "debug",
-        "UNO_DISABLE_OPENGL": "true",
         "UNO_FULLSCREEN": "false"
       },
       "cwd": "${workspaceFolder}/__change__.Skia.Gtk",
@@ -58,8 +36,6 @@
       "env": {
         "DOTNET_MODIFIABLE_ASSEMBLIES": "debug",
         //"GDK_BACKEND": "x11",
-        //"GDK_GL": "gles",
-        "UNO_DISABLE_OPENGL": "true",
         "UNO_FULLSCREEN": "true"
       },
       "args": [],
@@ -94,7 +70,6 @@
       "env": {
         "DOTNET_MODIFIABLE_ASSEMBLIES": "debug",
         // "GDK_BACKEND": "x11",
-        "UNO_DISABLE_OPENGL": "true",
         "UNO_FULLSCREEN": "true"
       },
       "args": [],
@@ -130,7 +105,6 @@
         "DOTNET_MODIFIABLE_ASSEMBLIES": "debug",
         //"GDK_BACKEND": "x11",
         //"GDK_GL": "gles",
-        "UNO_DISABLE_OPENGL": "true",
         "UNO_FULLSCREEN": "true"
       },
       "args": [],
diff --git a/dotnetUno/__change__.Skia.Gtk/Program.cs b/dotnetUno/__change__.Skia.Gtk/Program.cs
index caf2e7d..cca7b89 100644
--- a/dotnetUno/__change__.Skia.Gtk/Program.cs
+++ b/dotnetUno/__change__.Skia.Gtk/Program.cs
@@ -15,16 +15,8 @@ namespace __change__.Skia.Gtk
 			};

 			var host = new GtkHost(() => new App(), args);
-
-			if (!Environment.GetEnvironmentVariable("UNO_DISABLE_OPENGL")
-				.Equals("true"))
-			{
-				host.RenderSurfaceType = RenderSurfaceType.OpenGL;
-			}
-			else
-			{
-				host.RenderSurfaceType = RenderSurfaceType.Software;
-			}
+			// FIXME: if your machine supports openGL remove this
+			host.RenderSurfaceType = RenderSurfaceType.Software;

 			host.Run();
 		}
microhobby added a commit that referenced this issue Jun 13, 2023
If we are not using the downstream Vivante GPU drivers we need to
install the mesa drivers to have OpenGL support.

Related-to: #51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit that referenced this issue Jun 13, 2023
This fixes the build for machines that use a different docker image
with special libs for the specific vendor GPU.

Related-to: #51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue Jun 13, 2023
This fixes the build for machines that use a different docker image
with special libs for the specific vendor GPU.

Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue Jun 13, 2023
This is useful for machines that use proprietary GPU drivers and
libraries.

Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue Jun 13, 2023
This fixes the build for machines that use a different docker image
with special libs for the specific vendor GPU.

Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue Jun 13, 2023
This fixes the build for machines that use a different docker image
with special libs for the specific vendor GP

Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue Jun 13, 2023
Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue Jun 13, 2023
This fixes the build for machines that use a different docker image
with special libs for the specific vendor GPU.

Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue Jun 13, 2023
This fixes the build for machines that use a different docker image
with special libs for the specific vendor GPU.

NOTE: The Avalonia GTK uses XWayland, anyway, this should not
work with the Vivante GPU.

Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue Jun 13, 2023
This fixes the build for machines that use a different docker image
with special libs for the specific vendor GPU.

Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue Jun 13, 2023
This fixes the build for machines that use a different docker image
with special libs for the specific vendor GPU.

Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue Jun 13, 2023
Uno Platform does not support openGL ES 2.0, so does not make
sense to have this flags in launch.json for now.

Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>

diff --git a/dotnetUno/.vscode/launch.json b/dotnetUno/.vscode/launch.json
index 7617fed..f6c304e 100644
--- a/dotnetUno/.vscode/launch.json
+++ b/dotnetUno/.vscode/launch.json
@@ -8,7 +8,7 @@
       // Use IntelliSense to find out which attributes exist for C# debugging
       // Use hover for the description of the existing attributes
       // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
-      "name": "Skia.GTK openGL",
+      "name": "Debug Local",
       "type": "coreclr",
       "request": "launch",
       "preLaunchTask": "build-torizon-local",
@@ -18,28 +18,6 @@
       "env": {
         "DOTNET_MODIFIABLE_ASSEMBLIES": "debug",
         "GDK_BACKEND": "x11",
-        "UNO_DISABLE_OPENGL": "false",
-        "UNO_FULLSCREEN": "false"
-      },
-      "cwd": "${workspaceFolder}/__change__.Skia.Gtk",
-      // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
-      "console": "internalConsole",
-      "stopAtEntry": false
-    },
-    {
-      // Use IntelliSense to find out which attributes exist for C# debugging
-      // Use hover for the description of the existing attributes
-      // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
-      "name": "Skia.GTK noGL",
-      "type": "coreclr",
-      "request": "launch",
-      "preLaunchTask": "build-torizon-local",
-      // If you have changed target frameworks, make sure to update the program path.
-      "program": "${workspaceFolder}/__change__.Skia.Gtk/bin/Debug/net6.0/__change__.Skia.Gtk.dll",
-      "args": [],
-      "env": {
-        "DOTNET_MODIFIABLE_ASSEMBLIES": "debug",
-        "UNO_DISABLE_OPENGL": "true",
         "UNO_FULLSCREEN": "false"
       },
       "cwd": "${workspaceFolder}/__change__.Skia.Gtk",
@@ -58,8 +36,6 @@
       "env": {
         "DOTNET_MODIFIABLE_ASSEMBLIES": "debug",
         //"GDK_BACKEND": "x11",
-        //"GDK_GL": "gles",
-        "UNO_DISABLE_OPENGL": "true",
         "UNO_FULLSCREEN": "true"
       },
       "args": [],
@@ -94,7 +70,6 @@
       "env": {
         "DOTNET_MODIFIABLE_ASSEMBLIES": "debug",
         // "GDK_BACKEND": "x11",
-        "UNO_DISABLE_OPENGL": "true",
         "UNO_FULLSCREEN": "true"
       },
       "args": [],
@@ -130,7 +105,6 @@
         "DOTNET_MODIFIABLE_ASSEMBLIES": "debug",
         //"GDK_BACKEND": "x11",
         //"GDK_GL": "gles",
-        "UNO_DISABLE_OPENGL": "true",
         "UNO_FULLSCREEN": "true"
       },
       "args": [],
diff --git a/dotnetUno/__change__.Skia.Gtk/Program.cs b/dotnetUno/__change__.Skia.Gtk/Program.cs
index caf2e7d..cca7b89 100644
--- a/dotnetUno/__change__.Skia.Gtk/Program.cs
+++ b/dotnetUno/__change__.Skia.Gtk/Program.cs
@@ -15,16 +15,8 @@ namespace __change__.Skia.Gtk
 			};

 			var host = new GtkHost(() => new App(), args);
-
-			if (!Environment.GetEnvironmentVariable("UNO_DISABLE_OPENGL")
-				.Equals("true"))
-			{
-				host.RenderSurfaceType = RenderSurfaceType.OpenGL;
-			}
-			else
-			{
-				host.RenderSurfaceType = RenderSurfaceType.Software;
-			}
+			// FIXME: if your machine supports openGL remove this
+			host.RenderSurfaceType = RenderSurfaceType.Software;

 			host.Run();
 		}
microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue Jun 13, 2023
If we are not using the downstream Vivante GPU drivers we need to
install the mesa drivers to have OpenGL support.

Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
microhobby added a commit to microhobby/vscode-torizon-templates that referenced this issue Jun 13, 2023
This fixes the build for machines that use a different docker image
with special libs for the specific vendor GPU.

Related-to: toradex#51
Signed-off-by: Matheus Castello <matheus.castello@toradex.com>
@microhobby microhobby added this to the v2.2.0 milestone Aug 23, 2023
@microhobby microhobby modified the milestones: v2.2.0, v2.3.0 Sep 13, 2023
@microhobby
Copy link
Member

We are moving it to the next development cycle because the Vivante GPU stuff is not ready yet from the Torizon Containers and packaging side.

@microhobby
Copy link
Member

with the merge of #125 this can be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request Torizon 6.x.y Improve support to Torizon 6.x.y
Projects
None yet
3 participants