Call for testing: NVIDIA PRIME in Ubuntu 18.04 and 18.10

Ubuntu 18.04 marked the transition to a new, more granular, packaging of the NVIDIA drivers, which, unfortunately, combined with a change in logind, and with the previous migration from Lightdm to Gdm3, caused (Intel+NVIDIA) hybrid laptops to stop working the way they used to in Ubuntu 16.xx and older.

The following are the main issues experienced by our users:

  • An increase in power consumption when using the power saving profile (i.e. when the discrete GPU is off).
  • The inability to switch between power profiles on log out (thus requiring a reboot).

We have backported a commit to solve the problem with logind, and I have worked on a few changes in gpu-manager, and in the other key components, to improve the experience when using Gdm3.

NOTE: fixes for Lightdm, and for SDDM still need some work, and will be made available in the next update.

Both issues should be fixed in Ubuntu 18.10, and I have backported my work to Ubuntu 18.04, which is now available for testing.

If you run Ubuntu 18.04, own a hybrid laptop with an Intel and an NVIDIA GPU (supported by the 390 NVIDIA driver), we would love to get your feedback on the updates in Ubuntu 18.04.

If you are interested, head over to the bug report, follow the instructions at the end of the bug description, and let us know about your experience.

4 Likes

From the bug report, here are the steps for how to test on 18.04 LTS. This is not for the faint hearted, please be sure you’re happy to dig in to this low level tweaking before you start.

  1. Enable the bionic-proposed repositories

  2. Create /etc/apt/preferences.d/proposed-updates with the following content:

Package: *
Pin: release a=bionic-proposed
Pin-Priority: 400

  1. Update the list of packages:

sudo apt-get update

  1. Install the packages from -proposed using the following command:

sudo apt install nvidia-driver-390/bionic-proposed gdm3/bionic-proposed ubuntu-drivers-common/bionic-proposed nvidia-prime/bionic-proposed nvidia-settings/bionic-proposed libnvidia-gl-390/bionic-proposed libnvidia-compute-390/bionic-proposed libnvidia-decode-390/bionic-proposed libnvidia-encode-390/bionic-proposed libnvidia-ifr1-390/bionic-proposed libnvidia-fbc1-390/bionic-proposed

2 Likes

Currently, on Dell Insprion 15 7559, ubuntu live usb does not even boot properly. It boots into the graphical screen and asks whether I want to try or install. It hangs there. Previously it used to do this on Ubuntu 16.04 as well. I used to set nouveau.modeset=0 at grub (pressing e to edit) in order to boot properly. However in Ubuntu 18.04 it doesn’t even show the grub menu. I will discover how to set nouveau.modeset=0 on ubuntu 18.04 live usb and continue with installation.

I managed to boot with adding nouveau.modeset=0.

Do I install any Nvidia drivers? or should I directly start applying the steps above? Do you guys want me to remove the nouveau.modeset after nvidia driver installations? normally after installing the nvidia driver it works without nouveau.modeset=0

1 Like

Hi,

I am not really an expert, but this prime switching problem really bothers me. I could not fix it in 18.04 and so updated to 18.10 where I still face the same problem. I cannot switch to intel graphics and hence battery life is terrible on my Aero 15x with NVidia 1070 maxQ.
When I run sudo prime-select intel this is what I get:

stefan@stefan-P65Q:~$ sudo prime-select intel
[sudo] Passwort fĂŒr stefan:
Info: selecting the intel profile
Failed to disable unit: Unit file nvidia-fallback.service does not exist.
Traceback (most recent call last):
File “/usr/local/bin/prime-select”, line 334, in
switcher.enable_profile(arg)
File “/usr/local/bin/prime-select”, line 124, in enable_profile
self._trigger_prime_sock()
File “/usr/local/bin/prime-select”, line 183, in _trigger_prime_sock
sock.connect(self._prime_sock_addr)
FileNotFoundError: [Errno 2] No such file or directory

I would like to help solving this problem as I know how annoying it is. Please let me know what I can do with my limited knowledge.

Best,
Stefan

Hi Stefan,

It looks like you didn’t install nvidia-prime from the Ubuntu repository, since it’s installed in /usr/local/bin.

How did you install it?

We don’t use nouveau at all. When you install the nvidia driver, nouveau will be blacklisted.

Hi tseliot,

thank you for your reply. I followed the steps and created the proposed-updates file. I am not sure though if I should write in there bionic or cosmic proposed as I am using 18.10. I tried both and then ran the command:

sudo apt install nvidia-driver-390/bionic-proposed gdm3/bionic-proposed ubuntu-drivers-common/bionic-proposed nvidia-prime/bionic-proposed nvidia-settings/bionic-proposed libnvidia-gl-390/bionic-proposed libnvidia-compute-390/bionic-proposed libnvidia-decode-390/bionic-proposed libnvidia-encode-390/bionic-proposed libnvidia-ifr1-390/bionic-proposed libnvidia-fbc1-390/bionic-proposed

But this is what I got:

AbhÀngigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen
 Fertig
E: Veröffentlichung »bionic-proposed« fĂŒr »nvidia-driver-390« konnte nicht gefunden werden.
E: Veröffentlichung »bionic-proposed« fĂŒr »gdm3« konnte nicht gefunden werden.
E: Veröffentlichung »bionic-proposed« fĂŒr »ubuntu-drivers-common« konnte nicht gefunden werden.
E: Veröffentlichung »bionic-proposed« fĂŒr »nvidia-prime« konnte nicht gefunden werden.
E: Veröffentlichung »bionic-proposed« fĂŒr »nvidia-settings« konnte nicht gefunden werden.
E: Veröffentlichung »bionic-proposed« fĂŒr »libnvidia-gl-390« konnte nicht gefunden werden.
E: Veröffentlichung »bionic-proposed« fĂŒr »libnvidia-compute-390« konnte nicht gefunden werden.
E: Veröffentlichung »bionic-proposed« fĂŒr »libnvidia-decode-390« konnte nicht gefunden werden.
E: Veröffentlichung »bionic-proposed« fĂŒr »libnvidia-encode-390« konnte nicht gefunden werden.
E: Veröffentlichung »bionic-proposed« fĂŒr »libnvidia-ifr1-390« konnte nicht gefunden werden.
E: Veröffentlichung »bionic-proposed« fĂŒr »libnvidia-fbc1-390« konnte nicht gefunden werden.

I do not really know how to proceed from here.

To your question, I am not sure where I got nvidia-prime from. How do I check whether it is from the Ubuntu repository, and also how to change it in case it’s not from there?

Would highly appreciate any help.

Best,
Stefan

I’ve had the same experience as djefo, only on 18.04, haven’t yet updated to 18.10.

I get the same results (in English):

sudo apt install nvidia-driver-390/bionic-proposed gdm3/bionic-proposed ubuntu-drivers-common/bionic-proposed nvidia-prime/bionic-proposed nvidia-settings/bionic-proposed libnvidia-gl-390/bionic-proposed libnvidia-compute-390/bionic-proposed libnvidia-decode-390/bionic-proposed libnvidia-encode-390/bionic-proposed libnvidia-ifr1-390/bionic-proposed libnvidia-fbc1-390/bionic-proposed
Reading package lists
 Done
Building dependency tree
Reading state information
 Done
E: Release 'bionic-proposed' for 'nvidia-driver-390' was not found
E: Release 'bionic-proposed' for 'gdm3' was not found
E: Release 'bionic-proposed' for 'nvidia-settings' was not found
E: Release 'bionic-proposed' for 'libnvidia-gl-390' was not found
E: Release 'bionic-proposed' for 'libnvidia-compute-390' was not found
E: Release 'bionic-proposed' for 'libnvidia-decode-390' was not found
E: Release 'bionic-proposed' for 'libnvidia-encode-390' was not found
E: Release 'bionic-proposed' for 'libnvidia-ifr1-390' was not found
E: Release 'bionic-proposed' for 'libnvidia-fbc1-390' was not found

UPDATE 1: Selecting “Ubuntu on Wayland” temporarily fixed it! More updates after a few checks


UPDATE 2: Here’s the GRUB2 default CMDLINE:

cat /proc/cmdline 
BOOT_IMAGE=/vmlinuz-4.18.0-10-generic root=UUID=<uuid> ro quiet splash nvidia-drm.modeset=1 vt.handoff=1

Then I log in with Ubuntu on Wayland selected. That’s it!!

Note: Monitor may still use Intel graphics, but NVIDIA tools and devices are (CUDA, CuDNN, etc.) are all functional.

I’m experiencing the login loop of doom after I tried to install nvidia-driver-410 with CUDA 9.2 (with Aug 6 patch) on an Intel NUC i7 (7th gen) plugged to an eGPU via Thunderbolt3. The interesting behavior I get is that switching to lightdm does fix the login problem, but unfortunately breaks the Thunderbolt3 connectivity. But keeping gdm3 as default but using tty3 to log in maintains the eGPU connectivity and I’m able to run my deep learning experiments without a GUI.
I’m not an expert at this, but I like to stay at the bleeding edge of technology. Looking forward to a fix because gdm3 is really gorgeous :wink:. Configuration details:

  • Ubuntu 18.10 x64
  • NVIDIA GTX1080 (inside an Akitio Thunderbolt3 casing)
  • 7th gen Intel i7 with Iris graphics (default Ubuntu driver)

Hi Alberto,

just wanted to let you know that I made a new and clean install of Ubuntu 18.10 and now switching to Intel GPU works from the start.
Thank you so much for your work.

Want you guys to know that im running ubuntu mate 18.04 64 bit+ Clevo W650sj and graphic cards ppa with the latest nvidia drivers 415x!
IM SO HAPPY!

Im using linux for a long time and tried almost all distros, i was at arch but prime-select made me come back to ubuntu! Its an amazing solution, fast, clean, and the performance on games using lutris and steam proton is outstanding!

Opensuse, arch, fedora, sabayon, none of them is capable of handle nvidia optimus with proprietary drivers with such efficiency!
Thanks for your work, its a huge step forward!

IM also available to join developers team and help if you let me to ! Ive been sending canonical my CV hehe
Looking to move to london or USA. No visa required for EU.

Thanks in Advance

1 Like

Ubuntu 18.10 on a Lenovo P52 with a Nvidia Quatro 2000 here.

Out of the box the setup very much does not work at all. I have to disable Hybrid Graphics in the BIOS completely just to get the machine to start GDM. After that it is impossible to use any of the prime tooling as nothing is ever disabled and the Nvidia driver is always chosen over Intel seemingly no matter what I do. Selecting intel via ‘prime-select intel’ does nothing, changes nothing, and leaves everything in a state where nvidia is used. Rebooting starts with nvidia. Even more so nvidia-settings still reports PRIME Supported? no.

Falling back and installing the bbswitch dkms module and using the approach found in this repo (https://github.com/matthieugras/Prime-Ubuntu-18.04) got me a little further. I could run on the Intel driver, and I could see the power usage drop when the nvidia card was disabled, and I was finally able to see Prime Supported? yes with nvidia-settings however Ubuntu was never able to see any external monitor weither in intel or nvidia mode. (I would be fine if intel didn’t support them, but nvidia is kind of a show stopper)

Generally each reboot is about a 50/50 chance of GDM starting. Most times I am booting into non-graphical mode first (runlevel 3), running startx as root to get thigns started, then going to run level 5 since that seems to be the only consistent way to get the machine fully functioning on every boot.

Current state: Choose Hybrid Graphics for low power use, Choose Discrete Graphics for external monitors. But this requires a reboot and trip through BIOS settings to work.

Is there any update on the SDDM fix? Is there anything we can help with? (I am on the latest KDE Neon).

Hi all,

I’m not sure what you guys are looking for.
I’m fresh installing the 18.04.01.
My hardware : Gigabyte Aero 15x v8. It has 2 GPU : Intel and GTX 1070
Dual boot : W10 and Ubuntu 18.04.01 LTS

The 1st time I try, it always stop/freeze when I choose language.
So I did the following :

I. Installation :

  1. Go to Bios -> disable 3D enhanced
  2. Install Ubuntu as usual (installing thru Flashdisk), no swap file,
  3. reboot

II. Setting Nvidia 390

  1. Dual booting menu appear, I choose Ubuntu
  2. I’m a big fan of Gnome (since 1.0 ver) so Install Gnome 3
  3. Reboot
  4. Enter BIOS -> activate 3d enhanced -> reboot
  5. Dual booting (W10 and Ubuntu)choose Ubuntu login set to Gnome instead of Weyland
  6. I can get inside
  7. Run “software and update”
  8. Install Nvidia 390 driver
  9. Then there’s some Authentication about Secureboot UEFI, and I have to make password that will be ask during reboot

III. Switchiing between Intel and Nvidia

  1. After reboot, a MOK Management Menu pop up (blue screen text based, I think from BIOS or Ubuntu)
  2. I choose the 2nd option (there are 4 options to choose)
  3. Enter the password I created on II.8 above
  4. Select “Continue” then Grub menu -> choose Ubuntu
  5. Through terminal I write “nvidia-settings”

From there, I can set to Intel or Nvidia and the battery power change (depend on graphics card I use)

Please see the pics

1 Like

It currently works like a charm on my XPS 15 on Ubuntu 18.10 !

After more testing with GDM, I have noticed that the card wouldn’t switch.

If I would boot on nvidia and switch to intel, I am required to restart gdm thru a TTY.

Then If I switch back to nvidia, I would have a mark on the top right! Strangely it doesn’t show on the screenshot but it has it!

if I use lightdm instead, everything works great!

I have also noticed that I have better results on battery saving when adding acpi_rev_override=1 ( for my XPS 15 9560 )

The switch works great but the nvidia GPU remains on though. I have installed bbswitch and shut it down myself. the battery life is MUCH better!

After a lot of testing. It doesn’t work well the implementation of Mathieu Gras on GitHub (Prime-Ubuntu-18.04) works way better!

If I’m not wrong, he’s implementation still requires the use of lightdm, while Ubuntu uses gdm as default since 17.10. I don’t know if that approach can be used with gdm :thinking: