canonical / mir

The Mir compositor
GNU General Public License v2.0
628 stars 100 forks source link

glmark2-es-wayland crashes under GLMark2Wayland_fullscreen with bypass on Pi3 #1801

Open Saviq opened 3 years ago

Saviq commented 3 years ago

With this testflinger host:

job_queue: rpi3-001
provision_data:
    url: http://cdimage.ubuntu.com/releases/focal/release/ubuntu-20.04.1-preinstalled-server-armhf+raspi.img.xz
reserve_data:
    ssh_keys:
    - lp:${YOU}

Running this (with either /dev or /rc PPAs):

$ while env MIR_SERVER_BYPASS=off XDG_RUNTIME_DIR=/tmp mir_performance_tests --logging on --gtest_filter=GLMark2Wayland.fullscreen; do true; done

Will run forever. But take MIR_SERVER_BYPASS out and you'll see glmark2-es-wayland crashing real soon:

#0  dri2_query_image_common (value=0xbef74250, attrib=<optimized out>, image=0x0) at ../src/gallium/state_trackers/dri/dri2.c:1048
#1  dri2_query_image (image=0x0, attrib=<optimized out>, value=0xbef74250) at ../src/gallium/state_trackers/dri/dri2.c:1236
#2  0xb69673be in create_wl_buffer (dri2_dpy=dri2_dpy@entry=0x15e5000, dri2_surf=dri2_surf@entry=0x160afd0, image=0x0) at ../src/egl/drivers/dri2/platform_wayland.c:901
#3  0xb6967b4a in dri2_wl_swap_buffers_with_damage (drv=<optimized out>, disp=0x15e47c8, draw=0x160afd0, rects=rects@entry=0x0, n_rects=n_rects@entry=0) at ../src/egl/drivers/dri2/platform_wayland.c:1094
#4  0xb6967bb8 in dri2_wl_swap_buffers (drv=<optimized out>, disp=<optimized out>, draw=<optimized out>) at ../src/egl/drivers/dri2/platform_wayland.c:1169
#5  0xb6960e42 in dri2_swap_buffers (drv=0x15e4f40, disp=0x15e47c8, surf=0x160afd0) at ../src/egl/drivers/dri2/egl_dri2.c:1932
#6  0xb695b928 in eglSwapBuffers (dpy=0x15e47c8, surface=<optimized out>) at ../src/egl/main/eglapi.c:1340
#7  0x004b9892 in CanvasGeneric::update (this=0xbef74470) at ../src/canvas-generic.cpp:114
#8  0x0044c854 in MainLoop::step (this=0x1643c80) at ../src/main-loop.cpp:108
#9  0x0044db94 in do_benchmark (canvas=...) at ../src/main.cpp:117
#10 0x00446802 in main (argc=<optimized out>, argv=<optimized out>) at ../src/main.cpp:210

Crashes quite early:

=======================================================
    glmark2 2014.03+git20150611.fa71af2d
=======================================================
    OpenGL Information
    GL_VENDOR:     Broadcom
    GL_RENDERER:   VC4 V3D 2.1
    GL_VERSION:    OpenGL ES 2.0 Mesa 20.0.8
=======================================================
[build] <default>:

And the server log:

Running main() from main.cpp
Note: Google Test filter = GLMark2Wayland.fullscreen
[==========] Running 1 test from 1 test suite.
[----------] Global test environment set-up.
[----------] 1 test from GLMark2Wayland
[ RUN      ] GLMark2Wayland.fullscreen
[2020-11-09 14:12:36.961519] <information> mirserver: Starting
[2020-11-09 14:12:36.975062] < - debug - > mirserver: Not using logind for session management: Seat has no active session
[2020-11-09 14:12:36.978021] < - debug - > mirserver: Using Linux VT subsystem for session management
[2020-11-09 14:12:36.979069] <information> mircommon: Loading modules from: /usr/lib/arm-linux-gnueabihf/mir/server-platform
[2020-11-09 14:12:36.979525] <information> mircommon: Loading module: /usr/lib/arm-linux-gnueabihf/mir/server-platform/graphics-gbm-kms.so.18
[2020-11-09 14:12:36.979706] <information> mircommon: Loading module: /usr/lib/arm-linux-gnueabihf/mir/server-platform/server-x11.so.18
[2020-11-09 14:12:36.979858] <information> mircommon: Loading module: /usr/lib/arm-linux-gnueabihf/mir/server-platform/graphics-wayland.so.18
[2020-11-09 14:12:36.979951] <information> mircommon: Loading module: /usr/lib/arm-linux-gnueabihf/mir/server-platform/input-evdev.so.7
[2020-11-09 14:12:36.990141] <information> gbm-kms: EGL platform does not support EGL_KHR_platform_gbm extension
[2020-11-09 14:12:36.991102] < -warning- > gbm-kms: Failed to detect whether device /dev/dri/card0 supports KMS, continuing with lower confidence
[2020-11-09 14:12:37.132793] <information> mirserver: Found graphics driver: mir:gbm-kms (version 2.1.0) Support priority: 128
[2020-11-09 14:12:37.132985] <information> mirserver: Found graphics driver: mir:x11 (version 2.1.0) Support priority: 0
[2020-11-09 14:12:37.133052] <information> mirserver: Found graphics driver: mir:wayland (version 2.1.0) Support priority: 0
[2020-11-09 14:12:37.134075] <information> mirserver: Selected driver: mir:gbm-kms (version 2.1.0)
[2020-11-09 14:12:37.136617] < -warning- > gbm-kms: Failed to detect whether device /dev/dri/card0 supports KMS, but continuing anyway
[2020-11-09 14:12:37.136840] <information> gbm-kms: Using DRM device /dev/dri/card0
[2020-11-09 14:12:37.220062] < -warning- > gbm-kms: Unable to determine the current display mode.
[2020-11-09 14:12:37.229879] <information> gbm-kms: DRM device details:
[2020-11-09 14:12:37.230065] <information> gbm-kms: /dev/dri/card0: using driver vc4 [Broadcom VC4 graphics] (version: 0.0.0 driver date: 20140616)
[2020-11-09 14:12:37.257688] <information> gbm-kms:     Output: HDMI-A-1 (connected)
[2020-11-09 14:12:37.257873] <information> gbm-kms:             Mode: 1920×1080@60.00
[2020-11-09 14:12:37.257978] <information> gbm-kms:             Mode: 2048×1152@60.00
[2020-11-09 14:12:37.258078] <information> gbm-kms:             Mode: 1920×1080@59.94
[2020-11-09 14:12:37.258174] <information> gbm-kms:             Mode: 1920×1080@50.00
[2020-11-09 14:12:37.258270] <information> gbm-kms:             Mode: 1920×1080@30.00
[2020-11-09 14:12:37.258367] <information> gbm-kms:             Mode: 1920×1080@29.97
[2020-11-09 14:12:37.258461] <information> gbm-kms:             Mode: 1920×1080@25.00
[2020-11-09 14:12:37.258615] <information> gbm-kms:             Mode: 1920×1080@24.00
[2020-11-09 14:12:37.258714] <information> gbm-kms:             Mode: 1920×1080@23.97
[2020-11-09 14:12:37.258809] <information> gbm-kms:             Mode: 1600×1200@60.00
[2020-11-09 14:12:37.258904] <information> gbm-kms:             Mode: 1680×1050@59.95
[2020-11-09 14:12:37.258999] <information> gbm-kms:             Mode: 1280×1024@75.02
[2020-11-09 14:12:37.259095] <information> gbm-kms:             Mode: 1280×1024@60.01
[2020-11-09 14:12:37.259190] <information> gbm-kms:             Mode: 1440×900@59.88
[2020-11-09 14:12:37.259283] <information> gbm-kms:             Mode: 1280×960@60.00
[2020-11-09 14:12:37.259378] <information> gbm-kms:             Mode: 1280×720@60.00
[2020-11-09 14:12:37.259474] <information> gbm-kms:             Mode: 1280×720@59.94
[2020-11-09 14:12:37.259567] <information> gbm-kms:             Mode: 1280×720@50.00
[2020-11-09 14:12:37.259663] <information> gbm-kms:             Mode: 1024×768@75.02
[2020-11-09 14:12:37.259758] <information> gbm-kms:             Mode: 1024×768@70.06
[2020-11-09 14:12:37.259852] <information> gbm-kms:             Mode: 1024×768@60.00
[2020-11-09 14:12:37.259946] <information> gbm-kms:             Mode: 800×600@75.00
[2020-11-09 14:12:37.260040] <information> gbm-kms:             Mode: 800×600@72.18
[2020-11-09 14:12:37.260134] <information> gbm-kms:             Mode: 800×600@60.31
[2020-11-09 14:12:37.260228] <information> gbm-kms:             Mode: 800×600@56.25
[2020-11-09 14:12:37.260322] <information> gbm-kms:             Mode: 720×576@50.00
[2020-11-09 14:12:37.260416] <information> gbm-kms:             Mode: 720×480@60.00
[2020-11-09 14:12:37.260511] <information> gbm-kms:             Mode: 720×480@59.94
[2020-11-09 14:12:37.260607] <information> gbm-kms:             Mode: 640×480@75.00
[2020-11-09 14:12:37.260702] <information> gbm-kms:             Mode: 640×480@72.80
[2020-11-09 14:12:37.260796] <information> gbm-kms:             Mode: 640×480@60.00
[2020-11-09 14:12:37.260891] <information> gbm-kms:             Mode: 640×480@59.94
[2020-11-09 14:12:37.287933] < -warning- > gbm-kms: drmModeCrtcSetGamma failed: Function not implemented
[2020-11-09 14:12:37.308678] <information> gbm-kms: Detected single-GPU DisplayBuffer. Rendering will be sent directly to output
[2020-11-09 14:12:37.340529] <information> mirserver: Using hardware cursor
[2020-11-09 14:12:37.375238] <information> mircommon: Loading modules from: /usr/lib/arm-linux-gnueabihf/mir/server-platform
[2020-11-09 14:12:37.375598] <information> mircommon: Loading module: /usr/lib/arm-linux-gnueabihf/mir/server-platform/graphics-gbm-kms.so.18
[2020-11-09 14:12:37.375809] <information> mircommon: Loading module: /usr/lib/arm-linux-gnueabihf/mir/server-platform/server-x11.so.18
[2020-11-09 14:12:37.375907] <information> mircommon: Loading module: /usr/lib/arm-linux-gnueabihf/mir/server-platform/graphics-wayland.so.18
[2020-11-09 14:12:37.375982] <information> mircommon: Loading module: /usr/lib/arm-linux-gnueabihf/mir/server-platform/input-evdev.so.7
[2020-11-09 14:12:37.407061] <information> mirserver: Selected input driver: mir:evdev-input (version: 2.1.0)
[2020-11-09 14:12:37.409016] <information> gbm-kms-buffer-allocator: Enabled linux-dmabuf import support
[2020-11-09 14:12:37.411031] <information> mirserver: Mir version 2.1.0
[2020-11-09 14:12:37.475686] <information> GLRenderer: EGL vendor: Mesa Project
[2020-11-09 14:12:37.475866] <information> GLRenderer: EGL version: 1.4
[2020-11-09 14:12:37.475924] <information> GLRenderer: EGL client APIs: OpenGL OpenGL_ES
[2020-11-09 14:12:37.476030] <information> GLRenderer: EGL extensions: EGL_ANDROID_blob_cache EGL_ANDROID_native_fence_sync EGL_EXT_buffer_age EGL_EXT_image_dma_buf_import EGL_EXT_image_dma_buf_import_modifiers EGL_KHR_cl_event2 EGL_KHR_config_attribs EGL_KHR_cr
eate_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_imag
e_base EGL_KHR_image_pixmap EGL_KHR_no_config_context EGL_KHR_reusable_sync EGL_KHR_surfaceless_context 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_WL_bind_wa
yland_display
[2020-11-09 14:12:37.476122] <information> GLRenderer: GL vendor: Broadcom
[2020-11-09 14:12:37.476173] <information> GLRenderer: GL renderer: VC4 V3D 2.1
[2020-11-09 14:12:37.476222] <information> GLRenderer: GL version: OpenGL ES 2.0 Mesa 20.0.8
[2020-11-09 14:12:37.476259] <information> GLRenderer: GLSL version: OpenGL ES GLSL ES 1.0.16
[2020-11-09 14:12:37.476398] <information> GLRenderer: GL extensions: GL_EXT_blend_minmax GL_EXT_multi_draw_arrays 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_mapbuff
er GL_OES_rgb8_rgba8 GL_OES_stencil8 GL_OES_texture_3D GL_OES_texture_npot GL_OES_vertex_half_float GL_OES_EGL_image GL_OES_depth_texture GL_AMD_performance_monitor GL_OES_packed_depth_stencil GL_OES_get_program_binary GL_APPLE_texture_max_level GL_EXT_discard_f
ramebuffer GL_EXT_read_format_bgra GL_EXT_frag_depth GL_NV_fbo_color_attachments GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_vertex_array_object GL_EXT_occlusion_query_boolean GL_EXT_unpack_subimage GL_NV_draw_buffers GL_NV_read_buffer GL_NV_read_depth GL_N
V_read_depth_stencil GL_NV_read_stencil GL_EXT_draw_buffers GL_EXT_map_buffer_range GL_KHR_debug GL_KHR_texture_compression_astc_ldr GL_OES_required_internalformat GL_OES_surfaceless_context GL_EXT_separate_shader_objects GL_EXT_compressed_ETC1_RGB8_sub_texture
GL_EXT_draw_elements_base_vertex GL_EXT_texture_border_clamp GL_KHR_context_flush_control GL_OES_draw_elements_base_vertex GL_OES_texture_border_clamp GL_KHR_no_error GL_KHR_texture_compression_astc_sliced_3d GL_KHR_parallel_shader_compile GL_MESA_tile_raster_or
der
[2020-11-09 14:12:37.476513] <information> GLRenderer: GL max texture size = 2048
[2020-11-09 14:12:37.476575] <information> GLRenderer: GL framebuffer bits: RGBA=8880, depth=0, stencil=0
[2020-11-09 14:12:37.482045] <information> mirserver: Initial display configuration:
[2020-11-09 14:12:37.482153] <information> mirserver: * Output 1: HDMI-A connected, used
[2020-11-09 14:12:37.482209] <information> mirserver: . |_ EDID monitor name: HDMI Monitor
[2020-11-09 14:12:37.482255] <information> mirserver: . |_ EDID manufacturer: FUN
[2020-11-09 14:12:37.482300] <information> mirserver: . |_ EDID product code: 40241
[2020-11-09 14:12:37.482354] <information> mirserver: . |_ Physical size 39.7" 880x490mm
[2020-11-09 14:12:37.482395] <information> mirserver: . |_ Power is on
[2020-11-09 14:12:37.482438] <information> mirserver: . |_ Current mode 1920x1080 60.00Hz
[2020-11-09 14:12:37.482481] <information> mirserver: . |_ Preferred mode 1920x1080 60.00Hz
[2020-11-09 14:12:37.482566] <information> mirserver: . |_ Orientation normal
[2020-11-09 14:12:37.482617] <information> mirserver: . |_ Logical size 1920x1080
[2020-11-09 14:12:37.482658] <information> mirserver: . |_ Logical position +0+0
[2020-11-09 14:12:37.482695] <information> mirserver: . |_ Scaling factor: 1.00
Saving GLMark2 detailed results to: /tmp/GLMark2Wayland_fullscreen.log
[2020-11-09 14:12:37.783020] < - debug - > gbm-kms: Failed to import dmabuf-based image as FB: Unknown error -2
[2020-11-09 14:12:40.103336] < - debug - > gbm-kms: Failed to import dmabuf-based image as FB: Unknown error -2
[2020-11-09 14:12:40.149626] < - debug - > gbm-kms: Failed to import dmabuf-based image as FB: Unknown error -2
[2020-11-09 14:12:40.216392] < - debug - > gbm-kms: Failed to import dmabuf-based image as FB: Unknown error -2
Segmentation fault (core dumped)
/build/mir-h1TcuG/mir-2.1.0+dev131-g44237c6b9f/tests/performance-tests/test_glmark2-es2.cpp:266: Failure
Expected: (run_glmark2("--fullscreen")) > (0), actual: -1 vs 0
[2020-11-09 14:12:44.119082] <information> mirserver: Stopping
[  FAILED  ] GLMark2Wayland.fullscreen (7366 ms)
[----------] 1 test from GLMark2Wayland (7366 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test suite ran. (7366 ms total)
[  PASSED  ] 0 tests.
[  FAILED  ] 1 test, listed below:
[  FAILED  ] GLMark2Wayland.fullscreen

 1 FAILED TEST
RAOF commented 3 years ago

When reserving a system with

job_queue: rpi3-001
provision_data:
    url: http://cdimage.ubuntu.com/releases/focal/release/ubuntu-20.04.1-preinstalled-server-armhf+raspi.img.xz
reserve_data:
    ssh_keys:
    - lp:${YOU}

I get a Pi3 without KMS support enabled. Is that expected?

And when setting dtoverlay=vc4-fkms-v3d in /boot/firmware/usercfg.txt and rebooting the Pi is constantly spewing errors to dmesg and doesn't bring SSH back up?!

AlanGriffiths commented 3 years ago

It is easier to reproduce #1802 and possible that the fix is common

RAOF commented 3 years ago

dmesg when the crash happens:

[ 1940.430288] [drm:vc4_bo_create [vc4]] *ERROR* Failed to allocate from CMA:
[ 1940.441565] vc4-drm soc:gpu: [drm]                            V3D:  99840kb BOs (21)
[ 1940.441585] vc4-drm soc:gpu: [drm]                     V3D shader:     24kb BOs (6)
[ 1940.441601] vc4-drm soc:gpu: [drm]                           dumb:   4068kb BOs (2)
[ 1940.441617] vc4-drm soc:gpu: [drm]                         binner:  16384kb BOs (1)
[ 1940.441632] vc4-drm soc:gpu: [drm]                kernel BO cache:     12kb BOs (2)
[ 1940.441649] vc4-drm soc:gpu: [drm]                total purged BO:    640kb BOs (4)

We're exceeding the 128MB CMA region, and something is not handling out-of-GPU-memory cleanly.

Saviq commented 2 years ago

I can confirm this still happens, and we need to talk what's next for bypass.