WebReflection / benja

Bootable Electron Node JS Application
https://archibold.io/benja/
194 stars 32 forks source link

GPU Crashes with Wayland/Weston #33

Closed rhclayto closed 7 years ago

rhclayto commented 7 years ago

Hi, I'm experiencing GPU crashes with BENJA (on Raspberry Pi 3) when the process has been running for a number of hours. Usually, if I leave it overnight the GPU will have crashed by the morning & the HDMI monitor no longer receives signal from the Raspberry Pi. This is the relevant journalctl logs for when wayland/weston starts:

Sep 02 01:58:54 benja.local weston-launch[258]: Date: 2017-09-02 UTC
Sep 02 01:58:54 benja.local weston-launch[258]: [01:58:54.847] weston 3.0.0
Sep 02 01:58:54 benja.local weston-launch[258]:                http://wayland.freedesktop.org
Sep 02 01:58:54 benja.local weston-launch[258]:                Bug reports to: https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=weston&version=3.0.0
Sep 02 01:58:54 benja.local weston-launch[258]:                Build: unknown (not built from git or tarball)
Sep 02 01:58:54 benja.local weston-launch[258]: [01:58:54.847] Command line: /usr/bin/weston
Sep 02 01:58:54 benja.local weston-launch[258]: [01:58:54.847] OS: Linux, 4.9.43-1-ARCH, #1 SMP Fri Aug 18 01:10:29 UTC 2017, armv7l
Sep 02 01:59:11 benja.local weston-launch[258]: [01:58:54.847] warning: XDG_RUNTIME_DIR "/tmp" is not configured
Sep 02 01:59:11 benja.local weston-launch[258]: correctly.  Unix access mode must be 0700 (current mode is 777),
Sep 02 01:59:11 benja.local weston-launch[258]: and must be owned by the user (current owner is UID 0).
Sep 02 01:59:11 benja.local weston-launch[258]: Refer to your distribution on how to get it, or
Sep 02 01:59:11 benja.local weston-launch[258]: http://www.freedesktop.org/wiki/Specifications/basedir-spec
Sep 02 01:59:11 benja.local weston-launch[258]: on how to implement it.
Sep 02 01:59:11 benja.local weston-launch[258]: [01:58:54.918] Using config file '/home/benja/.config/weston.ini'
Sep 02 01:59:11 benja.local weston-launch[258]: [01:58:54.949] Output repaint window is 7 ms maximum.
Sep 02 01:59:11 benja.local weston-launch[258]: [01:58:54.986] Loading module '/usr/lib/libweston-3/drm-backend.so'
Sep 02 01:59:11 benja.local weston-launch[258]: [01:58:55.056] initializing drm backend
Sep 02 01:59:11 benja.local weston-launch[258]: [01:58:55.056] logind: not running in a systemd session
Sep 02 01:59:11 benja.local weston-launch[258]: [01:58:55.056] logind: cannot setup systemd-logind helper (-61), using legacy fallback
Sep 02 01:59:11 benja.local weston-launch[258]: [01:58:55.059] using /dev/dri/card0
Sep 02 01:59:11 benja.local weston-launch[258]: [01:58:55.066] Loading module '/usr/lib/libweston-3/gl-renderer.so'
Sep 02 01:59:12 benja.local weston-launch[258]: [01:59:12.890] EGL client extensions: EGL_EXT_platform_base
Sep 02 01:59:12 benja.local weston-launch[258]:                EGL_KHR_client_get_all_proc_addresses EGL_EXT_client_extensions
Sep 02 01:59:12 benja.local weston-launch[258]:                EGL_KHR_debug EGL_EXT_platform_wayland EGL_EXT_platform_x11
Sep 02 01:59:12 benja.local weston-launch[258]:                EGL_MESA_platform_gbm
Sep 02 01:59:12 benja.local weston-launch[258]: [01:59:12.891] warning: neither EGL_EXT_swap_buffers_with_damage or EGL_KHR_swap_buffers_with_damage is supported. Performance could be affected.
Sep 02 01:59:12 benja.local weston-launch[258]: [01:59:12.891] EGL_KHR_surfaceless_context available
Sep 02 01:59:12 benja.local weston-launch[258]: [01:59:12.950] EGL version: 1.4 (DRI2)
Sep 02 01:59:12 benja.local weston-launch[258]: [01:59:12.950] EGL vendor: Mesa Project
Sep 02 01:59:12 benja.local weston-launch[258]: [01:59:12.950] EGL client APIs: OpenGL OpenGL_ES
Sep 02 01:59:12 benja.local weston-launch[258]: [01:59:12.950] EGL extensions: EGL_EXT_buffer_age EGL_EXT_image_dma_buf_import
Sep 02 01:59:12 benja.local weston-launch[258]:                EGL_KHR_cl_event2 EGL_KHR_config_attribs EGL_KHR_create_context
Sep 02 01:59:12 benja.local weston-launch[258]:                EGL_KHR_fence_sync EGL_KHR_get_all_proc_addresses
Sep 02 01:59:12 benja.local weston-launch[258]:                EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image
Sep 02 01:59:12 benja.local weston-launch[258]:                EGL_KHR_gl_texture_cubemap_image EGL_KHR_image
Sep 02 01:59:12 benja.local weston-launch[258]:                EGL_KHR_image_base EGL_KHR_image_pixmap
Sep 02 01:59:12 benja.local weston-launch[258]:                EGL_KHR_no_config_context EGL_KHR_reusable_sync
Sep 02 01:59:12 benja.local weston-launch[258]:                EGL_KHR_surfaceless_context EGL_KHR_wait_sync
Sep 02 01:59:12 benja.local weston-launch[258]:                EGL_MESA_configless_context EGL_MESA_drm_image
Sep 02 01:59:12 benja.local weston-launch[258]:                EGL_MESA_image_dma_buf_export EGL_WL_bind_wayland_display
Sep 02 01:59:12 benja.local weston-launch[258]: [01:59:12.950] GL version: OpenGL ES 2.0 Mesa 17.1.8
Sep 02 01:59:12 benja.local weston-launch[258]: [01:59:12.950] GLSL version: OpenGL ES GLSL ES 1.0.16
Sep 02 01:59:12 benja.local weston-launch[258]: [01:59:12.950] GL vendor: Broadcom
Sep 02 01:59:12 benja.local weston-launch[258]: [01:59:12.950] GL renderer: Gallium 0.4 on VC4 V3D 2.1
Sep 02 01:59:12 benja.local weston-launch[258]: [01:59:12.950] GL extensions: GL_EXT_blend_minmax GL_EXT_multi_draw_arrays
Sep 02 01:59:12 benja.local weston-launch[258]:                GL_EXT_texture_format_BGRA8888
Sep 02 01:59:12 benja.local weston-launch[258]:                GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth24
Sep 02 01:59:12 benja.local weston-launch[258]:                GL_OES_element_index_uint GL_OES_fbo_render_mipmap
Sep 02 01:59:12 benja.local weston-launch[258]:                GL_OES_mapbuffer GL_OES_rgb8_rgba8 GL_OES_stencil8
Sep 02 01:59:12 benja.local weston-launch[258]:                GL_OES_texture_3D GL_OES_texture_npot GL_OES_vertex_half_float
Sep 02 01:59:12 benja.local weston-launch[258]:                GL_OES_EGL_image GL_OES_depth_texture
Sep 02 01:59:12 benja.local weston-launch[258]:                GL_OES_packed_depth_stencil GL_EXT_texture_type_2_10_10_10_REV
Sep 02 01:59:12 benja.local weston-launch[258]:                GL_OES_get_program_binary GL_APPLE_texture_max_level
Sep 02 01:59:12 benja.local weston-launch[258]:                GL_EXT_discard_framebuffer GL_EXT_read_format_bgra
Sep 02 01:59:12 benja.local weston-launch[258]:                GL_EXT_frag_depth GL_NV_fbo_color_attachments
Sep 02 01:59:12 benja.local weston-launch[258]:                GL_OES_EGL_image_external GL_OES_EGL_sync
Sep 02 01:59:12 benja.local weston-launch[258]:                GL_OES_vertex_array_object GL_EXT_unpack_subimage
Sep 02 01:59:12 benja.local weston-launch[258]:                GL_NV_draw_buffers GL_NV_read_buffer GL_NV_read_depth
Sep 02 01:59:12 benja.local weston-launch[258]:                GL_NV_read_depth_stencil GL_NV_read_stencil GL_EXT_draw_buffers
Sep 02 01:59:12 benja.local weston-launch[258]:                GL_EXT_map_buffer_range GL_KHR_debug GL_OES_surfaceless_context
Sep 02 01:59:12 benja.local weston-launch[258]:                GL_EXT_separate_shader_objects
Sep 02 01:59:12 benja.local weston-launch[258]:                GL_EXT_compressed_ETC1_RGB8_sub_texture
Sep 02 01:59:12 benja.local weston-launch[258]:                GL_EXT_draw_elements_base_vertex GL_EXT_texture_border_clamp
Sep 02 01:59:12 benja.local weston-launch[258]:                GL_KHR_context_flush_control GL_OES_draw_elements_base_vertex
Sep 02 01:59:12 benja.local weston-launch[258]:                GL_OES_texture_border_clamp
Sep 02 01:59:12 benja.local weston-launch[258]: [01:59:12.950] GL ES 2 renderer features:
Sep 02 01:59:12 benja.local weston-launch[258]:                read-back format: BGRA
Sep 02 01:59:12 benja.local weston-launch[258]:                wl_shm sub-image to texture: yes
Sep 02 01:59:12 benja.local weston-launch[258]:                EGL Wayland extension: yes
Sep 02 01:59:13 benja.local weston-launch[258]: [01:59:13.023] event0  - [01:59:13.023] Microsoft Microsoft IntelliMouse® Explorer: [01:59:13.023] is tagged by udev as: Mouse
Sep 02 01:59:13 benja.local weston-launch[258]: [01:59:13.023] event0  - [01:59:13.023] Microsoft Microsoft IntelliMouse® Explorer: [01:59:13.023] device is a pointer
Sep 02 01:59:13 benja.local weston-launch[258]: [01:59:13.026] event1  - [01:59:13.026] NOVATEK HP USB Multimedia Keyboard: [01:59:13.026] is tagged by udev as: Keyboard
Sep 02 01:59:13 benja.local weston-launch[258]: [01:59:13.026] event1  - [01:59:13.026] NOVATEK HP USB Multimedia Keyboard: [01:59:13.026] device is a keyboard
Sep 02 01:59:13 benja.local weston-launch[258]: [01:59:13.028] event2  - [01:59:13.028] NOVATEK HP USB Multimedia Keyboard: [01:59:13.028] is tagged by udev as: Keyboard
Sep 02 01:59:13 benja.local weston-launch[258]: [01:59:13.028] event2  - [01:59:13.028] NOVATEK HP USB Multimedia Keyboard: [01:59:13.028] device is a keyboard
Sep 02 01:59:13 benja.local weston-launch[258]: [01:59:13.081] Registered plugin API 'weston_drm_output_api_v1' of size 12
Sep 02 01:59:13 benja.local weston-launch[258]: [01:59:13.081] Chosen EGL config details:
Sep 02 01:59:13 benja.local weston-launch[258]:                RGBA bits: 8 8 8 0
Sep 02 01:59:13 benja.local weston-launch[258]:                swap interval range: 0 - 0
Sep 02 01:59:13 benja.local weston-launch[258]: [01:59:13.082] Failed to initialize backlight
Sep 02 01:59:13 benja.local weston-launch[258]: [01:59:13.082] Output HDMI-A-1, (connector 27, crtc 25)
Sep 02 01:59:13 benja.local weston-launch[258]:                mode 1920x1080@60.0, current
Sep 02 01:59:13 benja.local weston-launch[258]: [01:59:13.082] Compositor capabilities:
Sep 02 01:59:13 benja.local weston-launch[258]:                arbitrary surface rotation: yes
Sep 02 01:59:13 benja.local weston-launch[258]:                screen capture uses y-flip: yes
Sep 02 01:59:13 benja.local weston-launch[258]:                presentation clock: CLOCK_MONOTONIC, id 1
Sep 02 01:59:13 benja.local weston-launch[258]:                presentation clock resolution: 0.000000001 s
Sep 02 01:59:13 benja.local weston-launch[258]: [01:59:13.089] Loading module '/usr/lib/weston/desktop-shell.so'
Sep 02 01:59:13 benja.local weston-launch[258]: [01:59:13.096] launching '/usr/lib/weston/weston-keyboard'
Sep 02 01:59:13 benja.local weston-launch[258]: [01:59:13.101] Loading module '/usr/lib/libweston-3/xwayland.so'
Sep 02 01:59:13 benja.local weston-launch[258]: [01:59:13.265] Registered plugin API 'weston_xwayland_v1' of size 16
Sep 02 01:59:13 benja.local weston-launch[258]: [01:59:13.265] Registered plugin API 'weston_xwayland_surface_v1' of size 8
Sep 02 01:59:13 benja.local weston-launch[258]: [01:59:13.266] xserver listening on display :0
Sep 02 01:59:13 benja.local weston-launch[258]: [01:59:13.266] launching '/home/benja/.app-launcher'
Sep 02 01:59:13 benja.local weston-launch[258]: [01:59:13.382] Spawned Xwayland server, pid 337
Sep 02 01:59:13 benja.local weston-launch[258]: could not load cursor 'dnd-move'
Sep 02 01:59:13 benja.local weston-launch[258]: could not load cursor 'dnd-copy'
Sep 02 01:59:13 benja.local weston-launch[258]: could not load cursor 'dnd-none'
Sep 02 01:59:13 benja.local weston-launch[258]: glamor: EGL version 1.4 (DRI2):
Sep 02 01:59:14 benja.local weston-launch[258]: [01:59:14.208] xfixes version: 5.0
Sep 02 01:59:14 benja.local weston-launch[258]: [01:59:14.284] created wm, root 624
Sep 02 01:59:14 benja.local weston-launch[258]: non-network local connections being added to access control list
Sep 02 01:59:14 benja.local sudo[345]:    benja : TTY=tty1 ; PWD=/home/benja/app ; USER=root ; COMMAND=/usr/bin/npm start
Sep 02 01:59:18 benja.local weston-launch[258]: > app@1.0.1 start /home/benja/app
Sep 02 01:59:18 benja.local weston-launch[258]: > electron index.js
Sep 02 01:59:23 benja.local weston-launch[258]: [01:59:23:0660] [info] app running

and this is the log for when it crashes:

Sep 01 01:43:09 benja.local kernel: vc4-drm soc:gpu: failed to allocate buffer with size 16777216
Sep 01 01:43:09 benja.local weston-launch[278]: Draw call returned Cannot allocate memory.  Expect corruption.
Sep 01 01:43:09 benja.local kernel: vc4-drm soc:gpu: failed to allocate buffer with size 16777216
Sep 01 01:43:09 benja.local kernel: [drm:vc4_bo_create [vc4]] *ERROR* Failed to allocate from CMA:
Sep 01 01:43:09 benja.local kernel: [drm] num bos allocated: 215
Sep 01 01:43:09 benja.local kernel: [drm] size bos allocated: 116020kb
Sep 01 01:43:09 benja.local kernel: [drm] num bos used: 215
Sep 01 01:43:09 benja.local kernel: [drm] size bos used: 116020kb
Sep 01 01:43:09 benja.local kernel: [drm] num bos cached: 0
Sep 01 01:43:09 benja.local kernel: [drm] size bos cached: 0kb
Sep 01 01:43:09 benja.local kernel: vc4_v3d 3fc00000.v3d: Failed to allocate memory for tile binning: -12. You may need to enable CMA or give it more memory.
Sep 01 01:43:09 benja.local kernel: Unable to handle kernel NULL pointer dereference at virtual address 00000088
Sep 01 01:43:09 benja.local kernel: pgd = b73ac000
Sep 01 01:43:09 benja.local kernel: [00000088] *pgd=00000000
Sep 01 01:43:09 benja.local kernel: Internal error: Oops: 5 [#1] SMP ARM
Sep 01 01:43:09 benja.local kernel: Modules linked in: lzo xt_REDIRECT nf_nat_redirect xt_tcpudp iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 zram nf_nat_ipv4 nf_nat nf_conntrack vc4 brcmfmac usbl
Sep 01 01:43:09 benja.local kernel: CPU: 3 PID: 290 Comm: Xwayland Tainted: G        W       4.9.43-1-ARCH #1
Sep 01 01:43:09 benja.local kernel: Hardware name: BCM2835
Sep 01 01:43:09 benja.local kernel: task: b87ee580 task.stack: b7206000
Sep 01 01:43:09 benja.local kernel: PC is at validate_tile_binning_config+0x94/0x188 [vc4]
Sep 01 01:43:09 benja.local kernel: LR is at vc4_v3d_get_bin_slot+0xc0/0xcc [vc4]
Sep 01 01:43:09 benja.local kernel: pc : [<7f40c450>]    lr : [<7f40bf9c>]    psr: 20070013
                                    sp : b7207d48  ip : 00000000  fp : 00000002
Sep 01 01:43:09 benja.local kernel: r10: 00000000  r9 : b85b0a10  r8 : 9012f001
Sep 01 01:43:09 benja.local kernel: r7 : 00000011  r6 : 00000001  r5 : 8e15fc00  r4 : 000005fa
Sep 01 01:43:09 benja.local kernel: r3 : 00000000  r2 : 00080000  r1 : 60070013  r0 : 00000001
Sep 01 01:43:09 benja.local kernel: Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Sep 01 01:43:09 benja.local kernel: Control: 10c5383d  Table: 373ac06a  DAC: 00000055
Sep 01 01:43:09 benja.local kernel: Process Xwayland (pid: 290, stack limit = 0xb7206210)
Sep 01 01:43:09 benja.local kernel: Stack: (0xb7207d48 to 0xb7208000)
Sep 01 01:43:09 benja.local kernel: 7d40:                   80113da0 80f0308c ba712800 00000000 ba712800 00000070
Sep 01 01:43:09 benja.local kernel: 7d60: 00000010 7f410cf8 7f40c3bc 00000010 00000000 0000005c a8ef5d00 7f40cb50
Sep 01 01:43:09 benja.local kernel: 7d80: 00000004 b725570c b692d180 0004092b 00000000 7f414b48 8e15fc00 00000000
Sep 01 01:43:09 benja.local kernel: 7da0: 9012f000 a8ef5d00 00000060 8e15fc00 a8ef5b00 8e15f3c0 b85b0a10 8e15f3c0
Sep 01 01:43:09 benja.local kernel: 7dc0: a8ef5d00 00000060 ba712800 7f406848 00000000 00000000 00000000 00000000
Sep 01 01:43:09 benja.local kernel: 7de0: 000000f8 8e15fc40 00000000 0000009c 00000000 a8ef5d9c b7207e5c 7f40f0c0
Sep 01 01:43:09 benja.local kernel: 7e00: 00000000 b7b89d00 000000a0 c0a06440 8e15f3c0 00000040 80f0308c 7f2dc63c
Sep 01 01:43:09 benja.local kernel: 7e20: 0000e200 00000001 7f411f10 b692d180 b7207f5c b7207e54 000000a0 7eec7d00
Sep 01 01:43:09 benja.local kernel: 7e40: 000000a0 ba712800 00000000 7f4062f0 a8ce4a40 00000000 00000000 028be0f0
Sep 01 01:43:09 benja.local kernel: 7e60: 00004000 80f0308c 00000001 ffffffff 7fffffff bb23a8c8 7fc7b2c5 00225796
Sep 01 01:43:09 benja.local kernel: 7e80: ffffffff 00ffffff b1972208 bb6f6800 80f0308c bb6f6800 bb6f0600 00000001
Sep 01 01:43:09 benja.local kernel: 7ea0: b7207f30 283fc580 00003068 801a0d04 27e31d3a 00003068 80f0308c 0004092b
Sep 01 01:43:09 benja.local kernel: 7ec0: 283fc580 00003068 bb6f6800 bb6f0600 00000000 0004092b 362d527e 80f0308c
Sep 01 01:43:09 benja.local kernel: 7ee0: 7eec7d00 b709a6b0 b7218180 7eec7d00 b7206000 00000000 00000040 8028f418
Sep 01 01:43:09 benja.local kernel: 7f00: 80f0308c 00000000 00601580 80290964 0000cfe7 00000000 35e1073e 0004092b
Sep 01 01:43:09 benja.local kernel: 7f20: 00000000 00000000 004c4b40 b7207f6c 0000cfe7 00000000 362d527e 0004092b
Sep 01 01:43:09 benja.local kernel: 7f40: 00000000 00000000 004c4b40 0004092b 00000000 80f0308c 00000001 7eec87fc
Sep 01 01:43:10 benja.local kernel: 7f60: 000000a8 0004092b b7206000 b7218181 b7218180 00000006 c0a06440 7eec7d00
Sep 01 01:43:10 benja.local kernel: 7f80: b7206000 00000000 00000040 8028fbdc 02969e60 7eec7d00 c0a06440 00000036
Sep 01 01:43:10 benja.local kernel: 7fa0: 80107c24 80107a80 02969e60 7eec7d00 00000006 c0a06440 7eec7d00 00000000
Sep 01 01:43:10 benja.local kernel: 7fc0: 02969e60 7eec7d00 c0a06440 00000036 7eec7d00 00000000 00000040 00000040
Sep 01 01:43:10 benja.local kernel: 7fe0: 76da9efc 7eec7cc4 76d90c28 7696c33c 60070010 00000006 00000000 00000000
Sep 01 01:43:10 benja.local kernel: [<7f40c450>] (validate_tile_binning_config [vc4]) from [<7f40cb50>] (vc4_validate_bin_cl+0xb0/0x2a4 [vc4])
Sep 01 01:43:10 benja.local kernel: [<7f40cb50>] (vc4_validate_bin_cl [vc4]) from [<7f406848>] (vc4_submit_cl_ioctl+0x558/0x8dc [vc4])
Sep 01 01:43:10 benja.local kernel: [<7f406848>] (vc4_submit_cl_ioctl [vc4]) from [<7f2dc63c>] (drm_ioctl+0x1f4/0x400 [drm])
Sep 01 01:43:10 benja.local kernel: [<7f2dc63c>] (drm_ioctl [drm]) from [<8028f418>] (do_vfs_ioctl+0x98/0x828)
Sep 01 01:43:10 benja.local kernel: [<8028f418>] (do_vfs_ioctl) from [<8028fbdc>] (SyS_ioctl+0x34/0x58)
Sep 01 01:43:10 benja.local kernel: [<8028fbdc>] (SyS_ioctl) from [<80107a80>] (ret_fast_syscall+0x0/0x34)
Sep 01 01:43:10 benja.local kernel: Code: e585b06c e5993100 e5992104 e0844084 (e5933088)
Sep 01 01:43:10 benja.local kernel: ---[ end trace 47083b09545aa0fc ]---
Sep 01 01:43:11 benja.local kernel: [drm] Resetting GPU.

All after pacman -Syu updating everyuthing, latest Raspberry Pi firmware, etc.

It appears to be a problem with the OpenGL drivers set with dtoverlay=vc4-fkms-v3d in /boot/config.txt. I couldn't get weston to run any other way than the way you have it here, so I have had to use SDDM window manager/desktop & script BENJA to start over it.

This may not be a BENJA issue per se, but since BENJA ships with this config for Waylad/Weston & the experiemntal vc4 drivers, & since I am coming from a non-graphical *nix background (FreeBSD servers actually) & have spent all day wading through a welter of graphics-related stuff that didn't solve much of this problem, I thought I'd bring it up here.

A couple of questions, then. Is there some way first of all to fix this while still using Weston? For instance, a way to get weston to work on Raspberry Pi without using the experimental drivers?

Secondly, since everything is working OK with SDDM/Xorg, how are you accomplishing the touch reload reloading of the app? It no longer works with the SDDm setup.

rhclayto commented 7 years ago

Also, after some testing, without the hardware acceleration, the scroll lag was just horrendous. Huge CPU spikes on all four cores on the slightest scroll. Somehow I need to use the vc4 driver but without the crashing! It seems I'm in a bind. :-/

WebReflection commented 7 years ago

would QtWebEngine be a valuable solution ?

It's HW accelerated on Xorg, but it needs node-worker instead of Electron. https://github.com/WebReflection/benja/issues/22#issuecomment-320229837

rhclayto commented 7 years ago

Investigating now.

rhclayto commented 7 years ago

Well since switching back to dtoverlay=vc4-fkms-v3d I have had no crashes! Whereas before it used to be consistent, at least one crash within a 24-hour period. Perhaps I chcaged something in the electron app itself that has corrected this, but if I did, I have no idea what it was. So anyway, I am having no crashes with the following boot settings:

config.txt

gpu_mem=8
dispmanx_offline=1
dtoverlay=vc4-fkms-v3d
avoid_warnings=2
dtparam=audio=on
disable_overscan=1

cmdline.txt:

root=/dev/mmcblk0p2 rootfstype=ext4 rw rootwait quiet loglevel=0 splash console=ttyAMA0,115200 console=tty1 selinux=0 plymouth.enable=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 kgdboc=ttyAMA0,115200 elevator=noop cma=256MB

So I'll close this.

WebReflection commented 7 years ago

oh gosh ... I use gpu_mem=256 as minimum, no idea how your Electron even starts with 8MB of GPU ... are you sure you need the GPU at all ?

rhclayto commented 7 years ago

From what I understand, the open-source vc4 driver used by dtoverlay=vc4-fkms-v3d doesn't use gpu_mem at all. Eric Anholt, who is writing the driver, has said things like this on a few occasions in the GitHub issue queue: 'Note: The gpu mem setting in config.txt reserves memory that doesn't get used by the open graphics driver.' (https://github.com/anholt/linux/issues/28), '(Also note that the open driver doesn't want any gpu_mem)' (https://github.com/anholt/linux/issues/47), 'vc4-kms-v3d doesn't care about any of your config.txt display settings (except avoid_warnings=1 which is required). If any of config.txt did affect vc4-kms-v3d, that would actually be a bug. ' (https://github.com/anholt/linux/issues/92).

So it seems to open vc4 driver itself isn't responding to anything in config.txt,. However, I can't boot up at all without something in gpu_mem, so perhaps it's needed for an early stage before the vc4 driver takes over. I have cma=256MB in cmdline.txt, so RAM should be assigned dynamically to the GPU as needed. Keeping gpu_mem low frees up memory for the CPU.

I am no expert at all in any of this, but the config I have now has been working for about three days. Fingers crossed it keeps working.