nvidia-prime needs a reboot to switch between dGPU/hGPU

Bug #1765556 reported by Aurélien PIERRE
36
This bug affects 7 people
Affects Status Importance Assigned to Milestone
nvidia-prime (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I previously used Ubuntu 16.04 and Nvidia 375 driver with a Nvidia Geforce 635M and Sandy Bridge i7. To switch between the 2 Optimus cards (Intel hybrid and Nvidia discrete), one had to go into nvidia-settings, switch, logoff, login back, and the change was applied.

I now have a Nvidia Quadro M2000 and a Skylake Xeon which has some Sync/Mux feature (whatever does that mean) with the Nvidia 390 driver. First of all, installing nivida-prime doesn't install bbswitch-dkms. Then, once the GPU switch is made, it triggers update-initramfs, recompile the kernel modules, and one needs to reboot the system to get the GPU change. Even when we install bbswitch-dkms.

So am I getting a wrong impression or is there something twisted here ?

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: nvidia-prime 0.8.7
ProcVersionSignature: Ubuntu 4.15.0-15.16-generic 4.15.15
Uname: Linux 4.15.0-15-generic x86_64
ApportVersion: 2.20.9-0ubuntu4
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Thu Apr 19 19:20:01 2018
Dependencies:

InstallationDate: Installed on 2018-04-08 (11 days ago)
InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Alpha amd64 (20180408)
PackageArchitecture: all
SourcePackage: nvidia-prime
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Aurélien PIERRE (aurelienpierre) wrote :
Revision history for this message
Jean-Francois Labonte (grimsleepless12) wrote :

Yes, same thing wit the latest version of Ubuntu 18.04 installed (Fresh install)

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

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

Changed in nvidia-prime (Ubuntu):
status: New → Confirmed
Revision history for this message
RamKiran Kesana (ramkiran-kesana-1995) wrote :

ubuntu 18.04 and nvidia 340.106 ,nvidia-prime 0.8.8 .

Revision history for this message
Piotr Komur (pkomur) wrote :

The same on Ubuntu 18.04 and nvidia 340.106, nvidia-prime 0.8.8, kernel Linux 4.15.0-20, GeForce GT 540M

Revision history for this message
Tim Richardson (tim-richardson) wrote :

You should read the changelog.

nvidia-prime doesn't use bbswitch anymore, I don't know why. The changelog doesn't say.

It now uses the built-in kernel mechanism for turning off the nvidia card. Unfortunately, this method requires the nouveau driver and unfortunately you can't load the nouveau driver and the nvidia driver at the same time. Also, unfortunately the nvidia driver can't be unloaded without a reboot, due to a bug in logind, or at least without restarting logind.
Somehow, this also means that the nvidia driver needs to be actually uninstalled, which means rebuilding initramfs to uninstall nvidia. And going back to nvidia (hybrid mode) now requires the nvidia driver to be reinstalled. It's a far cry from the old way.

It's a bit of puzzle because bbswitch still works in the latest kernel and with the latest nvidia. But prime select is pretty complex, I haven't found another distribution where it has been ported, so there are probably good reasons for this. The dev says this approach is needed to work around gdm3 bugs, which I find ironic since I have never got gdm3 working with my nvidia laptops anyway (I use modeset=1 with the nvidia driver).

Revision history for this message
gallopelado (gallo-pelado) wrote :

También tengo el mismo problema que detalla el señor.

Revision history for this message
fargoth (cantfind) wrote :

This also affects me on 17.10.

would changing to 16.04 restore the expected behavior? I could wait 2 years for the next LTS, hopefully this issue would get solved by then. And until then I'd be able to switch without restarts.

I wonder when, if ever, we'd get to not needing to logout\login to switch between the GPUs (like it currently is under Windows and MacOS).

Revision history for this message
fargoth (cantfind) wrote :

Update regarding 17.10 - After switching from GDM to lightDM, logout and login are enough, no reboot required. With GDM, logout and sudo systemctl restart display-manager was also enough and didn't require a full reboot.

This is for nvidia-prime 0.8.5, kernel 4.13.0-41-generic and 390.59-0ubuntu0~gpu17.10.1 - but for 0.8.8 on Bionic Beaver (also 390 drivers) a reboot was required even with lightDM instead of GDM, and restarting the display-manager wasn't enough as well..

So I'd say it's a regression in 0.8.8, wouldn't 0.8.5 work with the latest drivers and kernels? It could be a workaround for now to revert back to 0.8.5 for Bionic Beaver.

Revision history for this message
fargoth (cantfind) wrote :

The prime-select replacement in https://github.com/matthieugras/Prime-Ubuntu-18.04 works without requiring a restart (simply kills and starts again the display manager).

Revision history for this message
hoan (hoan) wrote :

I confirm fargoth #10 about TimRichardson MatthieuGras prime-select with bbswitch

You find below a link to live-iso-xubuntu demo for this

https://sourceforge.net/projects/toysbox/files/bionic-nvidia/

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.