Skip to content

Conversation

@xiaowei-guan
Copy link
Contributor

@xiaowei-guan xiaowei-guan commented Aug 14, 2025

Because vulkan libs are not included in the binary by default. we need to install vulkan libs before run vulkan app on device.
How to set vulkan for Tizen device:

  1. Check if your target already has Vulkan driver.
    RPI4 hreaded image already has vulkan driver, no need to install to the target.
    For TV image, you need to install vulkan driver manually to the target.
  2. Download below rpms from where the image packages are.
    vulkan-loader
    vulkan-tools
    vulkan-wsi-layer
  3. Install rpms:
    rpm -Uvh --force --nodeps *.rpm
  4. Check vulkan
    vulkaninfo or vkcube

I can run vulkan backend app on RPI4.
Because the vulkan driver on TV is not stable, I can only run vulkan backend app on Tizen 8.0 with old version dirver.

@xiaowei-guan xiaowei-guan marked this pull request as draft August 14, 2025 05:53
@JSUYA JSUYA self-requested a review August 14, 2025 07:47
@xiaowei-guan
Copy link
Contributor Author

@JSUYA Do you konw how to fix unittests build error?

@JSUYA
Copy link
Member

JSUYA commented Aug 26, 2025

@JSUYA Do you konw how to fix unittests build error?

I will look into it.

@JSUYA
Copy link
Member

JSUYA commented Aug 27, 2025

+) #113

@JSUYA
Copy link
Member

JSUYA commented Aug 27, 2025

+) #113

@xiaowei-guan
I found that the common profile image doesn't include Vulkan.
Has the Vulkan renderer been tested on the RPI? Do we need to install a separate rpm?

https://download.tizen.org/releases/milestone/TIZEN/Tizen/Tizen-Unified/tizen-unified_20221017.061100/images/standard/tizen-headed-armv7l/tizen-unified_20221017.061100_tizen-headed-armv7l.packages

1.Fix spelling issues.
2.Do not need to destroy swapchain image when destory the renderer.
3.Replace memset with zero-init.
4.Free command buffer when begin command buffer or end command buffer
failed.
5.Fix return wrong api version issue.
@JSUYA
Copy link
Member

JSUYA commented Aug 27, 2025

+) #113

@xiaowei-guan I found that the common profile image doesn't include Vulkan. Has the Vulkan renderer been tested on the RPI? Do we need to install a separate rpm?

https://download.tizen.org/releases/milestone/TIZEN/Tizen/Tizen-Unified/tizen-unified_20221017.061100/images/standard/tizen-headed-armv7l/tizen-unified_20221017.061100_tizen-headed-armv7l.packages

The problem was solved with the help of @swift-kim.

@xiaowei-guan
Copy link
Contributor Author

+) #113

@xiaowei-guan I found that the common profile image doesn't include Vulkan. Has the Vulkan renderer been tested on the RPI? Do we need to install a separate rpm?
https://download.tizen.org/releases/milestone/TIZEN/Tizen/Tizen-Unified/tizen-unified_20221017.061100/images/standard/tizen-headed-armv7l/tizen-unified_20221017.061100_tizen-headed-armv7l.packages

The problem was solved with the help of @swift-kim.

@JSUYA Yes, if we want to run vulkan app on RPI4, we need to install vulkan related rpm files.

@swift-kim @JSUYA Thank you, the issue has been fixed.

@xiaowei-guan xiaowei-guan marked this pull request as ready for review August 28, 2025 05:27
@xiaowei-guan
Copy link
Contributor Author

@JSUYA Can you review the code?

@JSUYA
Copy link
Member

JSUYA commented Sep 26, 2025

@xiaowei-guan
I tested this on TV (Tizen 9.0 (20250808) + libvulkan) and RPI (Tizen 10.0).

On TV, it failed to create a vk instance.
I searched for the keyword “vulkan” in the dlog, but there were no separate logs.
Are there any minimum requirements for using the Vulkan renderer?

E/ConsoleMessage( 6924): tizen_renderer_vulkan.cc: CreateInstance(217) > Create instance failed.
E/ConsoleMessage( 6924): tizen_renderer_vulkan.cc: InitVulkan(48) > Failed to create Vulkan instance
E/ConsoleMessage( 6924): flutter_tizen_engine.cc: RunEngine(114) > The display was not valid.
I/ConsoleMessage( 6924): [GC_INFO] GC_Start #1: Gen(0), Time(16151861 ms), Reason(0)
I/ConsoleMessage( 6924): [GC_INFO] GC_End #1: Gen(0), Time(16151862 ms)
E/ConsoleMessage( 6924): FlutterApplication.cs: Run(128) > Unhandled exception: System.Exception: Could not launch a Flutter application.
E/ConsoleMessage( 6924):    at Tizen.Flutter.Embedding.FlutterApplication.OnCreate() in /home/junsu/dev/os/f-project/flutter-tizen/embedding/csharp/Tizen.Flutter.Embedding/FlutterApplication.cs:line 187
E/ConsoleMessage( 6924):    at Runner.App.OnCreate() in /home/junsu/dev/os/f-project/plugins/packages/video_player/example/tizen/App.cs:line 10
E/ConsoleMessage( 6924):    at Tizen.Applications.CoreBackend.UICoreBackend.OnCreateNative(IntPtr data) in /home/abuild/rpmbuild/BUILD/csapi-tizenfx-12.0.0.18559+nui22351/src/Tizen.Applications.UI/Tizen.Applications.CoreBackend/UICoreBackend.cs:line 156
E/ConsoleMessage( 6924): DotNET onSigabrt called on org.tizen.video_player_tizen_example / DN_izen_example(6924)
E/ConsoleMessage( 6924): onSigabrt called

And since libvulkan is not included in the binary by default, merging vulkan PRs for the embedder and engine will prevent Flutter apps from running in the basic Common Headed Profile.
I think, libvulkan must be dynamically loaded or it must only be supported on TVs using the TV_PROFILE macro. What do you think?


std::unique_ptr<ExternalTexture> TizenRendererVulkan::CreateExternalTexture(
const FlutterDesktopTextureInfo* texture_info) {
return nullptr;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question
External texture is not supported?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have finished code of External texture:

  1. Engine PR : [Tizen] Support render texture for vulkan + impeller flutter#17
  2. Embedder code : xiaowei-guan@6a94746
    After vulkan backend PR released, I will create a new PR for texture.

@JSUYA
Copy link
Member

JSUYA commented Oct 1, 2025

RPI4 hreaded image already has vulkan driver, no need to install to the target.

@xiaowei-guan

In tizen repo, the vulkan so files are uploaded, but they are not actually included in the image binary.
https://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Unified/latest/repos/standard/packages/armv7l/
https://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Unified/latest/images/standard/tizen-headed-armv7l/tizen-unified_20250930.210858_tizen-headed-armv7l.packages

Therefore, unless user install the RPI binary and separately install libvulkan, user cannot run a Flutter app even if they do not use the EVulkan renderer.

How about additionally releasing libflutter_tizen.so that supports the Vulkan renderer?
Maybe you can release an artifact with the _experimental suffix in releases.
In the embedder, you can isolate the Vulkan renderer code using macros like FLUTTER_TIZEN_EXPERIMENTAL.

For example...
tizen-6.x-arm_experimental.zip
tizen-6.x-arm_experimental_symbols.zip

The flutter-tizen tool can download experimental artifacts to the cache and load experimental SO files using predefined settings or separate flags. (Ex flutter-tizen run --dart-define=USE_FLUTTER_TIZEN_EXPERIMENTAL ?)

please suggest better approaches if you have them.

@xiaowei-guan
Copy link
Contributor Author

@xiaowei-guan I tested this on TV (Tizen 9.0 (20250808) + libvulkan) and RPI (Tizen 10.0).

On TV, it failed to create a vk instance. I searched for the keyword “vulkan” in the dlog, but there were no separate logs. Are there any minimum requirements for using the Vulkan renderer?

E/ConsoleMessage( 6924): tizen_renderer_vulkan.cc: CreateInstance(217) > Create instance failed.
E/ConsoleMessage( 6924): tizen_renderer_vulkan.cc: InitVulkan(48) > Failed to create Vulkan instance
E/ConsoleMessage( 6924): flutter_tizen_engine.cc: RunEngine(114) > The display was not valid.
I/ConsoleMessage( 6924): [GC_INFO] GC_Start #1: Gen(0), Time(16151861 ms), Reason(0)
I/ConsoleMessage( 6924): [GC_INFO] GC_End #1: Gen(0), Time(16151862 ms)
E/ConsoleMessage( 6924): FlutterApplication.cs: Run(128) > Unhandled exception: System.Exception: Could not launch a Flutter application.
E/ConsoleMessage( 6924):    at Tizen.Flutter.Embedding.FlutterApplication.OnCreate() in /home/junsu/dev/os/f-project/flutter-tizen/embedding/csharp/Tizen.Flutter.Embedding/FlutterApplication.cs:line 187
E/ConsoleMessage( 6924):    at Runner.App.OnCreate() in /home/junsu/dev/os/f-project/plugins/packages/video_player/example/tizen/App.cs:line 10
E/ConsoleMessage( 6924):    at Tizen.Applications.CoreBackend.UICoreBackend.OnCreateNative(IntPtr data) in /home/abuild/rpmbuild/BUILD/csapi-tizenfx-12.0.0.18559+nui22351/src/Tizen.Applications.UI/Tizen.Applications.CoreBackend/UICoreBackend.cs:line 156
E/ConsoleMessage( 6924): DotNET onSigabrt called on org.tizen.video_player_tizen_example / DN_izen_example(6924)
E/ConsoleMessage( 6924): onSigabrt called

And since libvulkan is not included in the binary by default, merging vulkan PRs for the embedder and engine will prevent Flutter apps from running in the basic Common Headed Profile. I think, libvulkan must be dynamically loaded or it must only be supported on TVs using the TV_PROFILE macro. What do you think?

As I konw, all tizen device profile has included vulkan, but the

RPI4 hreaded image already has vulkan driver, no need to install to the target.

@xiaowei-guan

In tizen repo, the vulkan so files are uploaded, but they are not actually included in the image binary. https://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Unified/latest/repos/standard/packages/armv7l/ https://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Unified/latest/images/standard/tizen-headed-armv7l/tizen-unified_20250930.210858_tizen-headed-armv7l.packages

Therefore, unless user install the RPI binary and separately install libvulkan, user cannot run a Flutter app even if they do not use the EVulkan renderer.

How about additionally releasing libflutter_tizen.so that supports the Vulkan renderer? Maybe you can release an artifact with the _experimental suffix in releases. In the embedder, you can isolate the Vulkan renderer code using macros like FLUTTER_TIZEN_EXPERIMENTAL.

For example... tizen-6.x-arm_experimental.zip tizen-6.x-arm_experimental_symbols.zip

The flutter-tizen tool can download experimental artifacts to the cache and load experimental SO files using predefined settings or separate flags. (Ex flutter-tizen run --dart-define=USE_FLUTTER_TIZEN_EXPERIMENTAL ?)

please suggest better approaches if you have them.

Ok

xiaowei-guan added a commit to flutter-tizen/flutter that referenced this pull request Oct 11, 2025
Add new struct FlutterVulkanTexture  for embedder :
```
typedef struct {
  /// Handle to the VkImage that is owned by the embedder. The engine will
  /// bind this image for writing the frame.
  FlutterVulkanImageHandle image;
  /// The VkDeviceMemory that backs the iamge.
  FlutterVulkanDeviceMemoryHandle image_memory;
  /// The VkFormat of the image (for example: VK_FORMAT_R8G8B8A8_UNORM).
  uint32_t format;
  /// User data to be returned on the invocation of the destruction callback.
  void* user_data;
  /// Callback invoked (on an engine managed thread) that asks the embedder to
  /// collect the texture.
  VoidCallback destruction_callback;
  /// Optional parameters for texture height/width, default is 0, non-zero means
  /// the texture has the specified width/height.
  /// Width of the texture.
  size_t width;
  /// Height of the texture.
  size_t height;
} FlutterVulkanTexture;
```
The implement of [texture
source](https://github.com/flutter-tizen/flutter/pull/17/files#diff-7955a8522a753162869f2e8ca0017a83f4854b60800c844202e70c3aa00ff0c9R5-R204)
refer to the solution of android
platform(https://github.com/flutter-tizen/flutter/blob/flutter-3.35.3/engine/src/flutter/impeller/renderer/backend/vulkan/android/ahb_texture_source_vk.cc)

and I have submitted the code [Support render texture for
embedder](xiaowei-guan/embedder@6a94746),
I will create a new PR after[ support vulkan
backend](flutter-tizen/embedder#110) PR
released.
@xiaowei-guan
Copy link
Contributor Author

#15

Comment on lines +254 to +259
embedder("flutter_tizen_common_experimental") {
target_type = "shared_library"

defines = [ "COMMON_PROFILE" ]
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to test libflutter_tizen_common_experimental.so on an RPi4 with the Vulkan library installed.

I renamed libflutter_tizen_common_experimental.so to libflutter_tizen_common.so in the path flutter/bin/cache/artifacts/engine/tizen-arm/6.5.

c# hostapp ran the Vulkan renderer app normally.
However, c++ hostapp displayed the error message below. Do you know the cause?

E/STDERR_pkgmgr-server( 8385): [EXEC_CHECKER_PLUGIN_PARSER][ERROR] Not found library (	libflutter_tizen_common_experimental.so)
E/STDERR  ( 8112): /opt/usr/globalapps/com.example.test_cpp_6/bin/runner: error while loading shared libraries: libflutter_tizen_common_experimental.so: cannot open shared object file: No such file or directory

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, I can't reproduce this issue:
below are my steps:

 2025  cp ../embedder/src/out/tizen_arm_6.5/libflutter_tizen_common_experimental.so ../flutter-tizen/flutter/bin/cache/artifacts/engine/tizen-arm/6.5/libflutter_tizen_common.so
 2026  sync
 2027  ../flutter-tizen/bin/flutter-tizen clean
 2028  ../flutter-tizen/bin/flutter-tizen run  --enable-impeller

and logs:

guanxw@samsung10022:~/flutter-tizen-3.35.3/sample$ ../flutter-tizen/bin/flutter-tizen run  --enable-impeller
Launching tizen/flutter/generated_main.dart on Tizen rpi4 in debug mode...
The partner profile is used for signing.
Building a Tizen application in debug mode...                      24.3s
✓ Built build/tizen/tpk/com.example.sample-1.0.0.tpk (30.1MB)
Installing build/tizen/tpk/com.example.sample-1.0.0.tpk...         19.4s
[E] [WARNING:flutter/impeller/renderer/backend/vulkan/driver_info_vk.cc(263)] Unknown GPU Driver Vendor: 5348. This is not an error.
[IMPORTANT:flutter/shell/platform/embedder/embedder_surface_vulkan_impeller.cc(80)] Using the Impeller rendering backend (Vulkan).
Syncing files to device Tizen rpi4...                               57ms

Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

A Dart VM Service on Tizen rpi4 is available at: http://127.0.0.1:43323/LoQ0Sh-iQZs=/
The Flutter DevTools debugger and profiler on Tizen rpi4 is available at: http://127.0.0.1:9101?uri=http://127.0.0.1:43323/LoQ0Sh-iQZs=/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants