[regression] Poor performance with recent update with i965: libGL error: failed to open drm device: Permission denied

Bug #1302270 reported by Jamie Strandboge
This bug report is a duplicate of:  Bug #1415104: logind flags wrong session as active. Edit Remove
68
This bug affects 15 people
Affects Status Importance Assigned to Milestone
Compiz
Invalid
High
Unassigned
Unity
Invalid
High
Unassigned
systemd (Ubuntu)
Incomplete
High
Unassigned

Bug Description

I rebooted into up to date trusty and noticed Unity was incredibly slow. I hadn't rebooted in a while, so I'm not sure what package caused the issue, though I'm guessing it is mesa (I saw i965 pci ids were ifdef'd in the Launchpad diff, but I didn't look super closely).

~/.xsession-errors has this to say:
libGL error: failed to open drm device: Permission denied
libGL error: failed to load driver: i965

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: xorg 1:7.7+1ubuntu8
ProcVersionSignature: Ubuntu 3.13.0-22.44-generic 3.13.8
Uname: Linux 3.13.0-22-generic x86_64
.tmp.unity.support.test.1:

ApportVersion: 2.14-0ubuntu1
Architecture: amd64
CompizPlugins: [core,composite,opengl,compiztoolbox,decor,vpswitch,snap,mousepoll,resize,place,move,wall,grid,regex,imgpng,session,gnomecompat,animation,fade,unitymtgrabhandles,workarounds,scale,expo,ezoom,unityshell]
CompositorRunning: compiz
CompositorUnredirectDriverBlacklist: '(nouveau|Intel).*Mesa 8.0'
CompositorUnredirectFSW: true
CurrentDesktop: Unity
Date: Thu Apr 3 20:08:18 2014
DistUpgraded: 2013-11-04 08:48:34,282 DEBUG enabling apt cron job
DistroCodename: trusty
DistroVariant: ubuntu
ExtraDebuggingInterest: Yes
GraphicsCard:
 Intel Corporation Core Processor Integrated Graphics Controller [8086:0046] (rev 02) (prog-if 00 [VGA controller])
   Subsystem: Lenovo Device [17aa:215a]
InstallationDate: Installed on 2011-06-28 (1010 days ago)
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110425.2)
Lsusb:
 Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
 Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
MachineType: LENOVO 5129CTO
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.13.0-22-generic root=UUID=88689ad2-74b5-442c-9290-8ae60b63e16b ro quiet splash vt.handoff=7
SourcePackage: xorg
Symptom: display
UpgradeStatus: Upgraded to trusty on 2013-11-04 (150 days ago)
dmi.bios.date: 02/24/2011
dmi.bios.vendor: LENOVO
dmi.bios.version: 6QET64WW (1.34 )
dmi.board.name: 5129CTO
dmi.board.vendor: LENOVO
dmi.board.version: Not Available
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: Not Available
dmi.modalias: dmi:bvnLENOVO:bvr6QET64WW(1.34):bd02/24/2011:svnLENOVO:pn5129CTO:pvrThinkPadX201s:rvnLENOVO:rn5129CTO:rvrNotAvailable:cvnLENOVO:ct10:cvrNotAvailable:
dmi.product.name: 5129CTO
dmi.product.version: ThinkPad X201s
dmi.sys.vendor: LENOVO
version.compiz: compiz 1:0.9.11+14.04.20140328-0ubuntu1
version.ia32-libs: ia32-libs N/A
version.libdrm2: libdrm2 2.4.52-1
version.libgl1-mesa-dri: libgl1-mesa-dri 10.1.0-4ubuntu1
version.libgl1-mesa-dri-experimental: libgl1-mesa-dri-experimental N/A
version.libgl1-mesa-glx: libgl1-mesa-glx 10.1.0-4ubuntu1
version.xserver-xorg-core: xserver-xorg-core 2:1.15.0-1ubuntu7
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev 1:2.8.2-1ubuntu2
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:7.3.0-1ubuntu3
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.99.910-0ubuntu1
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:1.0.10-1ubuntu2
xserver.bootTime: Thu Apr 3 19:38:17 2014
xserver.configfile: default
xserver.errors:

xserver.logfile: /var/log/Xorg.0.log
xserver.outputs:
 product id 16404
 vendor LEN
xserver.version: 2:1.15.0-1ubuntu7

Revision history for this message
Jamie Strandboge (jdstrand) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in xorg (Ubuntu):
status: New → Confirmed
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Confirmed. Here's what I just reported in a duplicate:

After updating today Unity only starts in software rendering mode. I can tell because:
  1. There's no dash blur.
  2. Graphics performance is slow.
  3. .xsession-errors says:
       libGL error: failed to open drm device: Permission denied
       libGL error: failed to load driver: i965
  4. compiz is linked to the software driver:

$ pmap `pidof compiz` | grep dri
00007f9a1e386000 3256K r-x-- swrast_dri.so
00007f9a1e6b4000 2048K ----- swrast_dri.so
00007f9a1e8b4000 60K r---- swrast_dri.so
00007f9a1e8c3000 32K rw--- swrast_dri.so

Changed in compiz:
status: New → Confirmed
Changed in unity:
status: New → Confirmed
Changed in compiz:
importance: Undecided → High
Changed in unity:
importance: Undecided → High
Changed in xorg (Ubuntu):
importance: Undecided → High
summary: - Poor performance with recent update with i965: libGL error: failed to
- open drm device: Permission denied
+ [regression] Poor performance with recent update with i965: libGL error:
+ failed to open drm device: Permission denied
tags: added: regression-update
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

$ ls -l /dev/dri/
total 0
crw-rw---- 1 root video 226, 0 Apr 3 19:38 card0
crw-rw---- 1 root video 226, 64 Apr 3 19:38 controlD64

This seems to be normal. I also was not in the video group, however if I add myself to the video group, logout and back in, then I don't have the .xsession-errors and I unity7 is responsive again. Not sure what would cause me to have to be in the video group all of a sudden, but it does seem to be a workaround.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

This looks like bug 1292675. Although this bug seems to have suddenly started affecting some people such as myself just today. So I'll hold off making this a duplicate of bug 1292675.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Reverting today's update of systemd/udev back to the previous release fixes the problem for me:

sudo dpkg -i /var/cache/apt/archives/*204-5ubuntu15*

Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 1302270] Re: [regression] Poor performance with recent update with i965: libGL error: failed to open drm device: Permission denied

On Fri, Apr 04, 2014 at 03:17:38AM -0000, Jamie Strandboge wrote:
> $ ls -l /dev/dri/
> total 0
> crw-rw---- 1 root video 226, 0 Apr 3 19:38 card0
> crw-rw---- 1 root video 226, 64 Apr 3 19:38 controlD64

> This seems to be normal. I also was not in the video group, however if I
> add myself to the video group, logout and back in, then I don't have the
> .xsession-errors and I unity7 is responsive again. Not sure what would
> cause me to have to be in the video group all of a sudden, but it does
> seem to be a workaround.

"Normal" is that the permissions on /dev/dri/card0 are managed with setfacl.
I believe this is done as part of logind. What version of systemd-services
did you have installed? Perhaps this is related to the logind/cgmanager
regression seen in systemd 204-5ubuntu14/15 (fixed in -5ubuntu16)?

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
<email address hidden> <email address hidden>

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The broken revision is systemd 204-5ubuntu16.
To fix it, go back to 204-5ubuntu15.

Changed in systemd (Ubuntu):
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Actually, I did get it happening once with 204-5ubuntu15 but mostly it's fine now. The intermediate nature of the problem does support the theory that it is rooted in some older changes, per bug 1292675 and its duplicates.

Revision history for this message
zEn (der-eremit) wrote :

Same Problem appeared for me with todays updates.

Revision history for this message
M4he (mahe) wrote :

This suddenly appeared for me as well.
I've been using compton's opengl backend for compositing and after booting up today I got the same libGL permission errors and tearing on the desktop (due to the software rendering mode fallback I assume). Then I noticed my user was not in the 'video' group.
I did a "sudo usermod -a -G video <username>" and rebooted. That fixed the issue for me.

Revision history for this message
David Oftedal (rounin) wrote :

I just started experiencing this bug on 14.10 today, after updating the system.
I do not seem to have bug #1302264, which this bug was marked as a duplicate of.
It's possible to work around the bug by using "chown -R user /dev/dri".

Revision history for this message
David Oftedal (rounin) wrote :

Also, I seem to have a Radeon card, because when the bug occurs, I also get the message "failed to load driver: r600".

Revision history for this message
Martin Pitt (pitti) wrote :

Jamie, Daniel, did you ever get this after the fix in bug 1302264? This is the typical symptom of logind not working, so if you have that situation can you please check for a logind crash /var/crash?

Changed in compiz:
status: Confirmed → Invalid
Changed in unity:
status: Confirmed → Invalid
no longer affects: xorg (Ubuntu)
Changed in systemd (Ubuntu):
status: Confirmed → Invalid
status: Invalid → Incomplete
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I haven't had the issue for a long time.

But comment #12 suggests we might still have a race or failure to set permissions on the DRI devices still.

Revision history for this message
Martin Pitt (pitti) wrote :

Bug 1415104 is a well-understood case where this would happen. I'm not aware of any other situation where this would happen right now, and you said it's not really reproducible. So I think the most useful thing to do with this bug is to make it a dupe.

Revision history for this message
Danny Howard (dannyman) wrote :

I found this bug trying to launch firefox Ubuntu 16.04 server:

djh@test0:~$ firefox
libGL error: failed to open drm device: Permission denied
libGL error: failed to load driver: i965

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Danny: This bug (bug 1415104) was marked as fix released on 2015-02-02. So if you're still having problems please log a new bug.

I can already tell your problem is that the login hasn't set correct permissions on /dev/dri/*. This is normal (not a bug) for tty logins, but should be resolved automatically with graphical logins (lightdm).

Please log a new bug here: https://bugs.launchpad.net/ubuntu/+source/lightdm/+filebug

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.