Bug 19492 - (Regression) Software rasterizing instead of hardware in Ubuntu Jaunty
Summary: (Regression) Software rasterizing instead of hardware in Ubuntu Jaunty
Status: RESOLVED FIXED
Alias: None
Product: hal
Classification: Unclassified
Component: misc (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: medium major
Assignee: Martin Pitt
QA Contact: Xorg Project Team
URL: https://bugs.launchpad.net/ubuntu/+so...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-10 00:32 UTC by Bryce Harrington
Modified: 2009-01-19 03:12 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Xorg.log.primary (56.41 KB, text/plain)
2009-01-10 00:33 UTC, Bryce Harrington
Details
glxinfo (7.54 KB, text/plain)
2009-01-10 00:34 UTC, Bryce Harrington
Details
output from LIBGL_DEBUG=verbose glxinfo (9.49 KB, text/plain)
2009-01-18 01:36 UTC, Martin Pitt
Details
output from sudo LIBGL_DEBUG=verbose glxinfo (7.49 KB, text/plain)
2009-01-18 01:36 UTC, Martin Pitt
Details

Description Bryce Harrington 2009-01-10 00:32:53 UTC
Forwarding this bug from a Ubuntu reporter:
https://bugs.edge.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/269509

[Problem]
In Intrepid (xserver 1.5.x/-intel 2.4.x/mesa 7.2) this hardware was listed in glxinfo as hardware accelerated, whereas in Jaunty (xserver 1.5.99.3/-intel 2.5.1/mesa 7.2+git20081209) it is software rasterized.

[lspci]
00:00.0 Host bridge [0600]: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express Memory Controller Hub [8086:27a0] (rev 03)
	Subsystem: Dell Device [1028:0201]
00:02.0 VGA compatible controller [0300]: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller [8086:27a2] (rev 03)
	Subsystem: Dell Device [1028:0201]

[Original Report]
m on jaunty du jour (2.6.28-3-generic, -intel 2:2.5.1-1ubuntu7), and it got even worse.

Both the primary and secondary X session's glxinfo still say

  direct rendering: Yes

but now even the primary session says

  OpenGL renderer string: Software Rasterizer

I'm not actually sure whether that's true. glxinfo reports 65 FPS in default window size, which seems faster than software rendering, and compiz works fine, so I think glxinfo lies.
Comment 1 Bryce Harrington 2009-01-10 00:33:30 UTC
Created attachment 21850 [details]
Xorg.log.primary
Comment 2 Bryce Harrington 2009-01-10 00:34:03 UTC
Created attachment 21851 [details]
glxinfo
Comment 3 Julien Cristau 2009-01-10 20:11:59 UTC
what's the output from glxinfo with LIBGL_DEBUG=verbose?
Comment 4 haihao 2009-01-11 22:33:06 UTC
Can you reproduce this issue with single X session?
Comment 5 Bryce Harrington 2009-01-12 22:59:12 UTC
> Can you reproduce this issue with single X session?

Yes
Comment 6 haihao 2009-01-12 23:31:26 UTC
Please attach the output of glxinfo with LIBGL_DEBUG=verbose
Comment 7 Stefano Avallone 2009-01-15 07:32:05 UTC
I'm not sure if it is the same issue. I'm on a 965GM and am using master git of libdrm, mesa, xserver, intel DDX etc. and kernel from anholt's drm-intel-next. The output of glxinfo as a user is:

name of display: :0.0                                            
libGL: OpenDriver: trying /opt/gfx-test/lib/dri/i965_dri.so      
libGL error: failed to open drm device: Permission denied        
libGL: OpenDriver: trying /opt/gfx-test/lib/dri/swrast_dri.so    
display: :0  screen: 0                                           
direct rendering: Yes                                            
[...]
OpenGL vendor string: Mesa Project                                            
OpenGL renderer string: Software Rasterizer                                   
OpenGL version string: 2.1 Mesa 7.3-devel                                     
OpenGL shading language version string: 1.10                                  
[...]

The output of sudo glxinfo is:

name of display: :0.0                                                 
display: :0  screen: 0                                                
direct rendering: Yes                                                 
[...]
OpenGL vendor string: Tungsten Graphics, Inc                                  
OpenGL renderer string: Mesa DRI Intel(R) 965GM GEM 20080716 x86/MMX/SSE2     
OpenGL version string: 2.1 Mesa 7.3-rc1                                       
OpenGL shading language version string: 1.10                                  


Also, I get different numbers from glxgears. As a normal user:
467 frames in 5.0 seconds = 93.159 FPS
523 frames in 5.0 seconds = 104.338 FPS
348 frames in 5.0 seconds = 69.587 FPS
309 frames in 5.0 seconds = 61.624 FPS
394 frames in 5.0 seconds = 78.383 FPS
473 frames in 5.0 seconds = 94.469 FPS
541 frames in 5.0 seconds = 107.984 FPS

As root:
877 frames in 5.0 seconds = 175.348 FPS
1179 frames in 5.0 seconds = 235.773 FPS
1055 frames in 5.0 seconds = 210.246 FPS
1079 frames in 5.0 seconds = 215.772 FPS
979 frames in 5.0 seconds = 195.778 FPS
1012 frames in 5.0 seconds = 202.396 FPS
988 frames in 5.0 seconds = 197.069 FPS

Are you also experiencing such different behavior? Or am I doing something wrong?

Comment 8 Stefano Avallone 2009-01-15 07:51:44 UTC
Well, to be precise, running 

sudo LIBGL_DEBUG=verbose glxinfo gives:
name of display: :0.0                                                                    
libGL: OpenDriver: trying /usr/lib/dri/tls/i965_dri.so                                   
libGL: OpenDriver: trying /usr/lib/dri/i965_dri.so                                       
libGL error:                                                                             
Can't open configuration file /etc/drirc: No such file or directory.                     
libGL error:                                                                             
Can't open configuration file /home/stefano/.drirc: No such file or directory.           
display: :0  screen: 0                                                                   
direct rendering: Yes                                                                    
[...]
OpenGL vendor string: Tungsten Graphics, Inc                                             
OpenGL renderer string: Mesa DRI Intel(R) 965GM GEM 20080716 x86/MMX/SSE2                
OpenGL version string: 2.1 Mesa 7.3-rc1                                                  

It is strange, because LD_LIBRARY_PATH is set to /opt/gfx-test/lib while it is trying to open /usr/lib/dri/i965_dri.so which belongs to the debian experimental package I have installed (indeed the mesa version is 7.3-rc1 and not 7.3-devel)

When not using sudo, the behavior is that reported in the previous comment, i.e., it fallbacks to software rasterizer.


Comment 9 Julien Cristau 2009-01-16 00:27:49 UTC
> --- Comment #8 from Stefano Avallone <stavallo@unina.it>  2009-01-15 07:51:44 PST ---
> It is strange, because LD_LIBRARY_PATH is set to /opt/gfx-test/lib while it is
> trying to open /usr/lib/dri/i965_dri.so which belongs to the debian
> experimental package I have installed (indeed the mesa version is 7.3-rc1 and
> not 7.3-devel)

sudo is a setuid app; LD_LIBRARY_PATH gets ignored.

> When not using sudo, the behavior is that reported in the previous comment,
> i.e., it fallbacks to software rasterizer.
> 
you need to make sure you have appropriate permissions on the device node;
look at the udev rules for SUBSYSTEM=="drm" or something similar.
Comment 10 Stefano Avallone 2009-01-16 01:05:24 UTC
Many thanks, Julien. I needed to belong to the video group. Now glxinfo correctly shows that the intel 3D driver is used and I learnt a new thing :-)

Maybe this also solves the problem of the original reporter, as
1) Like him, I was used to glxinfo reporting hardware acceleration. Only recently I started seeing software rasterizer (maybe something changed in the udev rules?)
2) 3D performance was fine, as Xorg was correctly opening the i965_dri library (reported by /proc/`pidof Xorg`/maps)


Comment 11 Martin Pitt 2009-01-18 01:35:16 UTC
Thanks for the hint. If I run glxinfo as root (through sudo), I get

  OpenGL renderer string: Mesa DRI Intel(R) 945GM GEM 20080716 x86/MMX/SSE2

and if I run it as user, I get

  OpenGL renderer string: Software Rasterizer

The reason is certainly

  drmOpenDevice: node name is /dev/dri/card0
  drmOpenDevice: open result is -1, (Permission denied)

crw-rw---- 1 root root 226, 0 2009-01-18 08:54 /dev/dri/card0

Does this device need to be accessible for users in order to use DRI? It looks as if only the X server itself should be able to access it?

For the record I'll attach both glxinfos again.

Comment 12 Martin Pitt 2009-01-18 01:36:09 UTC
Created attachment 22079 [details]
output from LIBGL_DEBUG=verbose glxinfo
Comment 13 Martin Pitt 2009-01-18 01:36:26 UTC
Created attachment 22080 [details]
output from sudo LIBGL_DEBUG=verbose glxinfo
Comment 14 Julien Cristau 2009-01-18 03:12:45 UTC
> --- Comment #11 from Martin Pitt <martin.pitt@ubuntu.com>  2009-01-18 01:35:16 PST ---
> Thanks for the hint. If I run glxinfo as root (through sudo), I get
> 
>   OpenGL renderer string: Mesa DRI Intel(R) 945GM GEM 20080716 x86/MMX/SSE2
> 
> and if I run it as user, I get
> 
>   OpenGL renderer string: Software Rasterizer
> 
> The reason is certainly
> 
>   drmOpenDevice: node name is /dev/dri/card0
>   drmOpenDevice: open result is -1, (Permission denied)
> 
> crw-rw---- 1 root root 226, 0 2009-01-18 08:54 /dev/dri/card0
> 
This would explain the bug, then.  The permissions should probably be
changed to 0666.

> Does this device need to be accessible for users in order to use DRI? It looks
> as if only the X server itself should be able to access it?
> 
The X server uses it for AIGLX.  For direct rendering, gl apps need
access to this device.
Comment 15 Martin Pitt 2009-01-19 03:07:50 UTC
It is indeed a copy&paste error in hal's auto ACL rules.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.