OpenGL ES on i.MX6 with X11 - GPU SDK

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

OpenGL ES on i.MX6 with X11 - GPU SDK

Jump to solution
27,045 Views
davecbluechip
Contributor III

I am using the samples in the recently released GPU SDK and am having trouble getting the hardware acceleration working under X11.

Just to be clear, I am not talking about using hardware to accelerate the X11 windowing system itself, rather I am trying to get accelerated 3D to work in a window. I am using Open GL ES 2.0 (although using ES 1.1 seems to have the same issue).

The samples come with two makefiles, one for X11 and one for frame buffer device. I have built one of the samples (Samples/GLES2.0/06_Texturing) for frame buffer device, and performance is terrific (over 500 fps full screen 1024x768). If I build the same sample for X11, it does work and it does render in a window, but the performance is very poor (about 15 fps in a large window which is almost full screen 1024x768). The X11 sample also uses considerable CPU so I am pretty sure it is using software rendering / rasterisation.

So my question is this - how can I get decent frame rates using hardware acceleration for an OpenGL application running in an X11 window?

Obviously I have to change over the symbolic links from libGAL-fb.so and libEGL-fb.so to libGAL-x11.so and libEGL-x11.so

The sample won't even build properly if I don't do that, so it must be something else that I'm not doing (or doing wrong).

Some background info which may be useful:

  • i.MX6Q (rev 1.2 silicon)
  • Linux kernel 3.0.35 from the 12.09.01 BSP
  • Ubuntu 11.10 rootfs (armel)
  • GPU SDK v1.00
  • gpu-viv-bin-mx6q-12.09.01 (untarred on top of the rootfs)

Have any of you got this working? I'd be most grateful for any comments / suggestions.

------------------------------------------------

I've just worked out that this is addressed in the new Linux BSP release L3.0.35 1.1.0 - see https://community.freescale.com/message/312735#312735

Message was edited by: davecbluechip

1 Solution
4,005 Views
OtavioSalvador
Senior Contributor II

Not offhand. You may need to check how we do in Yocto and try a build image to confirm if it is an issue you can fix  at your side.

View solution in original post

0 Kudos
21 Replies
3,950 Views
sudiptasubudhi
Contributor III

Hi Davebluechip,

I am using

as my root fs (LXDE) on IMX6q processor. I am trying to run the gpu_sdk samples by freescale using X11. I have compiled them but when i try to run they are exiting with nothing being displayed on the screen.

root@nitrogen:/sdk/Samples/GLES1.1/bin/GLES11_x11# ./01_SimpleTriangle

root@nitrogen:/sdk/Samples/GLES1.1/bin/GLES11_x11# ./11_LightingFog

root@nitrogen:/sdk/Samples/GLES1.1/bin/GLES11_x11# ./17_Beizer


Could you please help me.

Thanks in advance.

Regards,

Sudlin

0 Kudos
3,946 Views
sudiptasubudhi
Contributor III

Update:

Earlier i was logging in as "root", but when i tried logging in as "ubuntu", i found the samples running but i get a blank screen with a flickering mouse pointer over it and no image drawn on it.

Could anyone help me with this?

Regards,

Sudlin

0 Kudos
3,953 Views
davecbluechip
Contributor III

Just a quick update. I have got this working now :smileyhappy:

Originally I used the Yocto code on a SabreSD with the dylan branch a few months ago, but had to do a fair amount of messing about to make it happen. I could only get this working with kernel 3.5.7 at that time.

I have now used the dora branch and it is much simpler. The fsl-image-gui target gives kernel 3.0.35 (Freescale issue 4.1.0) and includes suitable vivante binary libraries. The OpenGL Qt demos don't run (or aren't built) but code from the Freescale GPU SDK compiles and runs OK. (I had to use the x11 makefile and change the compiler options to use “-mfloat-abi=hard”rather than “-mfloat-abi=softfp”).

The fsl-image-gui doesn't contain some of the necessary include files, but they are in the Yocto work area and can be copied across.

I have ported the kernel to my custom hardware, and it works on that too, although performance is not quite as good as the SabreSD (probably something to do with my port, I guess).

Thanks for all the help and suggestions.

3,954 Views
PrabhuSundarara
NXP Employee
NXP Employee

Can you pleas use driver from xf86-video-imxfb-vivante 1.1.0 BSP and stills see the same problem.

0 Kudos
3,957 Views
mtx512
Contributor V

With 1.1.0 BSP fails to load vivante_drv.so as below:

[     7.931] (II) Module record: vendor="X.Org Foundation"

[     7.932]    compiled for 1.11.3, module version = 1.13.0

[     7.932]    Module class: X.Org Server Extension

[     7.932]    ABI class: X.Org Server Extension, version 6.0

[     7.932] (II) Loading extension RECORD

[     7.932] (II) LoadModule: "dri"

[     7.933] (II) Loading /usr/lib/xorg/modules/extensions/libdri.so

[     7.937] (II) Module dri: vendor="X.Org Foundation"

[     7.937]    compiled for 1.11.3, module version = 1.0.0

[     7.938]    ABI class: X.Org Server Extension, version 6.0

[     7.938] (II) Loading extension XFree86-DRI

[     7.938] (II) LoadModule: "dri2"

[     7.939] (II) Loading /usr/lib/xorg/modules/extensions/libdri2.so

[     7.941] (II) Module dri2: vendor="X.Org Foundation"

[     8.024]    ABI class: X.Org Video Driver, version 10.0

[     8.025] (EE) module ABI major version (10) doesn't match the server's version (11)

[     8.025] (II) UnloadModule: "vivante"

[     8.025] (II) Unloading vivante

[     8.025] (EE) Failed to load module "vivante" (module requirement mismatch, 0)

[     8.026] (==) Matched fbdev as autoconfigured driver 0

0 Kudos
3,957 Views
OtavioSalvador
Senior Contributor II

You need to build the DRI module for the X11 as well; I did it for 1.11.4 (which I will post for Yocto in few days) and it works fine.

0 Kudos
3,957 Views
mtx512
Contributor V

By "DRI module for X11" do you mean vivante_drv.so from xf86-video-imxfb-vivante-2_12.09.01-r17.3. Initially I tried with that dri module, the problem is that es2gears or our test egl program causes Xorg to hang with a 100% cpu when using "-x11" libraries.



0 Kudos
3,957 Views
OtavioSalvador
Senior Contributor II

I've been working with 1.1.0 code but no; I mean the code inside DRI dir of it.

0 Kudos
3,956 Views
varsmolta
Contributor V

so it this in yocto now? What image/recipe do I need to build to buil the "dri module for X11". Once built, do I just move this over to the ubuntu rootfs? Thanks

0 Kudos
3,957 Views
OtavioSalvador
Senior Contributor II

I don't play with Ubuntu with i.MX processors so I didn't test if using Yocto built binaries would or not work for it.

Yocto works fine and it is all integrated (except the patches I sent to mailing list today which affects it as well) and on next Tuesday all should have been merged.

0 Kudos
3,957 Views
borabora
Contributor I

I was able to build 1.1.0 DRI with X 1.10.4 and 1.11.4 for imx6 but glxgears in window mode show a blank window.  Fullscreen mode worked.  Do you have this problem?  Do you have any suggestion how to fix it?  Thanks.

0 Kudos
4,006 Views
OtavioSalvador
Senior Contributor II

Not offhand. You may need to check how we do in Yocto and try a build image to confirm if it is an issue you can fix  at your side.

0 Kudos
3,956 Views
PrabhuSundarara
NXP Employee
NXP Employee

EGL need to be accelerated. The 12.09 BSP release does have X11 accelerated. GPU renders to the drawable which in turn copied to X using CPU, so you see high CPU usage.

With the L3.0.35.1.1.0 release(download from BSP), the EGL uses DRI and it is accelerated. Please try with Ubuntu Rootfs from L3.0.35 1.1.0 and keep posted.

0 Kudos
3,956 Views
mtx512
Contributor V

We tried the "-x11" libraries as well as and there is no X11 acceleration occurring.

Can Freescale provide an update regarding X11 support as there appears to be no working binaries with acceleration. We can't continue developments for our customer without some guidance and there seems to be little/no feedback from Freescale on the subject. If X11 acceleration is available please provide instructions on how to configure it.

Thanks!

0 Kudos
3,955 Views
davecbluechip
Contributor III

Still having difficulty here. I've tried the new L3.0.35 1.1.0 BSP but something's still not right. Here's a few things that might be helpful to know:

Libraries in Ubuntu Oneiric rootfs (in 1.1.0 BSP) are NOT the same as the libraries built using the 1.1.0 LTIB. LTIB builds 3 copies of libEGL, libGAL and libVIVANTE for:

  • frame buffer device API with suffix "-fb"
  • X11 windowing API with suffix "-x11"
  • DirectFB API with suffix "-dfb".

There is only one copy of each library in the supplied rootfs, and it is different from all of the copies built by LTIB.

I updated my rootfs by building the "gpu-viv-bin-mx6q" package in LTIB, and copying the resulting files on top of the supplied oneiric rootfs.

First, I added a bit of code to the sample to report frame rates. Very simple stuff.

When I build the GPU SDK samples using the "fbdev" makefile and set symbolic links to use the "-fb" versions of the libraries, this works fine and I get a full-screen sample running at blistering frame rates :smileyhappy:

When I build the same sample using the "x11" makefile and set symbolic links to use the "-x11" versions of the libraries, I get a blank, white window that flickers a bit when I mouse over it. The reported frame rate is fantastic, but it isn't actually drawing anything!!

All comments / suggestions gratefully received!

0 Kudos
3,956 Views
PaulDeMetrotion
Senior Contributor I

I am having issues with the oneiric FS video as well. Using a proprietary device which uses the i.MX6Q. Where do I find the package gpu-viv-bin-mx6q? I do not see it anywhere in the LTIB configuration menus. Which files in the FS did you replace?


0 Kudos
3,956 Views
davecbluechip
Contributor III

Hi Paul,

What I did (which may or may not be correct) was:

"ltib -m listpkgs" to get a list of all the packages - this is handy if you need the names of other packages

"ltib -m prep -p gpu-viv-bin-mx6q" to prepare the package

"ltib -m scbuild -p gpu-viv-bin-mx6q" to build the package

and so on.

Hope that helps,

0 Kudos
3,955 Views
PrabhuSundarara
NXP Employee
NXP Employee

- The oneiric rootfs will have only the x11 binaries and other the binaries(-fb, -dfb) are not present.

- The GPU binaries in the Ubuntu Oneiric rootfs are stripped version, so it appears to be different sizes. Actually the binaries are same. You can checn by stripping the binaries -x11 from "gpu-viv-bin-mx6q" package in LTIB.

-When you see white screen, then the DRI and GLX is not setup correctly. Please make sure the following present in the  /var/log/Xorg.0./log.

[1623101.082] (II) [drm] DRM interface version 1.4

[1623101.082] (II) [drm] DRM open master succeeded.

[1623101.082] (II) VIVANTE(0): [drm] Using the DRM lock SAREA also for drawables.

[1623101.082] (II) VIVANTE(0): [drm] framebuffer handle = 0x18800000

[1623101.082] (II) VIVANTE(0): [drm] added 1 reserved context for kernel

[1623101.082] (II) VIVANTE(0): X context handle = 0x1

[1623101.082] (II) VIVANTE(0): [drm] installed DRM signal handler

[1623101.082] (II) VIVANTE(0): [DRI] installation complete

If you could not find, then use the Oneiric rootfs + uImage from the release. If you are trying to build Linux kernel from source, ensure you building and installing the kernel modules to rootfs. Because to DRI requires DRM and Vivante kernel modules. Also you can make sure the modules are loaded by lsmod, it should list DRM and Vvante.


0 Kudos
3,956 Views
PrabhuSundarara
NXP Employee
NXP Employee

The oneiric rootfs has the Xorg 1.10.4 version which is supported in the release. For the newer Xorg version, for example Xorg 1.13.x, the DRI is built-in. So need to merge the DRI from the BSP to the Xorg DRI manually. The receipes will be available in Yocto master in few days.

0 Kudos
3,956 Views
mtx512
Contributor V

I built the xorg dri driver (xf86-video-imxfb-vivante-2_12.09.01-r17.3) from yocto and tested against  Xorg 1.11.3. es2_info reports that the vivante driver is working. However es2gears or our test egl program causes Xorg to hang with a 100% cpu. I'm using the vivante binaries (libEGL-x11.so) from 1.1.0.

Can I use the 1.1.0 binaries?

Any suggestions on how I can find the cause of Xorg hang?

0 Kudos