Debian8+SabreSD: Can't enable 3D HW acceleration

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Debian8+SabreSD: Can't enable 3D HW acceleration

Jump to solution
4,658 Views
jameszt
Contributor II

I have spent some days to make a Debian8 system on SabreSD board, begins with Debian on the i.MX6 sabre sd platform in a few commands .

My code base is standard Yocto1.7 package "fsl-yocto-3.14.28-1.0.0" where 3D HW acceleration works fine when I run "es2_info" or demos in fsl_gpu_sdk.

For Linux kernel part, I keep debian same as yocto1.7.

For Rootfs, I move GFX relative libaries from  "fsl-yocto-3.14.28-1.0.0", i.e. imx-gpu-viv, libdrm, mesa-demos, fsl-gpu-sdk, recompiling "xf86-video-imxfb-vivante" natively, set /etc/X11/xorg.conf as,

Section "Device"     
Identifier "i.MX Accelerated Framebuffer Device"
      
Driver  "vivante"
      
Option  "fbdev" "/dev/fb0"
      
Option  "vivante_fbdev" "/dev/fb0"
      
Option  "HWcursor"     "false"

EndSection

then, Vivante xorg driver can make my LXDE desktop work happily.  but when I run  "es2_info", it prints

                        libEGLwarning: DRI2: falied to authenticate

                        EGL_VERSION: 1.4(DRI2)

                        EGL_VENDOR:  Mesa Project

                         ..........

                        GL_VERSION: OpenGL ES2.0 Mesa 10.6.3

                        GL_RENDERER:  Software Rasterizer

                        .........

obviously, OpenGL ES is SW path. Please give some hints on how to enable HW path as Yocto1.7 does.  Thanks.

Yours,

James

Labels (1)
Tags (1)
1 Solution
3,205 Views
laszlotimko
Contributor III

Dear James,

I think vivante_drv.so comes from xserver-xorg-video-imx-viv package:

http://downloads.yoctoproject.org/mirror/sources/xserver-xorg-video-imx-viv-5.0.11.p4.4.tar.gz

Build:

  BUILD_HARD_VFP=1 XSERVER_GREATER_THAN_13=1 BUSID_HAS_NUMBER=1 ./fastbuild.sh

  ./fastbuild.sh install

Regards,

Laszlo

View solution in original post

0 Kudos
Reply
15 Replies
3,205 Views
laszlotimko
Contributor III

Hello,

I have a working 3d acceleration in Debian 8. Here is a good starting point: http://pushpopmov.blogspot.hu/2015/01/vivante-gpu-drivers-on-imx6.html

The process I have made:

  • installed imx-gpu-viv 5.0.11.p4.4 libraries
  • set up valid symlinks (libGAL-x11.so, libEGL-x11.so, libVIVANTE-x11.so, libGLESv2-x11.so, libGAL_egl.dri.so)
  • removed Mesa's libEGL, libGLESv2, libGL libraries to prevent it from loading
  • added default Xorg.conf from repo
  • rebuilt libdrm2 with drm-update-arm.patch (apt-get build-dep libdrm ; apt-get source libdrm ; dpkg-buildpackage -us -uc -n)
  • copied /usr/bin/Xorg binary from Yocto build to my Debian (xserver-xorg-1.16.1-r0.cortexa9hf_vfp_neon_mx6qdl.rpm contains it)

The last one is really a nasty workaround, but it works. I should have rebuilt Debian's Xorg from source but it failed. So if you are able to recompile a working Xorg binary please share the process.

Regards

3,205 Views
jameszt
Contributor II

Hi Laszlo Timko, is libglapi.so necessary for DRI HW acceleration? where do you get this file to your Debian system?

when my system has libglapi.so(.0.0.0) under usr/lib/arm-linu-gnueabihf/, the es2_info will report "Segmentation fault", if I remove it, es2_info shows "Xlib: extension "XFree86-DRI" missing on display ":0"", the remaining part of es2_info seems that HW acceleration is enabled, same as Yocto1.7's es2_info result. But when I run 3D demos such as es2gears_x11, the demo can run but nothing is shown in the window.

Thanks for your help in advance.

0 Kudos
Reply
3,205 Views
laszlotimko
Contributor III

Dear James,

It seems to me that libglapi.so is not necessary for hw acceleration. I think I have the same file as you, but it is not relevant because this library is not loaded. I checked it with strace.

How does your Xorg.log file look like?

0 Kudos
Reply
3,205 Views
jameszt
Contributor II

Hi Laszlo Timko, thanks for your great help. my Xorg.conf is as following, I am still struggling to make DRI work.

Section "ServerLayout"
    Identifier "Default Layout"
    Screen "Default Screen"
EndSection

Section "Module"
    Load "dbe"
    Load "extmod"
    Load "freetype"
    Load "glx"
    Load "dri"
EndSection

Section "InputDevice"
    Identifier "Generic Keyboard"
    Driver "kbd"
    Option "XkbLayout" "us"
    Option "XkbModel" "pc105"
    Option "XkbRules" "xorg"
EndSection

Section "InputDevice"
    Identifier "Configured Mouse"
    Driver "mouse"
    Option "CorePointer"
EndSection

Section "Device"
    Identifier  "i.MX Accelerated Framebuffer Device"
    Driver      "vivante"
    Option      "fbdev"     "/dev/fb0"
    Option      "vivante_fbdev" "/dev/fb0"
    Option      "HWcursor"  "false"
EndSection

Section "Monitor"
    Identifier "Configured Monitor"
EndSection

Section "Screen"
    Identifier "Default Screen"
    Monitor "Configured Monitor"
    Device "i.MX Accelerated Framebuffer Device"
    DefaultDepth 24
EndSection

Section "DRI"
    Mode 0666
EndSection

And the result of es2_info is,

Xlib:  extension "XFree86-DRI" missing on display ":0".

Xlib:  extension "XFree86-DRI" missing on display ":0".

Xlib:  extension "XFree86-DRI" missing on display ":0".

EGL_VERSION: 1.4

EGL_VENDOR: Vivante Corporation

EGL_EXTENSIONS:

    EGL_KHR_reusable_sync, EGL_KHR_fence_sync, EGL_KHR_image,

    EGL_KHR_image_base, EGL_KHR_image_pixmap, EGL_KHR_gl_texture_2D_image,

    EGL_KHR_gl_texture_cubemap_image, EGL_KHR_gl_renderbuffer_image,

    EGL_KHR_lock_surface, EGL_KHR_create_context,

    EGL_EXT_create_context_robustness, EGL_EXT_buffer_age,

    EGL_EXT_protected_surface

EGL_CLIENT_APIS: OpenGL_ES OpenVG

GL_VERSION: OpenGL ES 3.0 V5.0.11.p4.25762

GL_RENDERER: Vivante GC2000

GL_EXTENSIONS:

    GL_OES_vertex_type_10_10_10_2, GL_OES_vertex_half_float,

    GL_OES_element_index_uint, GL_OES_mapbuffer, GL_OES_vertex_array_object,

    GL_OES_compressed_ETC1_RGB8_texture, GL_OES_compressed_paletted_texture,

    GL_OES_texture_npot, GL_OES_rgb8_rgba8, GL_OES_depth_texture,

    GL_OES_depth_texture_cube_map, GL_OES_depth24, GL_OES_depth32,

    GL_OES_packed_depth_stencil, GL_OES_fbo_render_mipmap,

    GL_OES_get_program_binary, GL_OES_fragment_precision_high,

    GL_OES_standard_derivatives, GL_OES_EGL_image, GL_OES_EGL_sync,

    GL_EXT_texture_type_2_10_10_10_REV, GL_EXT_texture_filter_anisotropic,

    GL_EXT_texture_format_BGRA8888, GL_EXT_read_format_bgra,

    GL_EXT_multi_draw_arrays, GL_EXT_frag_depth, GL_EXT_discard_framebuffer,

    GL_EXT_blend_minmax, GL_EXT_multisampled_render_to_texture,

    GL_EXT_robustness, GL_VIV_tex_direct

0 Kudos
Reply
3,205 Views
laszlotimko
Contributor III

Dear James,

Please share your Xorg.log instead of conf.

Es2_info output seems ok, but of course I don't get those XFree86-DRI error lines.

Have you removed libEGL, libGLESv2, libGL libraries from /usr/lib/arm-linux-gnueabihf?

Cheers

0 Kudos
Reply
3,205 Views
jameszt
Contributor II

Dear Laszlo Timko,  Sorry, I put Xorg.0.log here.

I removed all orginal Debian's mesa libraries from /usr/lib, and put iMX'6 libraries into  /usr/lib/arm-linux-gnueabihf.

Please share me your libglapi.so.0.0.0 if you have on your system, of course, you've said it maybe useless.

BRs,

James

0 Kudos
Reply
3,205 Views
laszlotimko
Contributor III

Dear Liu,

Links to my files are attached.

Laszlo

0 Kudos
Reply
3,205 Views
jameszt
Contributor II

Dear Laszlo, Thanks a lot for your help, With your files, the 3D WORKS!!!

My vivante_drv.so will cause "segment fault" issue, but yours will not. May I know how you  compile the xorg driver?  my steps are as following,

apt-get install build-essential

apt-get install xserver-xorg-dev libxext-dev

tar -zxvf imx-gpu-viv_1_5.0.11.p4.4-hfp.tar.gz -C /

following build document in the tar package, please don't set YOCTO=1.

The EXA works fine but DRI fails.   

Thanks again.

BRs,

James

0 Kudos
Reply
3,206 Views
laszlotimko
Contributor III

Dear James,

I think vivante_drv.so comes from xserver-xorg-video-imx-viv package:

http://downloads.yoctoproject.org/mirror/sources/xserver-xorg-video-imx-viv-5.0.11.p4.4.tar.gz

Build:

  BUILD_HARD_VFP=1 XSERVER_GREATER_THAN_13=1 BUSID_HAS_NUMBER=1 ./fastbuild.sh

  ./fastbuild.sh install

Regards,

Laszlo

0 Kudos
Reply
3,205 Views
jameszt
Contributor II

Dear Laszlo,  YES!  With your great help, I finally found that I didn't add  BUILD_HARD_VFP=1, because the document said" for kernel 3.5.7, use "BUSID_HAS_NUMBER=1"" but I am using 3.14 kernel.  besides my careless, I do think freescale guys should update their document for avoiding any missunderstanding.

Thanks again for your help!

BRs,

James

0 Kudos
Reply
3,205 Views
jameszt
Contributor II

Dear Laszlo,

         Sorry to bother you again, I just returned to this project recentlly, but I find while 3D apps running on debian8, mouse clicking on somewhere else will cause system hang randomly, have you ever met this issue?

BRs,

James

0 Kudos
Reply
3,205 Views
laszlotimko
Contributor III

Hi,

Strange. I have never experienced this kind of issue.

Laszlo

0 Kudos
Reply
3,205 Views
jameszt
Contributor II

Hi Laszlo Timko, lots of thanks to your sharing, I will try your solution soon.

The way to native build Xorg driver is:         

apt-get install build-essential

apt-get install xserver-xorg-dev libxext-dev

tar -zxvf imx-gpu-viv_1_5.0.11.p4.4-hfp.tar.gz -C /

following build document in the tar package, please don't set YOCTO=1.

I didn't build xorg  server from source code either.

0 Kudos
Reply
3,205 Views
jameszt
Contributor II

As I know, drm.ko/vivante.ko/galcore.ko is built in the linux kernel, are there any other kernel modules are required for enable 3D HW acceleation?

I attached Xorg.o.log and the result of es2_info here.

Thanks for anyone's help!

0 Kudos
Reply
3,205 Views
jameszt
Contributor II

I just tried to copy libEGL.so* /libGLES*.*  from /usr/lib/ to /usr/lib/arm-linux-gnueabihf/,

the es2_info reports "Segmentation fault", maybe this operation has some relative to my issue. I will continue to dig.

0 Kudos
Reply