This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM335x: COG browser / kmscube problem



Hi all,

I tried to get COG browser running on amm335x based board similiar to am335x-evm

Therefore I builded the TI SDK with the following commands:

$ git clone git.ti.com/.../oe-layersetup.git tisdk
$ cd tisdk
$ ./oe-layertool-setup.sh -f configs/processor-sdk/processor-sdk-09.01.00-config.txt
$ cd build
$ . conf/setenv
$ MACHINE=am335x-evm bitbake -k tisdk-default-image

And added our own DTS to the kernel build. Linux boots fine and I see
on start the DEMO application running, so all fine!

Booting with rootfs mounted as a NFS.

Running modetest is also fine. But starting kmscube fails with error

"""
cbc-linux: ~> kmscube
MESA: info: Loaded libpvr_dri_support.so
Using display 0x1a2018 with EGL version 1.4
===================================
EGL information:
  version: "1.4"
  vendor: "Mesa Project"
  client extensions: "EGL_EXT_client_extensions EGL_EXT_device_base EGL_EXT_device_enumeration
EGL_EXT_device_query EGL_EXT_platform_base EGL_KHR_client_get_all_proc_addresses EGL_KHR_debug
EGL_EXT_platform_device EGL_EXT_platform_wayland EGL_KHR_platform_wayland EGL_EXT_platform_x11
EGL_KHR_platform_x11 EGL_EXT_platform_xcb EGL_MESA_platform_gbm EGL_KHR_platform_gbm
EGL_MESA_platform_surfaceless"
  display extensions: "EGL_EXT_buffer_age EGL_EXT_create_context_robustness
EGL_EXT_image_dma_buf_import EGL_EXT_image_dma_buf_import_modifiers EGL_EXT_yuv_surface
EGL_KHR_config_attribs EGL_KHR_create_context EGL_KHR_fence_sync EGL_KHR_get_all_proc_addresses
EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_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_EXT_pixel_format_float EGL_KHR_wait_sync
EGL_MESA_configless_context EGL_MESA_drm_image EGL_WL_bind_wayland_display EGL_IMG_cl_image "
===================================
OpenGL ES 2.x information:
  version: "OpenGL ES 2.0 build 1.17@4948957"
  shading language version: "OpenGL ES GLSL ES 1.00 build 1.17@4948957"
  vendor: "Imagination Technologies"
  renderer: "PowerVR SGX 530"
  extensions: "GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth24 GL_OES_depth_texture
GL_OES_egl_sync GL_OES_element_index_uint GL_OES_EGL_image GL_OES_EGL_image_external
GL_OES_fbo_render_mipmap GL_OES_fragment_precision_high GL_OES_get_program_binary GL_OES_mapbuffer
GL_OES_packed_depth_stencil GL_OES_required_internalformat GL_OES_rgb8_rgba8
GL_OES_standard_derivatives GL_OES_surfaceless_context GL_OES_texture_float
GL_OES_texture_half_float GL_OES_vertex_array_object GL_OES_vertex_half_float GL_EXT_blend_minmax
GL_EXT_discard_framebuffer GL_EXT_multi_draw_arrays GL_EXT_multisampled_render_to_texture
GL_EXT_shader_texture_lod GL_EXT_texture_format_BGRA8888 GL_EXT_texture_rg
GL_IMG_multisampled_render_to_texture GL_IMG_program_binary GL_IMG_read_format GL_IMG_shader_binary
GL_IMG_texture_compression_pvrtc GL_IMG_texture_format_BGRA8888 GL_IMG_texture_npot
GL_IMG_uniform_buffer_object GL_KHR_debug GL_EXT_texture_storage"
===================================
Using modifier ffffffffffffff
failed to set mode: Invalid argument
cbc-linux: ~>
"""

DTS regarding panel setup is the same as in am335x-evm.dts, no difference
regarding panel, lcd, backlight nodes...

just other setup in driver from drivers/gpu/drm/panel/panel-simple.c
is used...

Than adding layer

 https://github.com/Igalia/meta-webkit


  commit c3305f69a42081153a02c5263aff3859009361bf (HEAD -> main, origin/master, origin/main,
origin/HEAD)
  Author: Pablo Saavedra <psaavedra@igalia.com>
  Date:   Thu Jan 25 16:11:32 2024 +0100

      ci: update the test job definitions

and adding to auto.conf


  IMAGE_INSTALL:append = " wpewebkit cog "
  PREFERRED_PROVIDER_virtual/wpebackend = "wpebackend-fdo"
  PACKAGECONFIG:remove:pn-wpewebkit = " jit"

So I have cog binary in rootfs. Starting cog drops the following
error messages:

"""
cbc-linux: ~> cog -P wl google.de
MESA: info: Loaded libpvr_dri_support.so
PVR:(Error): PVRDRICreateScreenImpl: Failed to create display device (err=19) [0, ]
MESA: info: Unloaded libpvr_dri_support.so
libEGL warning: egl: failed to create dri2 screen
MESA: info: Loaded libpvr_dri_support.so
PVR:(Error): PVRDRICreateScreenImpl: Failed to create display device (err=19) [0, ]
MESA: info: Unloaded libpvr_dri_support.so
libEGL warning: egl: failed to create dri2 screen
"""

Okay -19 -> ENODEV ??

/dev/dri/card0 is there! modetest detects the correct settings...

Also we see the opened webpage! But cog runs with 100% cpu time
if any mouse action is done on the webpage and I suspect it runs
without GPU support.

Is there any chance to see, that GPU drivers are used?

My assumption is, that the GPU driver cannot open the display,
and so it falls back to software rendering ...

How can I debug this? How can I find out, how to solve:

PVR:(Error): PVRDRICreateScreenImpl: Failed to create display device (err=19) [0, ]

Any hints/ideas?

thanks in advance

Sidenote: I have also a 5.10 based kernel running with mainline
  yocto layers and ti-sgx* recipes from meta-ti
  kmscube runs there fine with 60fps and shows on start that
  GPU drivers are used.

  • Hello,

    The kmscube error is known and our software team is looking into it. However, GPU should be functional and Qt/other frameworks would be GPU accelerated. With regards to your browser, I am not sure about the expected output because we have not tested or experimented with cog.

    Regards,
    Krunal

  • Hi Krunal,

    Thanks for the info, feel free to contact me, if we can test something for you!

    Starting to matrx_browser and it seems, that it also does not use GPU...

    top output:
    1514 root      20   0  234680  88532  51632 R  63.9  17.6   0:09.01 matrix_browser                                                                                                            
    1504 weston    20   0   48320  35632  25392 R  29.7   7.1   0:02.27 weston  

    console log:

    $ matrix_browser http://agathon/****/index.html
    qt.network.ssl: QSslSocket: cannot resolve EVP_PKEY_base_id
    qt.network.ssl: QSslSocket: cannot resolve SSL_get_peer_certificate
    MESA: info: Loaded libpvr_dri_support.so
    PVR:(Error): PVRDRICreateScreenImpl: Failed to create display device (err=19) [0, ]
    MESA: info: Unloaded libpvr_dri_support.so
    libEGL warning: egl: failed to create dri2 screen
    qt.qpa.wayland: Wayland does not support QWindow::requestActivate()

    Here for reference the cog console output:

    $ cog -P wl  http://agathon/****/index.html
    MESA: info: Loaded libpvr_dri_support.so
    PVR:(Error): PVRDRICreateScreenImpl: Failed to create display device (err=19) [0, ]
    MESA: info: Unloaded libpvr_dri_support.so
    libEGL warning: egl: failed to create dri2 screen
    MESA: info: Loaded libpvr_dri_support.so
    PVR:(Error): PVRDRICreateScreenImpl: Failed to create display device (err=19) [0, ]
    MESA: info: Unloaded libpvr_dri_support.so
    libEGL warning: egl: failed to create dri2 screen
    Cog-Core-Message: 06:08:27.252: <agathon/.../index.html> Load started.
    Cog-Core-Message: 06:08:27.405: <agathon/.../index.html> Loading...
    Cog-Core-Message: 06:08:35.239: <agathon/.../index.html> Loaded successfully.

    So this is the same behaviour as with cog browser. Added below also a modetest
    output, setup seems good to me.

    I think problem is:

    PVR:(Error): PVRDRICreateScreenImpl: Failed to create display device (err=19) [0, ]

    but I have no idea how to debug/fix this ...

    Thanks!

    bye,

    Heiko


    $ modetest
    trying to open device 'i915'...failed
    trying to open device 'amdgpu'...failed
    trying to open device 'radeon'...failed
    trying to open device 'nouveau'...failed
    trying to open device 'vmwgfx'...failed
    trying to open device 'omapdrm'...failed
    trying to open device 'exynos'...failed
    trying to open device 'tilcdc'...done
    Encoders:
    id      crtc    type    possible crtcs  possible clones
    34      33      none    0x00000001      0x00000001

    Connectors:
    id      encoder status          name            size (mm)       modes   encoders
    35      34      connected       DPI-1           154x86          1       34
     modes:
           index name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot
     #0 800x480 61.89 800 839 886 925 480 493 495 524 30000 flags: ; type: preferred, driver
     props:
           1 EDID:
                   flags: immutable blob
                   blobs:

                   value:
           2 DPMS:
                   flags: enum
                   enums: On=0 Standby=1 Suspend=2 Off=3
                   value: 0
           5 link-status:
                   flags: enum
                   enums: Good=0 Bad=1
                   value: 0
           6 non-desktop:
                   flags: immutable range
                   values: 0 1
                   value: 0
           4 TILE:
                   flags: immutable blob
                   blobs:

                   value:

    CRTCs:
    id      fb      pos     size
    33      37      (0,0)   (800x480)
     #0 800x480 61.89 800 839 886 925 480 493 495 524 30000 flags: ; type: preferred, driver
     props:
           24 VRR_ENABLED:
                   flags: range
                   values: 0 1
                   value: 0

    Planes:
    id      crtc    fb      CRTC x,y        x,y     gamma size      possible crtcs
    31      33      37      0,0             0,0     0               0x00000001
     formats: BG16 RG24 XR24
     props:
           8 type:
                   flags: immutable enum
                   enums: Overlay=0 Primary=1 Cursor=2
                   value: 1
           30 IN_FORMATS:
                   flags: immutable blob
                   blobs:

                   value:
                           01000000000000000300000018000000
                           01000000280000004247313652473234
                           58523234000000000700000000000000
                           00000000000000000000000000000000
                   in_formats blob decoded:
                            BG16:  LINEAR
                            RG24:  LINEAR
                            XR24:  LINEAR

    Frame buffers:
    id      size    pitch


    $ dmesg | grep pvr
    [   48.031894] [drm] Initialized pvr 1.17.4948957 20110701 for 56000000.gpu on minor 1
    $ dmesg | grep PVR
    [   90.664838] PVR_K: UM DDK-(4948957) and KM DDK-(4948957) match. [ OK ]
    $ dmesg | grep tilcd
    [    2.429957] [drm] Initialized tilcdc 1.0.0 20121205 for 4830e000.lcdc on minor 0
    [    2.516409] tilcdc 4830e000.lcdc: [drm] fb0: tilcdcdrmfb frame buffer device

  • Do you only see the above error with a browser? If you try running qt example or glmark2, do you see similar error?

    Regards,
    Krunal

  • $ glmark2-es2-drm  
    MESA: info: Loaded libpvr_dri_support.so
    PVR:(Error): PVRSRVBridgeCall: Failed to access device.  Function ID:3223086849 (strerror returns no value.). [0, ]
    PVR:(Error): PVRSRVEnumerateDevices: BridgeCall failed [0, ]
    PVR:(Error): PVRSRVConnect: Unable to enumerate devices. [0, ]
    PVR:(Error): Couldn't connect to services [0, ]
    PVR:(Error): PVRDRIEGLGlobalDataInit: PVR Services initialisation failed [0, ]
    PVR:(Error): PVRDRICreateScreenImpl: Couldn't create EGL global data [0, ]
    MESA: info: Unloaded libpvr_dri_support.so
    MESA-LOADER: failed to open zink: /usr/lib/dri/zink_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/dri, suffix _dri)
    failed to load driver: zink
    =======================================================
       glmark2 2021.12
    =======================================================
       OpenGL Information
       GL_VENDOR:     Mesa/X.org
       GL_RENDERER:   softpipe
       GL_VERSION:    OpenGL ES 3.1 Mesa 22.3.5 (git-7c9522a414)
    =======================================================
    [build] use-vbo=false: FPS: 1 FrameTime: 1000.000 ms
    [build] use-vbo=true: FPS: 3 FrameTime: 333.333 ms
    [texture] texture-filter=nearest: FPS: 1 FrameTime: 1000.000 ms
    [texture] texture-filter=linear: FPS: 1 FrameTime: 1000.000 ms
    [texture] texture-filter=mipmap:^C FPS: 0 FrameTime: inf ms
    =======================================================
                                     glmark2 Score: 1  
    =======================================================

    $ /usr/share/qt5/examples/gui/analogclock/analogclock
    MESA: info: Loaded libpvr_dri_support.so
    PVR:(Error): PVRDRICreateScreenImpl: Failed to create display device (err=19) [0, ]
    MESA: info: Unloaded libpvr_dri_support.so
    libEGL warning: egl: failed to create dri2 screen

    ^C

    bye,

    Heiko

  • Hello,

    I just flashed our 9.01 image and glmark-es2-drm works fine. Here is the log:
    root@am335x-evm:~# glmark2-es2-drm
    MESA: info: Loaded libpvr_dri_support.so
    =======================================================
        glmark2 2021.12
    =======================================================
        OpenGL Information
        GL_VENDOR:     Imagination Technologies
        GL_RENDERER:   PowerVR SGX 530
        GL_VERSION:    OpenGL ES 2.0 build 1.17@4948957
    =======================================================
    [build] use-vbo=false:^C FPS: 59 FrameTime: 16.949 ms
    =======================================================

    Based on your logs, it is using softpipe and does not seem to find GPU library. Can you try the following command to see if GPU module is loaded: lsmod | grep -i pvr

    Regards,
    Krunal