Merge lp:~albertomilone/gdm/lp1697882 into lp:~ubuntu-desktop/gdm/ubuntu
| Status: | Merged |
|---|---|
| Approved by: | Iain Lane on 2017-09-04 |
| Approved revision: | 432 |
| Merged at revision: | 432 |
| Proposed branch: | lp:~albertomilone/gdm/lp1697882 |
| Merge into: | lp:~ubuntu-desktop/gdm/ubuntu |
| Diff against target: |
271 lines (+256/-0) 2 files modified
debian/patches/95_hide_x11_sessions_with_nvidia_kms.patch (+255/-0) debian/patches/series (+1/-0) |
| To merge this branch: | bzr merge lp:~albertomilone/gdm/lp1697882 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Iain Lane | Approve on 2017-09-04 | ||
| Daniel van Vugt (community) | Needs Fixing on 2017-07-13 | ||
| Jeremy Bicha | 2017-06-28 | Pending | |
|
Review via email:
|
|||
Description of the Change
This change, which is (Ubuntu specific), will hide away the X11 sessions when KMS is enabled in the nvidia driver, leaving the Wayland session as the only option.
Disabling KMS will make the sessions available again after a reboot.
Fixes LP: #1697882
| Alberto Milone (albertomilone) wrote : | # |
> Thanks. Please could you file upstream and then add that URL into the patch as
> "Forwarded: <url>"?
>
This is something that will have to be fixed in the kernel, when the Unix Device Memory Allocator API lands in the kernel. It will take a while. I don't think it's a GNOME specific problem, but we might want to work around it for now.
> Is there a better way than looking at a configuration file such as looking at
> the loaded modules somehow? Isn't that distro specific or at least fragile?
Sure, /sys/module/
| Iain Lane (laney) wrote : | # |
On Wed, Jun 28, 2017 at 04:35:35PM -0000, Alberto Milone wrote:
> > Thanks. Please could you file upstream and then add that URL into the patch as
> > "Forwarded: <url>"?
> >
>
> This is something that will have to be fixed in the kernel, when the Unix Device Memory Allocator API lands in the kernel. It will take a while. I don't think it's a GNOME specific problem, but we might want to work around it for now.
Right, but it is correct that this workaround (disabling X on nvidia +
modesetting) is not Ubuntu specific, isn't it?
> > Is there a better way than looking at a configuration file such as looking at
> > the loaded modules somehow? Isn't that distro specific or at least fragile?
>
> Sure, /sys/module/
gdm3 runs as root. I'm not sure if it drops permissions before getting
to this point - I think probably not, and this is worth looking into.
--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]
| Alberto Milone (albertomilone) wrote : | # |
> On Wed, Jun 28, 2017 at 04:35:35PM -0000, Alberto Milone wrote:
> > > Thanks. Please could you file upstream and then add that URL into the
> patch as
> > > "Forwarded: <url>"?
> > >
> >
> > This is something that will have to be fixed in the kernel, when the Unix
> Device Memory Allocator API lands in the kernel. It will take a while. I don't
> think it's a GNOME specific problem, but we might want to work around it for
> now.
>
> Right, but it is correct that this workaround (disabling X on nvidia +
> modesetting) is not Ubuntu specific, isn't it?
>
Correct. It is how we check KMS that, with the current approach, is Ubuntu specific (because of the root privileges thing).
> gdm3 runs as root. I'm not sure if it drops permissions before getting
> to this point - I think probably not, and this is worth looking into.
>
I'm pretty sure I ran into this problem when I started working on this. I can double check, as the effort should be minimal.
| Alberto Milone (albertomilone) wrote : | # |
Unfortunately, I have just checked, and we no longer have root privileges by the time can_create_
| Iain Lane (laney) wrote : | # |
On Wed, Jun 28, 2017 at 06:41:32PM -0000, Alberto Milone wrote:
> Unfortunately, I have just checked, and we no longer have root privileges by the time can_create_
Ok, that's annoying - I don't suppose it's possible to grab this value
before privileges are dropped and pass it around?
--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]
| Alberto Milone (albertomilone) wrote : | # |
> On Wed, Jun 28, 2017 at 06:41:32PM -0000, Alberto Milone wrote:
> > Unfortunately, I have just checked, and we no longer have root privileges by
> the time can_create_
>
> Ok, that's annoying - I don't suppose it's possible to grab this value
> before privileges are dropped and pass it around?
>
I'm not sure about that. It's probably easier to use the current udev rule, that the nvidia packages ship, to check the value when the module is loaded, and to write it somewhere in /run, so that GDM can read it later.
What do you think?
| Iain Lane (laney) wrote : | # |
On Thu, Jun 29, 2017 at 10:29:58AM -0000, Alberto Milone wrote:
> > On Wed, Jun 28, 2017 at 06:41:32PM -0000, Alberto Milone wrote:
> > > Unfortunately, I have just checked, and we no longer have root privileges by
> > the time can_create_
> >
> > Ok, that's annoying - I don't suppose it's possible to grab this value
> > before privileges are dropped and pass it around?
> >
>
> I'm not sure about that. It's probably easier to use the current udev rule, that the nvidia packages ship, to check the value when the module is loaded, and to write it somewhere in /run, so that GDM can read it later.
>
> What do you think?
I like that more than reading the configuration file - but it doesn't
sounds like something that could go in gdm upstream? Unless maybe you
can get some buy in for standardising on this. Maybe file a bug on
bugzilla and ask for opinions.
If it's too hard to grab the value from /sys, I guess we can do it this
way.
--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]
| Alberto Milone (albertomilone) wrote : | # |
> I like that more than reading the configuration file - but it doesn't
> sounds like something that could go in gdm upstream? Unless maybe you
> can get some buy in for standardising on this. Maybe file a bug on
> bugzilla and ask for opinions.
>
I don't think it should be upstreamed, and I hope we can drop this in the near future. I think we can live with a small patch for now (which I am going to maintain).
> If it's too hard to grab the value from /sys, I guess we can do it this
> way.
Ok, I'll work on it.
| Iain Lane (laney) wrote : | # |
On Thu, Jun 29, 2017 at 11:59:23AM -0000, Alberto Milone wrote:
> > I like that more than reading the configuration file - but it doesn't
> > sounds like something that could go in gdm upstream? Unless maybe you
> > can get some buy in for standardising on this. Maybe file a bug on
> > bugzilla and ask for opinions.
> >
>
> I don't think it should be upstreamed, and I hope we can drop this in the near future. I think we can live with a small patch for now (which I am going to maintain).
Why not? Does this somehow work on other distributions? If it doesn't,
why would it be desirable to keep showing broken sessions there?
> > If it's too hard to grab the value from /sys, I guess we can do it this
> > way.
>
> Ok, I'll work on it.
k.
--
Iain Lane [ <email address hidden> ]
Debian Developer [ <email address hidden> ]
Ubuntu Developer [ <email address hidden> ]
| Alberto Milone (albertomilone) wrote : | # |
I have just filed an upstream bug report about this:
https:/
- 411. By Ken VanDine on 2017-07-03
-
Only prompt the user to choose display managers when we haven't already determined a migration to gdm3 is recommended.
- 412. By Ken VanDine on 2017-07-03
-
Merged
- 413. By Ken VanDine on 2017-07-03
-
* debian/gdm3.config
- Only prompt the user to choose display managers when we haven't already
determined a migration to gdm3 is recommended.
* debian/control.in
- Explicitly depend on ubuntu-session so we can ensure gdm3 configure gets
run after ubuntu-session's configure to handle the transition from
lightdm to gdm3 - 414. By Ken VanDine on 2017-07-10
-
released
- 415. By Ken VanDine on 2017-07-11
-
* debian/gdm3.config
- Handle the transition from lightdm in gdm3 rather than ubuntu-session
* debian/control.in
- Dropped depends from ubuntu-session - 416. By Ken VanDine on 2017-07-11
-
Fixed ubuntu-session version check
- 417. By Ken VanDine on 2017-07-11
-
Dropped depends for ubuntu-session
- 418. By Ken VanDine on 2017-07-11
-
releasing package gdm3 version 3.24.2-1ubuntu5
- 419. By Didier Roche on 2017-07-12
-
debian/
patches/ ubuntu_ prefer_ x11_session. patch:
Prefer X11 session over wayland. As we are not ready yet for
switching to wayland yet, let's prefer X11 session when no specific
choice was made. (LP: #1703601)
This will be reverted once we switch to wayland by default. - 420. By Didier Roche on 2017-07-12
-
releasing package gdm3 version 3.24.2-1ubuntu6
- 421. By Iain Lane on 2017-07-12
-
debian/gdm3.config: Check the version of gdm3 instead of ubuntu-session.
And some other minor improvements.
- 422. By Iain Lane on 2017-07-12
-
Compare with a ~ version, so that any backports of this exact version aren't re-migrated
- 423. By Iain Lane on 2017-07-12
-
releasing package gdm3 version 3.24.2-1ubuntu7
- 424. By Daniel van Vugt on 2017-07-13
-
First attempt
- 425. By Daniel van Vugt on 2017-07-13
-
Remember the changelog
| Daniel van Vugt (vanvugt) wrote : | # |
Pretty sure this will have conflicts now, sorry.
- 426. By Will Cooke on 2017-07-13
-
* debian/default.pa
- Added new file to disable Bluetooth audio devices in PulseAudio from
gdm3. (LP: #1703415) (LP: #1489651)
* debian/gdm3.install
- Added details of the default.pa file
* debian/gdm3.postinst
- Added installation of default.pa and creation of dir if it doesn't
exist. - 427. By Jeremy Bicha on 2017-07-13
-
releasing package gdm3 version 3.24.2-1ubuntu9
- 428. By Jeremy Bicha on 2017-08-14
-
New upstream release 3.25.90.1
* debian/control.in:
- Bump minimum gnome-settings-daemon to 3.24
* Drop patches applied in new release:
- Avoid-double-NULL-terminated -array- LP-1704050. patch
- revert_drop_gdm_ shell_session. patch - 429. By Jeremy Bicha on 2017-08-14
-
releasing package gdm3 version 3.25.90.1-0ubuntu1
- 430. By Didier Roche on 2017-08-21
-
* debian/
patches/ ubuntu_ prefer_ x11_session. patch:
- remove x11 session preference now that both Ubuntu and GNOME
switched to wayland - 431. By Didier Roche on 2017-08-21
-
releasing package gdm3 version 3.25.90.1-0ubuntu2
| Alberto Milone (albertomilone) wrote : | # |
I have come up with a better solution, which I attached to the upstream bug report:
https:/
- 432. By Alberto Milone on 2017-08-24
-
Hide X11 sessions when KMS is enabled in the nvidia driver
NOTE: this doesn't affect systems with hybrid graphics
Fixes LP: #1697882
| Alberto Milone (albertomilone) wrote : | # |
The latest patch is based on what upstream recommended. I have already pushed a change to the udev rule included in the NVIDIA driver in Artful, so that the Gnome shell (which doesn't run with root privileges) can check KMS when getting the sessions using libgdm.
My patch works well here.
| Iain Lane (laney) wrote : | # |
I left some comments upstream - please consider those for Ubuntu before the 17.10 release - but I think we can probably upload this now.
Thanks!

Thanks. Please could you file upstream and then add that URL into the patch as "Forwarded: <url>"?
Is there a better way than looking at a configuration file such as looking at the loaded modules somehow? Isn't that distro specific or at least fragile?