Raspberry Pi 3의 GPU가 64bit linux(aarch64)에서도 사용할 수 있게 되었다

이 기사는 ACCESS Advent Calendar 2017의 11일째 기사입니다.
(원래 투고하려고 생각했던 내용이 아직 잘 정리되어 있지 않으므로, 별도 재료입니다)

Raspberry Pi 3의 SoC에는 VideoCore IV라는 GPU가 실려 있습니다.
32bit linux(armv7l)에서라면 2016년에는
ht tp // Mic y y 핫 py 굿. 하테나 bぉg. 코m/엔트리/2016/11/03/001257
에 있듯이 Raspberry Pi 3에서 OpenGLES에서 GPU Acceleration을 사용할 수 있었지만,
htps : // 기주 b. 코 m / 라 sp 베 ry 피 / 우세 r ぁ d / 이스에 s / 314
등을 보고, 64bit linux(aarch64)에서는 아직 GPU를 사용할 수 없다(OpenGLES의 처리를 CPU로 실시한다)라고 생각했습니다.

그런데 올해의 가을
htps : // 기 t. 요 c와 p 로지 ct. rg/c t/c t. c기/메타라 sp 벨 ry 피/코미 t/? h=로c코&이 d=ーb51049에베761아c2806후00후492c586976632011
에 의해, yocto 2.4 (rocko)로 aarch64 빌드한 linux로 GPU Acceleration가 효력이 있게 된 모양.
커널 모듈과 Mesa(OpenGL 라이브러리)의 대응이 진행되어 잘 협동하게 되었다는 것입니까.

빌드하고 시작해 보았습니다.
(사정에 따라 poky와 OE는 2.3 (pyro), meta-raspberrypi는 2.4 (rocko)라는 조합입니다만...)
aarch64 빌드를 위해 local.conf에 MACHINE = "raspberrypi3-64" 를 기재하고 bitbake core-image-sato 했습니다.

dmesg 발췌:
[    0.000000] Linux version 4.9.50 (oe-user@oe-host) (gcc version 5.4.0 (GCC) ) #1 SMP PREEMPT Tue Dec 5 14:36:16 UTC 2017
[    0.000000] Boot CPU: AArch64 Processor [410fd034]

[    0.211370] raspberrypi-firmware soc:firmware: Attached to firmware from 2017-08-08 12:01
[    0.447095] [drm] Initialized

[    2.544958] vc4-drm soc:gpu: bound 3f600000.firmwarekms (ops vc4_fkms_ops [vc4])
[    2.575580] vc4-drm soc:gpu: bound 3fc00000.v3d (ops vc4_v3d_ops [vc4])
[    2.577951] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    2.577982] [drm] Driver supports precise vblank timestamp query.
[    2.834165] vc4-drm soc:gpu: fb0:  frame buffer device

X.org 시작 로그(Xorg.0.log) 발췌:
[     4.778] (II) LoadModule: "modesetting"
[     4.779] (II) Loading /usr/lib/xorg/modules/drivers/modesetting_drv.so
[     4.785] (II) Module modesetting: vendor="X.Org Foundation"
[     4.785]    compiled for 1.19.1, module version = 1.19.1
[     4.786]    Module class: X.Org Video Driver
[     4.786]    ABI class: X.Org Video Driver, version 23.0
[     4.787] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[     4.787] (--) using VT number 2

[     4.849] (II) modeset(0): using drv /dev/dri/card0
[     4.849] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[     4.851] (II) modeset(0): Creating default Display subsection in Screen section
    "Default Screen Section" for depth/fbbpp 24/32
[     4.851] (==) modeset(0): Depth 24, (==) framebuffer bpp 32
[     4.851] (==) modeset(0): RGB weight 888
[     4.851] (==) modeset(0): Default visual is TrueColor
[     4.851] (II) Loading sub module "glamoregl"
[     4.851] (II) LoadModule: "glamoregl"
[     4.851] (II) Loading /usr/lib/xorg/modules/libglamoregl.so
[     4.953] (II) Module glamoregl: vendor="X.Org Foundation"
[     4.954]    compiled for 1.19.1, module version = 1.0.0
[     4.954]    ABI class: X.Org ANSI C Emulation, version 0.4
[     4.954] (II) glamor: OpenGL accelerated X.org driver based.
[     5.258] (II) glamor: EGL version 1.4 (DRI2):
[     5.307] (II) modeset(0): glamor initialized
[     5.308] (II) modeset(0): Output HDMI-1 has no monitor section
[     5.309] (II) modeset(0): EDID for output HDMI-1
[     5.309] (II) modeset(0): Printing probed modes for output HDMI-1
[     5.309] (II) modeset(0): Modeline "1920x1080"x60.0  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync (67.2 kHz)
[     5.309] (II) modeset(0): Output HDMI-1 connected
[     5.309] (II) modeset(0): Using sloppy heuristic for initial modes
[     5.309] (II) modeset(0): Output HDMI-1 using initial mode 1920x1080 +0+0
[     5.309] (==) modeset(0): Using gamma correction (1.0, 1.0, 1.0)
[     5.309] (==) modeset(0): DPI set to (96, 96)
[     5.309] (II) Loading sub module "fb"
[     5.309] (II) LoadModule: "fb"
[     5.309] (II) Loading /usr/lib/xorg/modules/libfb.so
[     5.322] (II) Module fb: vendor="X.Org Foundation"
[     5.322]    compiled for 1.19.1, module version = 1.0.0
[     5.322]    ABI class: X.Org ANSI C Emulation, version 0.4
[     5.322] (==) Depth 24 pixmap format is 32 bpp
[     5.810] (==) modeset(0): Backing store enabled
[     5.811] (==) modeset(0): Silken mouse enabled
[     5.811] (II) modeset(0): RandR 1.2 enabled, ignore the following RandR disabled message.
[     5.812] (==) modeset(0): DPMS enabled
[     5.812] (II) modeset(0): [DRI2] Setup complete
[     5.812] (II) modeset(0): [DRI2]   DRI driver: vc4
[     5.812] (II) modeset(0): [DRI2]   VDPAU driver: vc4
[     5.812] (--) RandR disabled
[     5.828] (II) AIGLX: enabled GLX_MESA_copy_sub_buffer
[     5.828] (II) AIGLX: enabled GLX_ARB_create_context
[     5.828] (II) AIGLX: enabled GLX_ARB_create_context_profile
[     5.828] (II) AIGLX: enabled GLX_EXT_create_context_es{,2}_profile
[     5.828] (II) AIGLX: enabled GLX_INTEL_swap_event
[     5.828] (II) AIGLX: enabled GLX_SGI_swap_control
[     5.828] (II) AIGLX: enabled GLX_EXT_framebuffer_sRGB
[     5.828] (II) AIGLX: enabled GLX_ARB_fbconfig_float
[     5.828] (II) AIGLX: enabled GLX_EXT_fbconfig_packed_float
[     5.828] (II) AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects
[     5.832] (II) AIGLX: Loaded and initialized vc4
[     5.832] (II) GLX: Initialized DRI2 GL provider for screen 0

es2_info 출력:
EGL_VERSION: 1.4 (DRI2)
EGL_VENDOR: Mesa Project
EGL_EXTENSIONS:
    EGL_CHROMIUM_sync_control, EGL_EXT_image_dma_buf_import, 
    EGL_KHR_cl_event2, EGL_KHR_config_attribs, EGL_KHR_create_context, 
    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_wait_sync, 
    EGL_MESA_configless_context, EGL_MESA_drm_image, 
    EGL_MESA_image_dma_buf_export, EGL_NOK_swap_region, 
    EGL_NOK_texture_from_pixmap, EGL_NV_post_sub_buffer, 
    EGL_WL_bind_wayland_display
EGL_CLIENT_APIS: OpenGL OpenGL_ES 
GL_VERSION: OpenGL ES 2.0 Mesa 17.0.2
GL_RENDERER: Gallium 0.4 on VC4 V3D 2.1
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_mapbuffer, 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_OES_packed_depth_stencil, 
    GL_EXT_texture_type_2_10_10_10_REV, GL_OES_get_program_binary, 
    GL_APPLE_texture_max_level, GL_EXT_discard_framebuffer, 
    GL_EXT_read_format_bgra, GL_NV_fbo_color_attachments, 
    GL_OES_EGL_image_external, GL_OES_EGL_sync, GL_OES_vertex_array_object, 
    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_OES_surfaceless_context, GL_EXT_separate_shader_objects, 
    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_RENDERER: Gallium 0.4 on VC4 V3D 2.1 그리고 있기 때문에, 제대로 GPU Acceleration 하는 것 같습니다.

mesa-demos 패키지를 넣고 es2gears_x11을 표시한 곳 :

Full HD 스크린에 대해 46FPS 나왔습니다.

좋은 웹페이지 즐겨찾기