nvidia-prime should support gdm also

Bug #1262068 reported by Tim Lunn
102
This bug affects 13 people
Affects Status Importance Assigned to Milestone
Ubuntu GNOME
Triaged
Medium
Unassigned
gdm (Ubuntu)
Fix Released
Wishlist
Unassigned
Trusty
Confirmed
Undecided
Unassigned
gdm3 (Ubuntu)
Fix Released
Undecided
Unassigned
Trusty
Confirmed
Undecided
Unassigned
nvidia-prime (Ubuntu)
Fix Released
Wishlist
Alberto Milone
Precise
Fix Released
Wishlist
Unassigned
Trusty
Confirmed
Undecided
Unassigned
ubuntu-drivers-common (Ubuntu)
Fix Released
Wishlist
Unassigned
Trusty
Confirmed
Wishlist
Unassigned

Bug Description

On Ubuntu GNOME we ship gdm by default, however nvidia-prime depends on lightdm. This means that

1. Anyone installing nvidia binary drivers will pull in nvidia-prime and subsequently lightdm. As a consequence of this they are also going to get the potentially confusing dconf pop-up asking them to choose a DM.
2. nvidia-prime probably won't work when using gdm

I haven't looked to closely at how deeply integrated this is with lightdm, however we particularly don't want #1 happening, and it would be nice if #2 worked.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: nvidia-prime (not installed)
ProcVersionSignature: Ubuntu 3.12.0-5.13-generic 3.12.2
Uname: Linux 3.12.0-5-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.12.7-0ubuntu2
Architecture: amd64
CurrentDesktop: GNOME
Date: Wed Dec 18 16:56:19 2013
InstallationDate: Installed on 2012-09-23 (451 days ago)
InstallationMedia: Ubuntu GNOME Remix 12.10 "Quantal Quetzal" - Alpha amd64(20120922)
SourcePackage: nvidia-prime
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Tim Lunn (darkxst) wrote :
Changed in ubuntu-gnome:
milestone: none → trusty
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Alberto Milone (albertomilone) wrote :

If gdm supports running scripts when starting a greeter seession or right after stopping X, then it's doable.

These are the relevant fields in the lightdm configuration file:

# display-setup-script = Script to run when starting a greeter session (runs as root)
# display-stopped-script = Script to run after stopping the display server (runs as root)

Changed in nvidia-prime (Ubuntu):
importance: Undecided → Wishlist
status: New → Triaged
Tim Lunn (darkxst)
Changed in ubuntu-gnome:
status: Confirmed → Triaged
Changed in nvidia-prime (Ubuntu):
assignee: nobody → Alberto Milone (albertomilone)
Revision history for this message
Alberto Milone (albertomilone) wrote :

nvidia-prime 0.5.2 should fix at least use case 1 i.e. the single graphics card use case. It still won't work with hybrid graphics but at least gdm and kdm users won't be forced to install lightdm if they install the nvidia driver.

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

This bug was fixed in the package nvidia-prime - 0.5.2

---------------
nvidia-prime (0.5.2) trusty; urgency=low

  * debian/control:
    - Add an alternative dependency on gdm and kdm
      so that gdm or kdm users are not forced to install
      lightdm now that nvidia depends on nvidia-prime.
      This fixes only the single graphics card use case
      (hybrid graphics won't still work without lightdm)
      but it's a step in the right direction (LP: #1262068).
  * debian/preinst.in:
    - Set the lightdm configuration bits only if lightdm
      is the default display manager.
 -- Alberto Milone <email address hidden> Fri, 20 Dec 2013 15:43:58 +0100

Changed in nvidia-prime (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Colin Watson (cjwatson) wrote : Please test proposed package

Hello Tim, or anyone else affected,

Accepted nvidia-prime into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/nvidia-prime/0.5~hybrid0.0.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed 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 https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in nvidia-prime (Ubuntu Precise):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Alberto Milone (albertomilone) wrote :

I can confirm that the new nvidia-prime works well here:

:~$ apt-cache policy nvidia-prime
nvidia-prime:
  Installed: 0.5~hybrid0.0.2
  Candidate: 0.5~hybrid0.0.2
  Version table:
 *** 0.5~hybrid0.0.2 0
        400 http://archive.ubuntu.com/ubuntu/ precise-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     0.4.2~hybrid0.0.1 0
        500 http://it.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nvidia-prime - 0.5~hybrid0.0.2

---------------
nvidia-prime (0.5~hybrid0.0.2) precise-proposed; urgency=low

  * debian/control:
    - Add alternative dependency on gdm and kdm.
  * debian/preinst.in:
    - Set the lightdm configuration bits only if lightdm is the
      default display manager (LP: #1262068).
  * debian/postrm.in, debian/rules:
    - Avoid calling dpkg-architecture (LP: #1264611).
  * prime-xconfig:
    - Format hexadecimal parameters properly (LP: #1252667).

nvidia-prime (0.5~hybrid0.0.1) precise-proposed; urgency=low

  * New upstream release:
    - Add support for power management (LP: #1259237).
  * debian/control:
    - Depend on upstart, bbswitch, lsb-release, lightdm >= 1.2.3-0ubuntu2.4,
      screen-resolution-extra (>= 0.14ubuntu2.1).
    - Build only for i386 and amd64.
 -- Alberto Milone <email address hidden> Mon, 13 Jan 2014 16:32:47 +0100

Changed in nvidia-prime (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Colin Watson (cjwatson) wrote : Update Released

The verification of the Stable Release Update for nvidia-prime 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 regresssions.

Revision history for this message
Tim Lunn (darkxst) wrote :

@Alberto, I took a look at gdm, it has an "Init" script that runs right after X comes up (and before starting the greeter) however this is run as the gdm user, not root. will that work?

There is no script to run on shutting down the display manager, so I guess would need to patch gdm for this one.

Revision history for this message
Alberto Milone (albertomilone) wrote :

@Tim: that "Init" script doesn't require root privileges, as all it does is call xrandr to do the offloading part.

As for the script to run after stopping the display server (i.e. on log out), that would need root privileges.

Revision history for this message
Tim Lunn (darkxst) wrote :
Revision history for this message
Tim Lunn (darkxst) wrote :

@Alberto, prime-offload needs to be run as root, or logging won't work. Anyway I have a patch ready for gdm.

for the stop script, its seems to me like it could just be run by upstart, see above patch. Will that work?

Tim Lunn (darkxst)
no longer affects: gdm (Ubuntu Precise)
no longer affects: ubuntu-drivers-common (Ubuntu Precise)
tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in gdm (Ubuntu):
status: New → Confirmed
Changed in ubuntu-drivers-common (Ubuntu):
status: New → Confirmed
Changed in gdm (Ubuntu):
importance: Undecided → Medium
importance: Medium → Low
Changed in nvidia-prime (Ubuntu Precise):
importance: Undecided → Low
Changed in ubuntu-drivers-common (Ubuntu):
importance: Undecided → Low
Changed in nvidia-prime (Ubuntu Precise):
importance: Low → Wishlist
Changed in ubuntu-drivers-common (Ubuntu):
importance: Low → Wishlist
Changed in gdm (Ubuntu):
importance: Low → Wishlist
Revision history for this message
Alberto Milone (albertomilone) wrote :

@Tim: as for permission, maybe the gdm user doesn't have the same permissions as a standard user?

As for the stop script, wouldn't that require GDM to be stopped (rather than just X)?

Tim Lunn (darkxst)
Changed in ubuntu-gnome:
milestone: trusty → trusty.1
Revision history for this message
Rob (robertdavidlee) wrote :

Hello,

Is there more to this fix than the latest version of nvidia-prime plus the gpu-manager.conf addition? I've tried using nvidia-prime 0.6.2 plush the gpu-manager.conf changes but no luck. I'm also seeing different behavior than when I've tried nvidia-prime and prime-indicator on Ubuntu 12.04 in that a call to "prime select nvidia" does not cause a prime generated xorg.conf file to be written to /etc/X11/. Perhaps this is an unrelated issue though.

When trying to debug my problem I also ran into another prime or prime-indicator lightdm config file that was specific to lightdm, though I can't find it now. I just remember a light that had "start" or "upstart" in it along with "lightdm" but there was no "gdm" anywhere in the file.

Thanks

Revision history for this message
Rob (robertdavidlee) wrote :

I spent some more time and was able to get things working on my machine, so I though I'd share how. Note this is definitely a hack but it works and perhaps Alberto or Tim could give directions on a temporary fix that is less hacky while we wait for the official fix to be posted somewhere.

1. In /etc/gdm/Init/Defaut, add the line /sbin/prime-offload right before the exit 0. Or better, write your own script to call "Default" and then run prime-offload.

2. Unlike older version of nvidia-prime, newer versions don't appear to generate an xorg.conf file. But with my hack fix, it still needed when in "nvidia" mode. So after I do a "prime-select nvidia" I create an xorg.conf file in /etc/X11/ with the following contents:

########################################
Section "ServerLayout"
Identifier "layout"
Screen 0 "nvidia"
Inactive "intel"
EndSection

Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:1:0:0"
EndSection

Section "Screen"
Identifier "nvidia"
Device "nvidia"
# Uncomment this line if your computer has no display devices connected to
# the NVIDIA GPU. Leave it commented if you have display devices
# connected to the NVIDIA GPU that you would like to use.
Option "UseDisplayDevice" "none"
EndSection

Section "Device"
Identifier "intel"
Driver "modesetting"
EndSection

Section "Screen"
Identifier "intel"
Device "intel"
EndSection
##########################################

Then reboot for nvidia mode. Note that when you want to enable intel mode, you'll need to remove this file and reboot.

Like I said, a total hack but it enables nvidia mode for me which is all I needed for now.

One other issue I saw was that the /etc/init/nvidia-prime.conf has some specific use of lightdm. Whatever it's doing there, I guess it needs to do for gdm as well.

Revision history for this message
Tim Lunn (darkxst) wrote :

Rob, I believe the code that creates the xorg.conf was merged into ubuntu-drivers-common, however the gpu-manager task does not currently run under gdm. Do you get a autogenerated xorg.conf if you edit

/etc/init/gpu-manager.conf

to include an
'or starting gdm'

Also there is a build of gdm at ppa:darkxst/gdm-prime, that should handle prime-offload etc, without any modifications

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

This bug was fixed in the package gdm - 3.10.0.1-0ubuntu6

---------------
gdm (3.10.0.1-0ubuntu6) utopic; urgency=medium

  * debian/patches/ubuntu_nvidia_prime.patch:
    - Add hook to run prime-offload (as root) and prime-switch if
      nvidia-prime is installed (LP: #1262068)
 -- Tim Lunn <email address hidden> Sat, 22 Mar 2014 10:26:40 +1100

Changed in gdm (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

---------------
ubuntu-drivers-common (1:0.2.95) utopic; urgency=medium

  [ Tim Lunn ]
  * gpu-manager.c, gpu-manager.conf:
    - Use the gpu-manager with GDM too now that support for
      it has landed in Utopic (LP: #1262068).
 -- Alberto Milone <email address hidden> Fri, 30 May 2014 14:09:31 +0200

Changed in ubuntu-drivers-common (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in gdm (Ubuntu Trusty):
status: New → Confirmed
Changed in nvidia-prime (Ubuntu Trusty):
status: New → Confirmed
Changed in ubuntu-drivers-common (Ubuntu Trusty):
status: New → Confirmed
Revision history for this message
Jean-Louis Jouannic (jljouannic) wrote :

Since a recent update on ubuntu-drivers-common and nvidia driver I am unable to select the NVIDIA GPU through nvidia-settings. When I try to do so, all I obtain is a blank dialog box with a forbidden sign and an 'OK' button.

Before this update I was using the packages provided by ppa:darkxst/gdm-prime.

Reading the comments above, I have edited the /etc/init/gpu-manager.conf file to add the 'or starting gdm' option but it did not change anything.

What can I do ?

Revision history for this message
Alberto Milone (albertomilone) wrote :

@Jean: please attach your /var/log/gpu-manager.log

Changed in ubuntu-drivers-common (Ubuntu Trusty):
importance: Undecided → Wishlist
Mathew Hodson (mhodson)
tags: added: ubuntu-gnome
Tim Lunn (darkxst)
Changed in ubuntu-gnome:
milestone: trusty.1 → trusty.3
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (3.9 KiB)

This bug was fixed in the package gdm3 - 3.20.1-1ubuntu1

---------------
gdm3 (3.20.1-1ubuntu1) yakkety; urgency=medium

  * Team upload.
  * Merge with Debian. Remaining changes:
    + README.Debian: update for correct paths in Ubuntu
    + Use upstream Xsession script
    + control.in:
      - Drop recommends on desktop-base
      - depend on bash for ubuntu_config_error_dialog.patch
      - Add a transitional gdm package
    + rules:
      - Don't override default user/group
      - --enable-gdm-xsession to install upstream Xsession script
      - override of dh_installinit with --no-start to avoid session being killed
    + rules, README.Debian, gdm3.8.pod:
      Use upstream custom.conf instead of daemon.conf
    + Migrate settings to gdm3 paths, this can be dropped in 16.10
      - Migrate pam files as per debian structure
      - gdm.preinst, gdm3.postinst: Move conffiles to new location (/etc/gdm3)
      - gdm.postinst: purge the old gdm dconf profile
      - generate_config: update gdm user homedir, done here since systemd blocks
        usermod from working in maintscripts
      - gdm3.config: force transition of dconf selection to gdm3
    + gdm3.{postinst,postrm}: rename user and group back to gdm
    + gdm3.postinst: don't kill gdm on upgrade
    + gdm3.*.pam: Make pam_env read ~/.pam_environment (LP: #952185)
    + ubuntu_run_xsession.d.patch
    + ubuntu_upstart_event.patch:
      - emit upstart events
    + ubuntu_xresources_is_a_dir.patch
       when running systemd init
    + ubuntu_nvidia_prime.patch:
      - Add hook to run prime-offload (as root) and prime-switch if
        nvidia-prime is installed (LP: #1262068)
    + revert_override_LANG_with_accountservices.patch:
      - On Ubuntu accountservices only stores the language and not the
        full locale as needed by LANG.
    + ubuntu_config_error_dialog.patch:
      - Show warning dialog in case of error in ~/.profile etc. and
        don't let a syntax error make the login fail (LP: #678421).
    + 09_default_session.patch:
      - Dropped, all the other Ubuntu flavors use LightDM and it only takes a
        gsettings override to set a different default session

gdm3 (3.20.1-1) unstable; urgency=medium

  * New upstream release.
  * Restore debian/patches/09_default_session.patch as we postponed the switch
    to Wayland.
  * Upload to unstable.

gdm3 (3.20.0-2) experimental; urgency=medium

  * debian/rules: Switch back the initial VT to vt1 (Closes: #819423)
  * Drop /usr/share/gdm/greeter/dbus-1 files, gdm/gnome-shell doesn't try to
    start telepathy-mission-control and gnome-online-accounts anymore.
  * Drop debian/patches/09_default_session.patch completely as we want to
    default to the wayland session for now.
  * debian/default.desktop.in: Update the Name of the Comment to make it clear
    that it will start the X11 default session of the system.

gdm3 (3.20.0-1) experimental; urgency=medium

  * Drop debian/patches/93_disable_gvfs.patch
    - superseded by upstream commit 5e81151a147
      "launch-environment: disable gvfs except in initial setup mode"
  * Bump gnome-shell dependency to >= 3.19.92
    - new interactions between gdm and gnome-shell for...

Read more...

Changed in gdm3 (Ubuntu):
status: New → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in gdm3 (Ubuntu Trusty):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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