PRIME Synchronization doesn't work with linux-kernel 4.15.

Bug #1752739 reported by Doug McMahon
80
This bug affects 17 people
Affects Status Importance Assigned to Milestone
nvidia-graphics-drivers-390 (Ubuntu)
Fix Released
High
Alberto Milone

Bug Description

I believe this issue is pretty well known, ex. here on optimus machine
sudo cat /sys/module/nvidia_drm/parameters/modeset
[sudo] password for doug:
Y
$ xrandr --prop | grep PRIME
 PRIME Synchronization: 0 # this is the one needed to be 1
 PRIME Synchronization: 1
 PRIME Synchronization: 1

Though suppport seems to be there
$ dmesg |grep drm
[ 1.863499] [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
[ 1.863501] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 0
[ 1.873239] [drm] Memory usable by graphics device = 2048M
[ 1.873244] fb: switching to inteldrmfb from EFI VGA
[ 1.873323] [drm] Replacing VGA console driver
[ 1.879334] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 1.879334] [drm] Driver supports precise vblank timestamp query.
[ 1.908246] [drm] Initialized i915 1.6.0 20171023 for 0000:00:02.0 on minor 1
[ 1.945491] fbcon: inteldrmfb (fb0) is primary device
[ 1.945568] i915 0000:00:02.0: fb0: inteldrmfb frame buffer device

bug report in arch
https://bugs.archlinux.org/task/57305

If I install the older 384 driver then again with kernel 4.15 no prime sync but with the 4.13 kernel it works fine

Revision history for this message
Chris McDonough (chrism-plope) wrote :

I can confirm the results of xrandr and dmesg|grep drm above with the same kernel and nvidia driver versions on my system (a Thinkpad P50 with an M2000M).

An additional symptom I have is that the nvidia-settings application no longer supports PRIME at all; the PRIME Settings category in the application just doesn't appear. Here's the output when I start the application.

$ nvidia-settings
** Message: 15:46:31.025: PRIME: No offloading required. Abort
** Message: 15:46:31.026: PRIME: is it supported? no

Revision history for this message
Chris McDonough (chrism-plope) wrote :

Additonal notes because I know a similar symptom like the one I describe in #1 can be caused by multiple issues.

- my system display BIOS is in Hybrid mode, and PRIME Settings do show up in an Ubuntu 16.04 install I have on the same system.

- the selected driver is NVIDIA in Software and Updates -> Additional Drivers.

- sudo prime-select intel has the following result

  # prime-select intel
  Info: the current GL alternatives in use are: [None, None]
  Info: the current EGL alternatives in use are: [None, None]
  Error: the installed packages do not support PRIME
  Error: intel mode can't be enabled

Revision history for this message
Doug McMahon (mc3man) wrote : Re: [Bug 1752739] Re: PRIME Synchronization doesn't work with linux-kernel 4.15.

Chris, the Nvidia-prime deal is expected as prime-select isn't viable with
the switch to libglvnd. Whether a means to switch gpu's is going to be
provided I've no clue..
The loss of prime sync is a double whammy for hybrid device users,
especially in light of no apparent wayland support for such devices on the
Nvidia side.

On Mar 4, 2018 4:05 PM, "Chris McDonough" <email address hidden> wrote:

I can confirm the results of xrandr and dmesg|grep drm above with the
same kernel and nvidia driver versions on my system (a Thinkpad P50 with
an M2000M).

An additional symptom I have is that the nvidia-settings application no
longer supports PRIME at all; the PRIME Settings category in the
application just doesn't appear. Here's the output when I start the
application.

$ nvidia-settings
** Message: 15:46:31.025: PRIME: No offloading required. Abort
** Message: 15:46:31.026: PRIME: is it supported? no

--
You received this bug notification because you are subscribed to the bug
report.
https://bugs.launchpad.net/bugs/1752739

Title:
  PRIME Synchronization doesn't work with linux-kernel 4.15.

Status in nvidia-graphics-drivers-390 package in Ubuntu:
  New

Bug description:
  I believe this issue is pretty well known, ex. here on optimus machine
  sudo cat /sys/module/nvidia_drm/parameters/modeset
  [sudo] password for doug:
  Y
  $ xrandr --prop | grep PRIME
        PRIME Synchronization: 0 # this is the one needed to be 1
        PRIME Synchronization: 1
        PRIME Synchronization: 1

  Though suppport seems to be there
  $ dmesg |grep drm
  [ 1.863499] [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
  [ 1.863501] [drm] Initialized nvidia-drm 0.0.0 20160202 for
0000:01:00.0 on minor 0
  [ 1.873239] [drm] Memory usable by graphics device = 2048M
  [ 1.873244] fb: switching to inteldrmfb from EFI VGA
  [ 1.873323] [drm] Replacing VGA console driver
  [ 1.879334] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
  [ 1.879334] [drm] Driver supports precise vblank timestamp query.
  [ 1.908246] [drm] Initialized i915 1.6.0 20171023 for 0000:00:02.0 on
minor 1
  [ 1.945491] fbcon: inteldrmfb (fb0) is primary device
  [ 1.945568] i915 0000:00:02.0: fb0: inteldrmfb frame buffer device

  bug report in arch
  https://bugs.archlinux.org/task/57305

  If I install the older 384 driver then again with kernel 4.15 no prime
  sync but with the 4.13 kernel it works fine

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-390/+bug/
1752739/+subscriptions

Revision history for this message
Chris McDonough (chrism-plope) wrote :

Thanks for the confirmation, Doug! I'll read up on libglvnd to feel less clueless.

Revision history for this message
Chris McDonough (chrism-plope) wrote :

Given that even a PRIME switch requires a logout and a reboot isn't that much worse,
I think it's a reasonable workaround for initial release (not far away, and reading about the current state of affairs, probably too imminent to get PRIME working again) to require that folks switch drivers to intel via package management instead of PRIME. The bare minimim would be to fix this minor bug:

https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-390/+bug/1753333

This of course doesn't help the Wayland issue you mentioned.

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

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

Changed in nvidia-graphics-drivers-390 (Ubuntu):
status: New → Confirmed
Revision history for this message
Alberto Milone (albertomilone) wrote :

prime-select is not supposed to work yet, and I am working on it. It is a separate problem.

As for the main problem, I am going to fix it by patching the nvidia driver for Linux 4.15.

Changed in nvidia-graphics-drivers-390 (Ubuntu):
status: Confirmed → In Progress
importance: Undecided → High
assignee: nobody → Alberto Milone (albertomilone)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nvidia-graphics-drivers-390 - 390.42-0ubuntu1

---------------
nvidia-graphics-drivers-390 (390.42-0ubuntu1) bionic; urgency=medium

  * New upstream release:
    - Fixed a regression, introduced in 390.12, that caused occasional
      flicker when using the X driver's composition pipeline, for
      example when using screen transformations like rotation, or the
      "ForceCompositionPipeline" or "ForceFullCompositionPipeline"
      options."

  [ Alberto Milone ]
  * debian/dkms_nvidia/patches/buildfix_kernel_4.15.patch,
    debian/templates/nvidia-dkms-flavour.install.in:
    - Fix support for Linux 4.15 (LP: #1752739).
  * debian/templates/nvidia-kernel-source-flavour.install.in:
    - Slim down the file, avoiding to list every single file.
  * debian/templates/control.in:
    - Allow nvidia-dkms-390 to replace nvidia-384 (LP: #1753073).
  * debian/rules,
    debian/templates/nvidia-compute-utils-flavour.install.in,
    debian/templates/nvidia-compute-utils-flavour.nvidia-persistenced.service.in,
    debian/templates/nvidia-dkms-flavour.install.in,
    debian/templates/nvidia-dkms-flavour.nvidia-fallback.service.in:
    - Make sure to enable both systemd services, and let dh_systemd
      do all the work.
    - Install nvidia-fallback.service. This loads nouveau if nvidia
      fails to load.
    - Remove any references to ld.so.conf.

  [ Rico Tzschichholz ]
  * debian/rules.defs:
    - Use the no-compat32 binary for amd64.

 -- Alberto Milone <email address hidden> Wed, 14 Mar 2018 17:10:44 +0100

Changed in nvidia-graphics-drivers-390 (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Doug McMahon (mc3man) wrote :

Well at least here on nvidia-755m if nvidia_drm modeset is enabled gdm3 fails to boot.
However lightdm works fine & prime sync is enabled..

$ sudo cat /sys/module/nvidia_drm/parameters/modeset
[sudo] password for doug:
Y
doug@doug-Lenovo-IdeaPad-Y510P:~$ xrandr --verbose
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 16384 x 16384
eDP-1-1 connected primary 1920x1080+0+0 (0x46) normal (normal left inverted right x axis y axis) 345mm x 194mm
 Identifier: 0x42
 Timestamp: 11726
 Subpixel: unknown
 Gamma: 1.0:1.0:1.0
 Brightness: 1.0
 Clones:
 CRTC: 0
 CRTCs: 0 1 2
 Transform: 1.000000 0.000000 0.000000
             0.000000 1.000000 0.000000
             0.000000 0.000000 1.000000
            filter:
 EDID:
  00ffffffffffff0030e4d90200000000
  00150103802313780a15d59e59509826
  0e505400000001010101010101010101
  0101010101017e3680b070381f403020
  350059c2100000190000000000000000
  00000000000000000000000000fe004c
  4720446973706c61790a2020000000fe
  004c503135365746312d544c4232004b
 PRIME Synchronization: 1
  supported: 0, 1

Revision history for this message
Doug McMahon (mc3man) wrote :

If others see then a new bug, meanwhile kernel log of fail on gdm3

Revision history for this message
Kirill Romanov (djaler1) wrote :

Still doesn't work for me.

Revision history for this message
Kirill Romanov (djaler1) wrote :

>sudo prime-select intel

Info: the current GL alternatives in use are: [None, None]
Info: the current EGL alternatives in use are: [None, None]
Error: the installed packages do not support PRIME
Error: intel mode can't be enabled

Revision history for this message
Doug McMahon (mc3man) wrote :

On 03/15/2018 04:24 PM, Kirill Romanov wrote:
> Still doesn't work for me.
>
Bug reports are poor place for troubleshooting, particularly when bug is
fix released.
If inclined post in this thread at UF, provide
1. how are you trying to enable
2. your gpu info , inxi -G will suffice

post 32 shows kernel option, post 37 show using modprobe.d method, if
you have a GeForce mobile nvidia card  you may need lightdm .
https://ubuntuforums.org/showthread.php?t=2385770&p=13748601&viewfull=1#post13748601

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

@Kirill: I haven't fixed prime-select yet. When I do, you will be able to power off the discrete GPU.

@Doug: can you attach the output of journalctl after reproducing the problem, please?

Revision history for this message
Doug McMahon (mc3man) wrote :

Fresh install couple of days old image
Update, reboot
Install the 390 driver
Reboot with kernel option nvidia-drm.modeset=1
Note: boot hangs at Ubuntu splash, nothing can be done, no tty's available. Only press power button to initiate shutdown works

Revision history for this message
Doug McMahon (mc3man) wrote :

whether of any value - it's been reported to me that with a Quadro M1000M gdm works fine
(- and user is presented with a wayland session option that uses intel
I don't see the wayland after nvidia driver is installed
Card-1: Intel 4th Gen Core Processor Integrated Graphics Controller
Card-2: NVIDIA GK107M [GeForce GT 755M]

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

I don't see any complaints from X11 in the log, but I do see Gnome shell crashing.

Revision history for this message
Doug McMahon (mc3man) wrote :

On 03/16/2018 06:21 AM, Alberto Milone wrote:
> I don't see any complaints from X11 in the log, but I do see Gnome shell
> crashing.
>
So on a hunch I set it to autologin, then it works fine.
It's possible the user reporting no issues with the quandro card had
autologin, will try to confirm

Revision history for this message
Doug McMahon (mc3man) wrote :

And obviously if a log out is attempted then that hangs.
Can try on a different Intel/nvidia combo I have

Revision history for this message
Francois Thirioux (fthx) wrote :

No I do not have autologin.

As I wrote in ubuntuforums :
- added "nvidia-drm.modeset=1" in grub boot options
- got a Wayland session which runs Intel GPU (but Nvidia GPU is not powered off)
- got a X session which runs Nvidia GPU M1000M (with sync)

Revision history for this message
Rocko (rockorequin) wrote :

@Doug re comment #10, I see exactly the same divide by zero error in the syslog and gdm fails to boot when I prime-select nvidia. I'm using a GP107M [GeForce GTX 1050 Mobile] card.

Revision history for this message
Roman Dinga (roman-dinga) wrote :

For me even the new prime-select with a reboot doesn't work. It keeps saying that Intel profile is selected, but keeps using Nvidia card. When I try to switch to Nvidia, it throws a bunch of errors about file blacklist.nvidia missing in /etc/modprobe.d. Anyway, I hope this Nvidia mumbo-jumbo is restored back to sanity and Bumblebee can be used again...

Revision history for this message
Rocko (rockorequin) wrote :

@Roman: I got the same error about blacklist.nvidia missing when running prime-select nvidia until I did an apt --purge remove nvidia-prime and then apt install nvidia-prime. I think the package must have accidentally left old code in place when it upgraded.

After that, I was able to change to use nvidia, but gdm still booted into intel because nouveau and nvidia were both being loaded. I added a conf file in /etc/modprobe.d containing "alias nouveau off" to fix that.

After that, gdm still fails to boot into nvidia (I get the same divide by zero error as Doug does, see the log in comment #10). lightdm doesn't crash but I only get a black screen so I can't log in to it.

Revision history for this message
Doug McMahon (mc3man) wrote :

see here concerning the nvidia-prime window..
https://bugs.launchpad.net/ubuntu/+source/nvidia-prime/+bug/1758214

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

prime sync is still not working for me. It goes not enable and can not be enabled
I have a quadro 1000m on a thinkpad w520. Attached is the output from nvidia-bug-report.sh

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

PS prime sync enabling is via modprobe.d file, the method I have always used. I actually have the latest build from the ppa, so technically the bug should be report there but it also existed yesterday when the version of the driver was the same as currently in bionic.

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

I add to my report that it is also still broken on my Thinkpad P50, with the 390.48 driver (I just updated everything).
This bug needs to be reopened.

Revision history for this message
Doug McMahon (mc3man) wrote :

@tim
not sure if the ppa 390 driver was patched
Works fine here either thru a conf using -
  options nvidia_drm modeset=1
or a grub option of -
  nvidia-drm.modeset=1
Note you don't specify driver version

Additionally here only works with lightdm

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

I didn't note the lack of a driver version. Thanks, I will check that.

On Thu, 19 Apr. 2018, 22:26 Doug McMahon, <email address hidden>
wrote:

> @tim
> not sure if the ppa 390 driver was patched
> Works fine here either thru a conf using -
> options nvidia_drm modeset=1
> or a grub option of -
> nvidia-drm.modeset=1
> Note you don't specify driver version
>
> Additionally here only works with lightdm
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1752739
>
> Title:
> PRIME Synchronization doesn't work with linux-kernel 4.15.
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-390/+bug/1752739/+subscriptions
>

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

Thanks Doug. On the W520, prime sync does work if you change the config.
This was an upgraded system so it had the old style config (in /etc/modprobe.d) and I missed the change.
gdm3 works for me too on this one, although no external monitor attempted (but nvidia output to the laptop panel is definitely happening).

Revision history for this message
Zingam (registrirayme) wrote :

I have a Dell 7567 laptop with NVIDIA and Intel GPUs and a very bad screen tearing on Ubuntu 2004 and nothing seems to be able to fix it. Could something be done about that?
At least with the proprietary drivers I have multiple windows support (mostly 99% of the time works).

Revision history for this message
Zingam (registrirayme) wrote :

$ xrandr --prop | grep "PRIME Synchronization"
 PRIME Synchronization: 0
 PRIME Synchronization: 1

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.