gpu-manager's drm output detection affects boot time

Bug #1586933 reported by Alberto Milone on 2016-05-30
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ubuntu-drivers-common (Ubuntu)
Alberto Milone
Alberto Milone

Bug Description

SRU request:

The current drm code to probe the connected outputs is too resource intensive, and slow down the boot process.

[Test Case]
1) Boot Ubuntu and run the following command, looking for gpu-manager:
systemd-analize blame

This will show how long gpu-manager took. Write down the number

2) Install the package from -proposed, and run systemd-analize blame. See if the number has become smaller.

[Regression Potential]
Low, all the changes are already included in Yakkety.

Rather than calling drm directly, gpu-manager should simply check the outputs connector status by using the sysfs filesystem (e.g. /sys/class/drm/card0-HDMI-A-1/status, etc.), thus relying on data that is already available.

This should make gpu-manager a bit less resource intensive, especially on boot.

The attached perf shows the problem in gpu-manager.

Alberto Milone (albertomilone) wrote :
Changed in ubuntu-drivers-common (Ubuntu):
status: Triaged → In Progress
Changed in ubuntu-drivers-common (Ubuntu Xenial):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Alberto Milone (albertomilone)
Alberto Milone (albertomilone) wrote :

I committed a fix in Yakkey but aptdaemon is currently broken (LP: #1496292), so ubuntu-driver-common won't build.

description: updated
Changed in ubuntu-drivers-common (Ubuntu):
status: In Progress → Fix Committed
Martin Pitt (pitti) wrote :

I postponed accepting this into x-proposed. There are major changes here which really should get some field testing in yakkety first.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-drivers-common - 1:0.4.20

ubuntu-drivers-common (1:0.4.20) yakkety; urgency=medium

  * Remove PackageKit plugin. This stopped working with packagekit 1.0 as its
    apt backend is gone and aptcc does not support plugins.
  * debian/control: Drop obsolete XS-Testsuite:.
  * Bump Standards-Version to 3.9.8.

 -- Martin Pitt <email address hidden> Tue, 16 Aug 2016 11:46:36 +0200

Changed in ubuntu-drivers-common (Ubuntu):
status: Fix Committed → Fix Released

Hello Alberto, or anyone else affected,

Accepted ubuntu-drivers-common into xenial-proposed. The package will build now and be available at in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at . Thank you in advance!

Changed in ubuntu-drivers-common (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed

i tested 1: from proposed and the boot process was faster

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-drivers-common - 1:

ubuntu-drivers-common (1: xenial-proposed; urgency=medium

  [ Alberto Milone ]
  * gpu-manager.c:
    - Fix memory leak in get_alternatives(). Make sure to always free
      alternatives->current_core and alternatives->current_egl.
    - Partially drop the drm code, and get information about connectors
      from sysf. This fixes a long standing performance issue (LP: #1586933).
    - Disable persistence mode before powering down the dGPU.
      If persistence mode is not disabled, gpu-manager will not be able to
      unload the nvidia module (LP: #1619306).
    - Make sure to load and unload nvidia-drm. This fixes a problem that
      prevents the dGPU from being powered off in hybrid systems with
      recent nvidia drivers (LP: #1619306).

  [ Ying-Chun Liu (PaulLiu) ]
  * Quirks/
    - Catch and ignore UnicodeDecodeErrors in dmi info, as some machines
      may report board_name as ffffffffffff0a to mean empty, and this
      causes an error in python 3 (LP: #1320868).

 -- Alberto Milone <email address hidden> Mon, 06 Jun 2016 12:49:19 +0200

Changed in ubuntu-drivers-common (Ubuntu Xenial):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for ubuntu-drivers-common has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

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

Other bug subscribers

Bug attachments