canonical / iot-example-graphical-snap

Developer Guide for Embedding IoT GUI with Ubuntu Frame
MIT License
22 stars 11 forks source link

Unable to run flutterdemo with frame-it, the window closes immediately after launch #29

Open resilem opened 6 months ago

resilem commented 6 months ago

Hello,

I am following the instructions for Packaging a Flutter application (Demo) as an IoT GUI on an x86-64 Ubuntu Desktop 22.04 host and running into an issue when running the snap. I followed the directions exactly:

  1. Cloned the repository
  2. Checked out the Flutter-demo branch
  3. Created the snap using the snapcraft command
  4. Installed the snap
  5. Ran the setup.sh script
  6. Ran the snap with frame-it

A window is briefly displayed on the screen before being closed almost immediately. The output is as follows:

+ [ /snap/ubuntu-frame/8587/bin/run-frame = --help ]
+ mkdir -p /home/<username>/snap/ubuntu-frame/8587/.config/
+ grep -vE (^vt=|^console-provider=vt) /var/snap/ubuntu-frame/8587/frame.config
+ rm -f /home/<username>/snap/ubuntu-frame/8587/.config/frame.display
+ cp /var/snap/ubuntu-frame/8587/frame.display /home/<username>/snap/ubuntu-frame/8587/.config/
cp: cannot stat '/var/snap/ubuntu-frame/8587/frame.display': No such file or directory
+ true
+ exec /snap/ubuntu-frame/8587/bin/run-frame /snap/ubuntu-frame/8587/bin/graphics-core22-wrapper /snap/ubuntu-frame/8587/usr/local/bin/frame
+ [ /snap/ubuntu-frame/8587/bin/graphics-core22-wrapper = --help ]
+ dirname /run/user/1000/snap.ubuntu-frame
+ XDG_RUNTIME_DIR=/run/user/1000
+ export XDG_RUNTIME_DIR
+ mkdir -p /run/user/1000 -m 700
+ [ -n wayland-0 ]
+ [ -e /run/user/1000/wayland-0 ]
+ exec /snap/ubuntu-frame/8587/bin/graphics-core22-wrapper /snap/ubuntu-frame/8587/usr/local/bin/frame
[2024-03-11 11:13:49.499537] <information> mirserver: Starting
[2024-03-11 11:13:49.499591] < - debug - > mirserver: Not trying logind: "DISPLAY" is set and X need not have claimed the VT
[2024-03-11 11:13:49.499625] < - debug - > mirserver: Not using Linux VT subsystem for session management: Failed to find the current VT
[2024-03-11 11:13:49.499632] < - debug - > mirserver: No session management supported
[2024-03-11 11:13:49.499641] <information> VT switch key handler: No VT switching support available: MinimalConsoleServices does not support VT switching
[2024-03-11 11:13:49.499691] <information> mircommon: Loading modules from: /snap/ubuntu-frame/8587/usr/lib/x86_64-linux-gnu/mir/server-platform
[2024-03-11 11:13:49.499707] <information> mircommon: Loading module: /snap/ubuntu-frame/8587/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-eglstream-kms.so.21
[2024-03-11 11:13:49.499713] <information> mircommon: Loading module: /snap/ubuntu-frame/8587/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-gbm-kms.so.21
[2024-03-11 11:13:49.499717] <information> mircommon: Loading module: /snap/ubuntu-frame/8587/usr/lib/x86_64-linux-gnu/mir/server-platform/renderer-egl-generic.so.21
[2024-03-11 11:13:49.499720] <information> mircommon: Loading module: /snap/ubuntu-frame/8587/usr/lib/x86_64-linux-gnu/mir/server-platform/server-x11.so.21
[2024-03-11 11:13:49.499723] <information> mircommon: Loading module: /snap/ubuntu-frame/8587/usr/lib/x86_64-linux-gnu/mir/server-platform/input-evdev.so.8
[2024-03-11 11:13:49.500107] <information> mirserver: Found display driver: mir:eglstream-kms (version 2.16.3)
[2024-03-11 11:13:50.947177] < - debug - > eglstream: Found EGLDeviceEXT with device extensions: EGL_NV_device_cuda EGL_EXT_device_drm EGL_EXT_device_drm_render_node EGL_EXT_device_query_name EGL_EXT_device_persistent_id
[2024-03-11 11:13:50.947368] <information> eglstream: KMS support found, but device has no output hardware.
[2024-03-11 11:13:50.947373] <information> eglstream: This is probably a render-only hybrid graphics device
[2024-03-11 11:13:50.947388] < - debug - > eglstream: Found EGLDeviceEXT with device extensions: EGL_EXT_device_drm EGL_EXT_device_drm_render_node
[2024-03-11 11:13:50.947463] <information> eglstream: Failed to query DRM node for EGLDevice: Failed to acquire DRM master: Operation not permitted
[2024-03-11 11:13:50.947467] < - debug - > eglstream: Found EGLDeviceEXT with device extensions: EGL_EXT_device_drm EGL_EXT_device_drm_render_node
[2024-03-11 11:13:50.947503] <information> eglstream: KMS support found, but device has no output hardware.
[2024-03-11 11:13:50.947505] <information> eglstream: This is probably a render-only hybrid graphics device
[2024-03-11 11:13:50.947511] < - debug - > eglstream: Found EGLDeviceEXT with device extensions: EGL_MESA_device_software EGL_EXT_device_drm_render_node
[2024-03-11 11:13:50.947530] <information> eglstream: Failed to query DRM node for EGLDevice: Failed to determine DRM device node path from EGLDevice: EGL_BAD_PARAMETER (0x300c)
[2024-03-11 11:13:50.947535] <information> mirserver: Driver supports:
[2024-03-11 11:13:50.947539] <information> mirserver:   /devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card0 (priority 0)
[2024-03-11 11:13:50.947542] <information> mirserver:   /devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card0 (priority 0)
[2024-03-11 11:13:50.947548] <information> mirserver: Found display driver: mir:gbm-kms (version 2.16.3)
[2024-03-11 11:13:50.948225] < - debug - > gbm-kms: Quirks: checking device with devnode: /dev/dri/card0, driver nvidia
[2024-03-11 11:13:50.948231] <information> gbm-kms: Quirks: skipping device /dev/dri/card0 (matches driver quirk nvidia)
[2024-03-11 11:13:50.948233] <information> gbm-kms: Not probing device /dev/dri/card0 due to specified quirk
[2024-03-11 11:13:50.948272] < - debug - > gbm-kms: Quirks: checking device with devnode: /dev/dri/card1, driver i915
[2024-03-11 11:13:50.948339] <information> gbm-kms: Failed to probe DRM device: ./src/server/console/minimal_console_services.cpp(134): Throw in function virtual std::future<std::unique_ptr<mir::Device> > mir::MinimalConsoleServices::acquire_device(int, int, std::unique_ptr<mir::Device::Observer>)
Dynamic exception type: boost::wrapexcept<std::system_error>
std::exception::what: Failed to acquire DRM master: Operation not permitted

[2024-03-11 11:13:50.948374] < - debug - > gbm-kms: Quirks: checking device with devnode: (null), driver 
[2024-03-11 11:13:50.948404] < - debug - > gbm-kms: Quirks: checking device with devnode: (null), driver 
[2024-03-11 11:13:50.948433] < - debug - > gbm-kms: Quirks: checking device with devnode: (null), driver 
[2024-03-11 11:13:50.948462] < - debug - > gbm-kms: Quirks: checking device with devnode: (null), driver 
[2024-03-11 11:13:50.948492] < - debug - > gbm-kms: Quirks: checking device with devnode: (null), driver 
[2024-03-11 11:13:50.948526] < - debug - > gbm-kms: Quirks: checking device with devnode: (null), driver 
[2024-03-11 11:13:50.948556] < - debug - > gbm-kms: Quirks: checking device with devnode: (null), driver 
[2024-03-11 11:13:50.948597] < - debug - > gbm-kms: Quirks: checking device with devnode: (null), driver 
[2024-03-11 11:13:50.948627] < - debug - > gbm-kms: Quirks: checking device with devnode: (null), driver 
[2024-03-11 11:13:50.948677] <information> mirserver: (Unsupported by system environment)
[2024-03-11 11:13:50.948692] <information> mirserver: Found display driver: mir:egl-generic (version 2.16.3)
[2024-03-11 11:13:50.948717] <information> mirserver: Found display driver: mir:x11 (version 2.16.3)
[2024-03-11 11:13:50.948986] <information> mirserver: Driver supports:
[2024-03-11 11:13:50.948999] <information> mirserver:   System (priority 192)
[2024-03-11 11:13:50.949015] <information> mirserver: Selected display driver: mir:x11 (version 2.16.3) for platform
[2024-03-11 11:13:50.985533] <information> mircommon: Loading modules from: /snap/ubuntu-frame/8587/usr/lib/x86_64-linux-gnu/mir/server-platform
[2024-03-11 11:13:50.985574] <information> mircommon: Loading module: /snap/ubuntu-frame/8587/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-eglstream-kms.so.21
[2024-03-11 11:13:50.985582] <information> mircommon: Loading module: /snap/ubuntu-frame/8587/usr/lib/x86_64-linux-gnu/mir/server-platform/graphics-gbm-kms.so.21
[2024-03-11 11:13:50.985586] <information> mircommon: Loading module: /snap/ubuntu-frame/8587/usr/lib/x86_64-linux-gnu/mir/server-platform/renderer-egl-generic.so.21
[2024-03-11 11:13:50.985589] <information> mircommon: Loading module: /snap/ubuntu-frame/8587/usr/lib/x86_64-linux-gnu/mir/server-platform/server-x11.so.21
[2024-03-11 11:13:50.985592] <information> mircommon: Loading module: /snap/ubuntu-frame/8587/usr/lib/x86_64-linux-gnu/mir/server-platform/input-evdev.so.8
[2024-03-11 11:13:50.986038] <information> mirserver: Found rendering driver: mir:eglstream-kms (version 2.16.3)
[2024-03-11 11:13:50.986047] < - debug - > eglstream: No outputs capable of accepting EGLStream input detected
[2024-03-11 11:13:50.986050] < - debug - > eglstream: Probing will be skipped
[2024-03-11 11:13:50.986052] <information> mirserver: (Unsupported by system environment)
[2024-03-11 11:13:50.986055] <information> mirserver: Found rendering driver: mir:gbm-kms (version 2.16.3)
[2024-03-11 11:13:50.986059] < - debug - > gbm-kms: No outputs capable of accepting GBM input detected
[2024-03-11 11:13:50.986061] < - debug - > gbm-kms: Probing will be skipped
[2024-03-11 11:13:50.986063] <information> mirserver: (Unsupported by system environment)
[2024-03-11 11:13:50.986066] <information> mirserver: Found rendering driver: mir:egl-generic (version 2.16.3)
[2024-03-11 11:13:50.986069] <information> mirserver: Driver supports:
[2024-03-11 11:13:50.986071] <information> mirserver:   System (priority 192)
[2024-03-11 11:13:50.986074] <information> mirserver: Found rendering driver: mir:x11 (version 2.16.3)
[2024-03-11 11:13:50.986099] <information> mirserver: Selected rendering driver: mir:egl-generic (version 2.16.3) for platform
[2024-03-11 11:13:51.208018] < - debug - > x11-error: Detected 60.00Hz host output refresh rate.
[2024-03-11 11:13:51.208067] < - debug - > miral: Display config using layout strategy: 'default'
[2024-03-11 11:13:51.208099] <information> miral: Display config:
8>< ---------------------------------------------------
layouts:
  default:                         # the current layout
    cards:
    # a list of cards (currently matched by card-id)

    - card-id: 0
      OUT-1:
        # This output supports the following modes: 1280x1024@60.0
        #
        # Uncomment the following to enforce the selected configuration.
        # Or amend as desired.
        #
        state: enabled  # {enabled, disabled}, defaults to enabled
        mode: 1280x1024@60.0    # Defaults to preferred mode
        position: [0, 0]    # Defaults to [0, 0]
        orientation: normal # {normal, left, right, inverted}, defaults to normal
        scale: 1
        group: 0    # Outputs with the same non-zero value are treated as a single display
8>< ---------------------------------------------------
[2024-03-11 11:13:51.208129] < - debug - > miral: Display config using layout strategy: 'default'
[2024-03-11 11:13:51.208133] <information> miral: Display config:
8>< ---------------------------------------------------
layouts:
  default:                         # the current layout
    cards:
    # a list of cards (currently matched by card-id)

    - card-id: 0
      unknown-1:
        # This output supports the following modes: 1280x1024@60.0
        #
        # Uncomment the following to enforce the selected configuration.
        # Or amend as desired.
        #
        state: enabled  # {enabled, disabled}, defaults to enabled
        mode: 1280x1024@60.0    # Defaults to preferred mode
        position: [0, 0]    # Defaults to [0, 0]
        orientation: normal # {normal, left, right, inverted}, defaults to normal
        scale: 1
        group: 0    # Outputs with the same non-zero value are treated as a single display
8>< ---------------------------------------------------
[2024-03-11 11:13:51.208187] < - debug - > miral: Wrote display configuration template: /home/<username>/snap/ubuntu-frame/8587/.config/frame.display
xkbcommon: ERROR: couldn't find a Compose file for locale "en_US.UTF-8" (mapped to "en_US.UTF-8")
[2024-03-11 11:13:51.209256] <information> mirserver: Using software cursor
[2024-03-11 11:13:51.209417] <information> gbm-kms-buffer-allocator: Enabled linux-dmabuf import support
[2024-03-11 11:13:51.213138] <information> mirserver: Selected input driver: mir:x11-input (version: 2.16.3)
[2024-03-11 11:13:51.213259] <information> mirserver: Mir version 2.16.3
[2024-03-11 11:13:51.214790] <information> GLRenderer: EGL vendor: Mesa Project
[2024-03-11 11:13:51.214813] <information> GLRenderer: EGL version: 1.5
[2024-03-11 11:13:51.214816] <information> GLRenderer: EGL client APIs: OpenGL OpenGL_ES 
[2024-03-11 11:13:51.214824] <information> GLRenderer: EGL extensions: EGL_ANDROID_blob_cache EGL_ANDROID_native_fence_sync EGL_CHROMIUM_sync_control EGL_ANGLE_sync_control_rate EGL_EXT_buffer_age EGL_EXT_create_context_robustness EGL_EXT_image_dma_buf_import EGL_EXT_image_dma_buf_import_modifiers EGL_EXT_protected_content EGL_EXT_swap_buffers_with_damage EGL_IMG_context_priority EGL_KHR_cl_event2 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_reusable_sync EGL_KHR_surfaceless_context EGL_KHR_swap_buffers_with_damage EGL_EXT_pixel_format_float EGL_KHR_wait_sync EGL_MESA_configless_context EGL_MESA_drm_image EGL_MESA_image_dma_buf_export EGL_MESA_query_driver EGL_NOK_texture_from_pixmap EGL_WL_bind_wayland_display 
[2024-03-11 11:13:51.214830] <information> GLRenderer: GL vendor: Intel
[2024-03-11 11:13:51.214833] <information> GLRenderer: GL renderer: Mesa Intel(R) Graphics (RPL-P)
[2024-03-11 11:13:51.214836] <information> GLRenderer: GL version: OpenGL ES 3.2 Mesa 23.0.4-0ubuntu1~22.04.1
[2024-03-11 11:13:51.214838] <information> GLRenderer: GLSL version: OpenGL ES GLSL ES 3.20
[2024-03-11 11:13:51.214864] <information> GLRenderer: GL extensions: GL_EXT_blend_minmax GL_EXT_multi_draw_arrays GL_EXT_texture_filter_anisotropic GL_EXT_texture_compression_s3tc GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_rgtc GL_EXT_texture_format_BGRA8888 GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth24 GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_mapbuffer GL_OES_rgb8_rgba8 GL_OES_standard_derivatives GL_OES_stencil8 GL_OES_texture_3D GL_OES_texture_float GL_OES_texture_float_linear GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_npot GL_OES_vertex_half_float GL_EXT_draw_instanced GL_EXT_texture_sRGB_decode GL_OES_EGL_image GL_OES_depth_texture GL_AMD_performance_monitor GL_OES_packed_depth_stencil GL_EXT_texture_type_2_10_10_10_REV GL_NV_conditional_render GL_OES_get_program_binary GL_APPLE_texture_max_level GL_EXT_discard_framebuffer GL_EXT_read_format_bgra GL_NV_pack_subimage GL_EXT_frag_depth GL_NV_fbo_color_attachments GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_vertex_array_object GL_OES_viewport_array GL_ANGLE_pack_reverse_row_order GL_ANGLE_texture_compression_dxt3 GL_ANGLE_texture_compression_dxt5 GL_EXT_occlusion_query_boolean GL_EXT_robustness GL_EXT_texture_rg GL_EXT_unpack_subimage GL_NV_draw_buffers GL_NV_read_buffer GL_NV_read_depth GL_NV_read_depth_stencil GL_NV_read_stencil GL_EXT_draw_buffers GL_EXT_map_buffer_range GL_KHR_debug GL_KHR_robustness GL_KHR_texture_compression_astc_ldr GL_NV_pixel_buffer_object GL_OES_depth_texture_cube_map GL_OES_required_internalformat GL_OES_surfaceless_context GL_EXT_color_buffer_float GL_EXT_debug_label GL_EXT_sRGB_write_control GL_EXT_separate_shader_objects GL_EXT_shader_framebuffer_fetch GL_EXT_shader_group_vote GL_EXT_shader_implicit_conversions GL_EXT_shader_integer_mix GL_EXT_tessellation_point_size GL_EXT_tessellation_shader GL_INTEL_conservative_rasterization GL_INTEL_performance_query GL_ANDROID_extension_pack_es31a GL_EXT_base_instance GL_EXT_compressed_ETC1_RGB8_sub_texture GL_EXT_copy_image GL_EXT_draw_buffers_indexed GL_EXT_draw_elements_base_vertex GL_EXT_gpu_shader5 GL_EXT_polygon_offset_clamp GL_EXT_primitive_bounding_box GL_EXT_render_snorm GL_EXT_shader_io_blocks GL_EXT_texture_border_clamp GL_EXT_texture_buffer GL_EXT_texture_cube_map_array GL_EXT_texture_norm16 GL_EXT_texture_view GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_KHR_context_flush_control GL_KHR_robust_buffer_access_behavior GL_NV_image_formats GL_NV_shader_noperspective_interpolation GL_OES_copy_image GL_OES_draw_buffers_indexed GL_OES_draw_elements_base_vertex GL_OES_gpu_shader5 GL_OES_primitive_bounding_box GL_OES_sample_shading GL_OES_sample_variables GL_OES_shader_io_blocks GL_OES_shader_multisample_interpolation GL_OES_tessellation_point_size GL_OES_tessellation_shader GL_OES_texture_border_clamp GL_OES_texture_buffer GL_OES_texture_cube_map_array GL_OES_texture_stencil8 GL_OES_texture_storage_multisample_2d_array GL_OES_texture_view GL_EXT_blend_func_extended GL_EXT_buffer_storage GL_EXT_float_blend GL_EXT_geometry_point_size GL_EXT_geometry_shader GL_EXT_shader_samples_identical GL_EXT_texture_sRGB_R8 GL_KHR_no_error GL_KHR_texture_compression_astc_sliced_3d GL_NV_fragment_shader_interlock GL_OES_EGL_image_external_essl3 GL_OES_geometry_point_size GL_OES_geometry_shader GL_OES_shader_image_atomic GL_EXT_clear_texture GL_EXT_clip_cull_distance GL_EXT_disjoint_timer_query GL_EXT_texture_compression_s3tc_srgb GL_MESA_shader_integer_functions GL_EXT_clip_control GL_EXT_color_buffer_half_float GL_EXT_memory_object GL_EXT_memory_object_fd GL_EXT_semaphore GL_EXT_semaphore_fd GL_EXT_texture_compression_bptc GL_EXT_texture_mirror_clamp_to_edge GL_KHR_parallel_shader_compile GL_NV_alpha_to_coverage_dither_control GL_EXT_EGL_image_storage GL_EXT_shader_framebuffer_fetch_non_coherent GL_EXT_texture_shadow_lod GL_INTEL_blackhole_render GL_MESA_framebuffer_flip_y GL_NV_compute_shader_derivatives GL_EXT_demote_to_helper_invocation GL_EXT_depth_clamp GL_EXT_texture_query_lod GL_MESA_bgra 
[2024-03-11 11:13:51.214881] <information> GLRenderer: GL max texture size = 16384
[2024-03-11 11:13:51.216342] <information> GLRenderer: GL framebuffer bits: RGBA=8888, depth=0, stencil=0
[2024-03-11 11:13:51.218577] <information> mirserver: Initial display configuration:
[2024-03-11 11:13:51.218602] <information> mirserver: * Output 1: unknown connected, used
[2024-03-11 11:13:51.218606] <information> mirserver: . |_ Physical size 17.0" 338x270mm
[2024-03-11 11:13:51.218609] <information> mirserver: . |_ Power is on
[2024-03-11 11:13:51.218611] <information> mirserver: . |_ Current mode 1280x1024 60.00Hz
[2024-03-11 11:13:51.218614] <information> mirserver: . |_ Preferred mode 1280x1024 60.00Hz
[2024-03-11 11:13:51.218616] <information> mirserver: . |_ Orientation normal
[2024-03-11 11:13:51.218619] <information> mirserver: . |_ Logical size 1280x1024
[2024-03-11 11:13:51.218621] <information> mirserver: . |_ Logical position +0+0
[2024-03-11 11:13:51.218623] <information> mirserver: . |_ Scaling factor: 1.00
[2024-03-11 11:13:51.218639] < -warning- > miral: Attempt to read custom output attribute (surface-title) that wasn't added
[2024-03-11 11:13:51.218647] < -warning- > miral: Attempt to read custom output attribute (snap-name) that wasn't added
[2024-03-11 11:13:51.594563] <information> frame: New surface for snap="iot-example-graphical-snap" with title="flutterdemo"
error in client communication (pid 29782)
Gdk-Message: 11:13:51.651: Error flushing display: Protocol error
[2024-03-11 11:13:51.682583] < - debug - > mirserver: Handling Terminated from pid=29668
[2024-03-11 11:13:51.682760] < -warning- > mirserver: wl_surface@12 destroyed before associated role

I have no issue when I run a snap created from another branch, such as the mastermind game.

AlanGriffiths commented 6 months ago
  • Checked out the Flutter-demo branch

HI @resilem, to help me try replicating the problem, would you confirm whether you mean 22/Flutter-demo or 20/Flutter-demo?

resilem commented 6 months ago

I mean 22/Flutter-demo.

AlanGriffiths commented 6 months ago

I've just followed the same instructions and they work on 22.04 and 24.04. So there must be some other difference in our environments.

Are you running a Wayland based DE such as GNOME? If so, could you try running iot-example-graphical-snap without frame-it?

resilem commented 6 months ago

I am running GNOME DE.

If I attempt to run without frame-it, using the command snap run iot-example-graphical-snap I get the following 2 lines printed out and then nothing more happens.

Setting up watches.
Watches established.
AlanGriffiths commented 6 months ago

:(

That suggests GNOME is running in X11 mode. (BTW I said iot-example-graphical-snap, not snap run iot-example-graphical-snap, but that shouldn't make a difference)

Are you, perhaps, using Nvidia graphics?