RichardRussell
Posts: 177
Joined: Thu Jun 21, 2012 10:48 am

Mesa driver much slower on Stretch than on Jessie

Sat Aug 26, 2017 4:32 pm

Running 'glxgears -info' on Raspbian Jessie is reporting around 180 frames-per-second rendering speed but the same on Stretch is reporting only about 45 FPS, or a quarter of the speed! This is on the same hardware (a Raspberry Pi 3 with HDMI output), in both cases with the 'experimental' VC4 GL Driver disabled.

Another oddity is that when running on Jessie the gears are blue, red and green but on Stretch they're white, yellow and cyan! I suppose this could be a deliberate change but it seems suspicious. The Mesa versions are reporting as 13.0.0 and 13.0.6 respectively.

Can anybody suggest what's going on here? When it's possible to enable the 'experimental' GL Driver there's no noticeable difference in performance, but when it's disabled Stretch can be unusably slow when Jessie was acceptable.

Richard.

User avatar
rpiMike
Posts: 488
Joined: Fri Aug 10, 2012 12:38 pm
Location: Cumbria, UK

Re: Mesa driver much slower on Stretch than on Jessie

Sat Aug 26, 2017 4:53 pm

Something is not right - should be very close to 60fps !

https://youtu.be/yTRYomiQMAY?t=3m29s

Are you using a 1080p screen and a good quality power 5.1V 2.5Amp power supply with large core cable ?

Edit : re-read your post - the OpenGL driver must be enabled to run this OpenGL glxgears demo correctly.

RichardRussell
Posts: 177
Joined: Thu Jun 21, 2012 10:48 am

Re: Mesa driver much slower on Stretch than on Jessie

Sat Aug 26, 2017 5:32 pm

rpiMike wrote:
Sat Aug 26, 2017 4:53 pm
Are you using a 1080p screen and a good quality power 5.1V 2.5Amp power supply with large core cable ?
Yes it's a full-HD screen and a genuine RPi power supply (I don't get any on-screen indications of low voltage). Anyway it's the identical hardware in both cases (just switching the SD card).
the OpenGL driver must be enabled to run this OpenGL glxgears demo correctly.
Why? The whole point of the Mesa software driver is that it emulates OpenGL even when the VC4 driver is not enabled. It's pre-installed on Stretch but on Jessie you can install it using:

Code: Select all

sudo apt-get install mesa-utils
Have you any explanation for the dramatically worse performance of the software renderer on Stretch compared with Jessie?

Richard.

runboy93
Posts: 337
Joined: Tue Feb 28, 2017 1:17 pm
Location: Finland
Contact: Website

Re: Mesa driver much slower on Stretch than on Jessie

Sat Aug 26, 2017 7:52 pm

exact glxinfo output?

I heard somewhere long ago about that glxgears color problem, could be hardware failure if I remember right. Was not on RPi, but so similar to this problem, reduced scores and different colors on gears.

There would be more reports if this was wide problem.

You can also report to anholt or to RPi github (include details much as possible)
https://anholt.github.io/twivc4/

RichardRussell
Posts: 177
Joined: Thu Jun 21, 2012 10:48 am

Re: Mesa driver much slower on Stretch than on Jessie

Sat Aug 26, 2017 8:15 pm

runboy93 wrote:
Sat Aug 26, 2017 7:52 pm
exact glxinfo output?
Trimmed for brevity, let me know if you want more:

Jessie:

Code: Select all

name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
GLX version: 1.4
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.9, 128 bits)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 13.0.0
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL version string: 3.0 Mesa 13.0.0
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 13.0.0
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00

Stretch:

Code: Select all

name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
GLX version: 1.4
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: VMware, Inc. (0xffffffff)
    Device: llvmpipe (LLVM 3.9, 128 bits) (0xffffffff)
    Version: 13.0.6
    Accelerated: no
    Video memory: 927MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 3.3
    Max compat profile version: 3.0
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.0
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.9, 128 bits)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 13.0.6
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL version string: 3.0 Mesa 13.0.6
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 13.0.6
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
I heard somewhere long ago about that glxgears color problem, could be hardware failure if I remember right.
This is the same hardware in both cases, though!
You can also report to anholt or to RPi github (include much as possible details)
To reiterate I'm not using Eric's VC4 driver (it's the Mesa software renderer that's exhibiting the difference).

Richard.

runboy93
Posts: 337
Joined: Tue Feb 28, 2017 1:17 pm
Location: Finland
Contact: Website

Re: Mesa driver much slower on Stretch than on Jessie

Sat Aug 26, 2017 9:16 pm

"Accelerated: no", hmm. I need think this for while. And why your vRAM so big, 128/256 should be enough for everything.

What 1080p monitor you are using?

could you show "glxgears -info" output too?

Kodi problems with Stretch update:
https://raspberrypi.stackexchange.com/q ... etch/69170

Code: Select all

OpenGL vendor string: VMware, Inc.
OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.9, 128 bits)
Aren't these software renderer and not hardware ones? I see same lines on your glxinfo.

Is your overall usage slow for example? Is there processes called "llvmpipe" on your processes?

Why don't you use VC4 with Mesa 13.0.6, ftw.

RichardRussell
Posts: 177
Joined: Thu Jun 21, 2012 10:48 am

Re: Mesa driver much slower on Stretch than on Jessie

Sat Aug 26, 2017 10:29 pm

runboy93 wrote:
Sat Aug 26, 2017 9:16 pm
And why your vRAM so big, 128/256 should be enough for everything.
I've not changed anything. This is a clean Stretch image, updated today. Everything should be as it is 'out of the box'.
What 1080p monitor you are using?
It's a Panasonic TV. Why is that relevant? It's the same for both Jessie and Stretch!
could you show "glxgears -info" output too?
It's just the FPS figures I gave earlier (about 180 FPS for Jessie, 45 for Stretch).
Aren't these software renderer and not hardware ones? I see same lines on your glxinfo.
I presume so. That's right for the Mesa software driver, isn't it?
Why don't you use VC4 with Mesa 13.0.6, ftw.
I do, usually! But that's not the point: I am a software vendor and not all my customers are able to use it (as you probably know it has issues such as not supporting overscan compensation and broken HDMI sound on Jessie). It's constantly being emphasised here that the GL Driver is 'experimental' and should be used at your own risk, so naturally I want my customers to have the option of not using it. On Jessie they can disable the GL Driver and still use my app, on Stretch they can't because it's unusably slow.

Richard.

runboy93
Posts: 337
Joined: Tue Feb 28, 2017 1:17 pm
Location: Finland
Contact: Website

Re: Mesa driver much slower on Stretch than on Jessie

Sat Aug 26, 2017 10:31 pm

Ah this kind problem, sorry I'm just normal user and don't have customers with different needs. :(

feelslikeautumn
Posts: 250
Joined: Wed Aug 09, 2017 9:51 pm

Re: Mesa driver much slower on Stretch than on Jessie

Sat Aug 26, 2017 10:44 pm

ssues such as not supporting overscan compensation
Why do I keep seeing this on here? It is simply not true!

On lubuntu arm 64 with Gallium 0.4 on llvmpipe I get around 170FPS

runboy93
Posts: 337
Joined: Tue Feb 28, 2017 1:17 pm
Location: Finland
Contact: Website

Re: Mesa driver much slower on Stretch than on Jessie

Sat Aug 26, 2017 11:57 pm

feelslikeautumn wrote:
Sat Aug 26, 2017 10:44 pm
ssues such as not supporting overscan compensation
Why do I keep seeing this on here? It is simply not true!

On lubuntu arm 64 with Gallium 0.4 on llvmpipe I get around 170FPS
Yeah? and topic is about Raspbian.

RichardRussell
Posts: 177
Joined: Thu Jun 21, 2012 10:48 am

Re: Mesa driver much slower on Stretch than on Jessie

Sun Aug 27, 2017 12:07 am

feelslikeautumn wrote:
Sat Aug 26, 2017 10:44 pm
Why do I keep seeing this on here? It is simply not true!
I don't know whether that particular claim is true or not, since I can disable overscan on my monitor anyway. But if the VC4 driver was problem free it would not be described as 'experimental' and it would not be disabled by default! Hopefully one day that will change, but for the time being I would like to support users of my software who are unable to, or choose not to, enable that driver.

Richard.

feelslikeautumn
Posts: 250
Joined: Wed Aug 09, 2017 9:51 pm

Re: Mesa driver much slower on Stretch than on Jessie

Sun Aug 27, 2017 7:18 am

Yeah? and topic is about Raspbian.
Jeez, this is a picky forum. I dont use raspian so I cant give a value on that.

Usually a reason for a low number is it is trying to sync to vblanc?

Has the xorg colour depth changed? That can have a big impact.

Are you now using a compositor?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20459
Joined: Sat Jul 30, 2011 7:41 pm

Re: Mesa driver much slower on Stretch than on Jessie

Sun Aug 27, 2017 7:40 am

feelslikeautumn wrote:
Sat Aug 26, 2017 10:44 pm
ssues such as not supporting overscan compensation
Why do I keep seeing this on here? It is simply not true!

On lubuntu arm 64 with Gallium 0.4 on llvmpipe I get around 170FPS
Is is true for the vc4 driver on the Pi. Which was what was being discussed. Sorry to be so picky.... I just like things to be correctly stated.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

feelslikeautumn
Posts: 250
Joined: Wed Aug 09, 2017 9:51 pm

Re: Mesa driver much slower on Stretch than on Jessie

Sun Aug 27, 2017 7:50 am

On vc4 you correct monitor problems with the video= kernel command line parameter. It works like other KMS (and framebuffer) drivers.

RichardRussell
Posts: 177
Joined: Thu Jun 21, 2012 10:48 am

Re: Mesa driver much slower on Stretch than on Jessie

Sun Aug 27, 2017 9:27 am

feelslikeautumn wrote:
Sun Aug 27, 2017 7:18 am
Usually a reason for a low number is it is trying to sync to vblanc?
The Mesa software driver apparently doesn't sync to vblank (if it did, reported FPS values greater than the monitor's frame rate would be impossible). I see 180 FPS on Jessie so clearly there's no vsync in that case.
Has the xorg colour depth changed? That can have a big impact.
Well, I've not changed anything! As I said, this is happening with a clean installation. If something has changed it's an out-of-the-box setting in Raspbian Stretch. How can I find out what the current setting is?
Are you now using a compositor?
Same answer! Obviously I've not deliberately set anything different between Jessie and Stretch otherwise I wouldn't be asking the question. ;)

If the general feeling is that the cause is something specific to my setup I'll once again start from scratch with the latest Stretch image.

Richard.

RichardRussell
Posts: 177
Joined: Thu Jun 21, 2012 10:48 am

Re: Mesa driver much slower on Stretch than on Jessie

Sun Aug 27, 2017 10:24 am

RichardRussell wrote:
Sun Aug 27, 2017 9:27 am
I'll once again start from scratch with the latest Stretch image.
OK, I've downloaded a virgin Stretch image from raspberrypi.org/downloads, programmed it into a micro-SD (using Win32DiskImager if it matters) and booted my Raspberry Pi 3 with it. Without any configuration or settings changes, not even setting up the networking or timezone, I opened a terminal window and entered glxgears -info. Again, the gears are the wrong colours and I get only 45 frames-per-second!

This seems to rule out any 'local' cause except the hardware itself, but the identical hardware running Jessie works correctly (180 fps and proper colours). Can somebody please repeat the test and report what they are getting?

Richard.

feelslikeautumn
Posts: 250
Joined: Wed Aug 09, 2017 9:51 pm

Re: Mesa driver much slower on Stretch than on Jessie

Sun Aug 27, 2017 10:29 am

I thought there was some talk of using Compton in raspbian? The xorg log should give the colour depth (can be found in /var/log).

RichardRussell
Posts: 177
Joined: Thu Jun 21, 2012 10:48 am

Re: Mesa driver much slower on Stretch than on Jessie

Sun Aug 27, 2017 11:06 am

feelslikeautumn wrote:
Sun Aug 27, 2017 10:29 am
The xorg log should give the colour depth (can be found in /var/log).

Code: Select all

[     8.457] (==) Depth 24 pixmap format is 32 bpp
 
There's only one 'error' in the log:

Code: Select all

[     8.527] (II) AIGLX: Screen 0 is not DRI2 capable
[     8.527] (EE) AIGLX: reverting to software rendering
Richard.

d_older
Posts: 102
Joined: Mon Jun 25, 2012 5:04 pm
Location: East Yorkshire, UK

Re: Mesa driver much slower on Stretch than on Jessie

Sun Aug 27, 2017 9:45 pm

Just a thought - somewhere along the line with wheezy - jessie - stretch the [x|X]org system changed from being run as root to run as user. On my x86 8.9 box it is still running as root but my jessie pi is running as pi- so I'm not sure where the change came in. Is it running as your user in both cases - if not could this be some kind of privilege issue ? Also the log location has changed to .local/share/xorg/Xorg.0.log with running as user.

Just my 2 penn'eth worth

Dave

RichardRussell
Posts: 177
Joined: Thu Jun 21, 2012 10:48 am

Re: Mesa driver much slower on Stretch than on Jessie

Sun Aug 27, 2017 10:26 pm

d_older wrote:
Sun Aug 27, 2017 9:45 pm
Is it running as your user in both cases?
I haven't checked Jessie but on Stretch Xorg is running as root. However, doing sudo glxgears makes no difference to the symptom.

I've now had this issue confirmed by two other users, one of them reporting it happening on both a RPi 2 and a RPi 3. So it's clearly not something unique to my hardware, and all the indications are that it's a problem with Stretch. It's trivial to reproduce: boot from a clean Stretch image and enter glxgears -info at a terminal prompt.

I'm pleased to have an explanation for my app running so slowly (without the GL Driver enabled) but keen to have a fix that I can pass onto my customers as soon as possible.

Richard.

RichardRussell
Posts: 177
Joined: Thu Jun 21, 2012 10:48 am

Re: Mesa driver much slower on Stretch than on Jessie

Mon Aug 28, 2017 8:55 am

Additional information from the SDL forum: setting GALLIUM_DRIVER=softpipe fixes the glxgears colours but makes it run even more slowly, about 27 fps compared with 45 fps in clean Stretch and 180 fps in Jessie. The speed is the issue for me (my own programs render with the correct colours anyway) so this is moving in the wrong direction!

It must be possible to fix Stretch to restore something close to the Jessie performance, but there's been no recognition from 'the powers that be' that they even acknowledge this is a genuine fault. :cry:

Richard.

User avatar
topguy
Posts: 4850
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Mesa driver much slower on Stretch than on Jessie

Mon Aug 28, 2017 9:16 am

RichardRussell wrote:
Mon Aug 28, 2017 8:55 am
It must be possible to fix Stretch to restore something close to the Jessie performance, but there's been no recognition from 'the powers that be' that they even acknowledge this is a genuine fault. :cry:
You started this thread on a Saturday you know.. only now on a Monday can you actually start expecting "recognition".

Questions:
- Is the difference in speed visible ?
- what is the CPU load for glxgears on both ?

I've never really trusted the output from glxgears anyway. This example from my new work laptop.

Code: Select all

[email protected]:~/dev# glxgears 
Running synchronized to the vertical refresh.  The framerate should be
approximately the same as the monitor refresh rate.
42506 frames in 5.0 seconds = 8500.729 FPS
44121 frames in 5.0 seconds = 8824.077 FPS
42808 frames in 5.0 seconds = 8560.150 FPS

RichardRussell
Posts: 177
Joined: Thu Jun 21, 2012 10:48 am

Re: Mesa driver much slower on Stretch than on Jessie

Mon Aug 28, 2017 9:55 am

topguy wrote:
Mon Aug 28, 2017 9:16 am
You started this thread on a Saturday you know.. only now on a Monday can you actually start expecting "recognition".
Hmm, a "Raspberry Pi engineer and forum moderator" did post early on in the thread. :roll:
Is the difference in speed visible ?
Hard to say whether it's "visible" with glxgears (45 fps is close to being fast enough for smooth motion rendition) but it dramatically slows down my application (BBC BASIC) making it unusable without the VC4 driver.
what is the CPU load for glxgears on both ?
Jessie: ~180 fps, CPU load ~50% (CPU meter in task bar) ~180% ('top' command), colours correct.
Stretch: ~45 fps, CPU load ~70% (CPU meter) ~260% ('top'), colours incorrect.
Running synchronized to the vertical refresh. The framerate should be
approximately the same as the monitor refresh rate.
As noted earlier in the thread, the Mesa software renderer doesn't sync to the monitor refresh. If I enable the VC4 GL Driver then, yes, glxgears shows consistently 50 fps on both Jessie and Stretch.

As the performance of the Mesa software driver is evidently critically dependent on LLVM, and the docs for that emphasise how important it is to have SSE2 support when compiled for x86, I'm wondering if ARM Neon support has somehow been disabled in the Stretch build. Let's hope it's not a regression in the C compiler.

Richard.

RichardRussell
Posts: 177
Joined: Thu Jun 21, 2012 10:48 am

Re: Mesa driver much slower on Stretch than on Jessie

Tue Aug 29, 2017 11:58 am

RichardRussell wrote:
Mon Aug 28, 2017 9:55 am
Jessie: ~180 fps, CPU load ~50% (CPU meter in task bar) ~180% ('top' command), colours correct.
Stretch: ~45 fps, CPU load ~70% (CPU meter) ~260% ('top'), colours incorrect.
So is nobody 'in authority' even going to acknowledge that this is a problem? Am I (and my customers) supposed to accept Stretch being four times slower than Jessie? :?

Richard.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20459
Joined: Sat Jul 30, 2011 7:41 pm

Re: Mesa driver much slower on Stretch than on Jessie

Tue Aug 29, 2017 12:50 pm

Stop being so impatient.

There has been a long weekend in the UK, Monday was a bank holiday so no one in the office, not only that but its holiday season and half the office are on holiday anyway. Honestly, I cannot believe the number of people over this weekend complaining about a lack of response. People need to chill the hell out.

I answered originally IN MY SPARE TIME. Not that I have a lot of spare time, but managed to squeeze it in.

If you want official, then you need to add a github issues reporting the problem, please include your setup, and specifically the problem you are seeing. Just posting on the forum does not guarantee that it will be seen by the right people. I am not 'the right people', and none of the 'right people' appear to be in the office this week, so rapid response seems unlikely.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

Return to “Raspbian”

Who is online

Users browsing this forum: develop-cr and 17 guests