PRIME synchronization not working with xserver-1.19.x in Ubuntu

Bug #1674304 reported by Doug McMahon
44
This bug affects 9 people
Affects Status Importance Assigned to Milestone
lightdm (Ubuntu)
Fix Released
Undecided
Unassigned
nvidia-prime (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

xserver-1.19.x is being proposed for 17.04, currently available in test ppa
https://launchpad.net/~canonical-x/+archive/ubuntu/x-staging
FFe - https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/1671799

On 2 separate Optimus laptops there is no sign of it actually working, tearing while using nvidia drivers (375.x) is rampart.
Testing with both current 4.10.0-13 & previous 4.9.0-11 kernels.

Shows this in kern.log so support is enabled

Mar 19 08:18:47 doug-Lenovo-IdeaPad-Y510P kernel: [ 1.746443] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
Mar 19 08:18:47 doug-Lenovo-IdeaPad-Y510P kernel: [ 1.746444] [drm] Driver supports precise vblank timestamp

But in Xorg.0.log -
randr: falling back to unsynchronized pixmap sharing

ProblemType: Bug
DistroRelease: Ubuntu 17.04
Package: nvidia-prime 0.8.4
ProcVersionSignature: Ubuntu 4.10.0-13.15-generic 4.10.1
Uname: Linux 4.10.0-13-generic x86_64
NonfreeKernelModules: nvidia_uvm nvidia_drm nvidia_modeset nvidia
ApportVersion: 2.20.4-0ubuntu2
Architecture: amd64
CurrentDesktop: Unity:Unity7
Date: Mon Mar 20 07:53:12 2017
InstallationDate: Installed on 2017-03-15 (4 days ago)
InstallationMedia: Ubuntu 17.04 "Zesty Zapus" - Alpha amd64 (20170311)
SourcePackage: nvidia-prime
UpgradeStatus: No upgrade log present (probably fresh install)

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

$ inxi -G
Graphics: Card-1: Intel 4th Gen Core Processor Integrated Graphics Controller
           Card-2: NVIDIA GK107M [GeForce GT 755M]
           Display Server: X.Org 1.19.3 drivers: modesetting,nvidia
           Resolution: 1920x1080@59.91hz
           GLX Renderer: GeForce GT 755M/PCIe/SSE2
           GLX Version: 4.5.0 NVIDIA 375.39

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
Mario Kleiner (mario-kleiner) wrote :

Is the nvidia-drm module loaded and its drm modesetting enabled?

E.g., via kernel cmdline option nvidia_drm.modeset=1
cat /sys/module/nvidia_drm/parameters/modeset should be 1 or "Y"

I think that isn't needed for PRIME outputs, but it is needed for the new PRIME sync to work, so maybe not yet part of the nvidia-prime package/setup.

Downside is that multi-gpu SLI wouldn't work anymore, but then i assume there aren't any Optimus laptops with two discrete NVidia gpu's, so that's a non-issue.

Revision history for this message
Doug McMahon (mc3man) wrote : Re: [Bug 1674304] Re: PRIME synchronization not working with xserver-1.19.x

On 03/27/2017 02:03 PM, Mario Kleiner wrote:
> Is the nvidia-drm module loaded and its drm modesetting enabled?
>
> E.g., via kernel cmdline option nvidia_drm.modeset=1
> cat /sys/module/nvidia_drm/parameters/modeset should be 1 or "Y"
>
> I think that isn't needed for PRIME outputs, but it is needed for the
> new PRIME sync to work, so maybe not yet part of the nvidia-prime
> package/setup.
>
> Downside is that multi-gpu SLI wouldn't work anymore, but then i assume
> there aren't any Optimus laptops with two discrete NVidia gpu's, so
> that's a non-issue.
>
No the module is not loaded. Using the kernel option does nothing
either, the cat command continues to return N

Revision history for this message
Doug McMahon (mc3man) wrote : Re: PRIME synchronization not working with xserver-1.19.x
Revision history for this message
Mario Kleiner (mario-kleiner) wrote :

I can't see anything obviously wrong with your kernel output. It seems as if the nvidia_modeset driver has loaded. I assume xrandr --verbose output also reports PRIME sync: 0?

However, the NVidia forum has some reports by people with similar problems, hinting at a potential incompatibility of the 375.39 NVidia driver with at Linux 4.10 from the Ubuntu 17.04 beta. Maybe try with a 4.8 kernel?

See

https://devtalk.nvidia.com/default/topic/957814/linux/prime-and-prime-synchronization/10

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

Tested with both nvidia-375 & nvidia-378 (deb packages) & various kernels (ubuntu packaged
17.04 - same deal with 4.9.x & 4.10.x
16.04 - same deal with 4.8.x, 4.9.x & 4.10.x

In all cases see a single line in Xorg.0.log -
randr: falling back to unsynchronized pixmap sharing

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

I have a ThinkPad P50 and Prime sync is now working for me. I don't know what change happened, sorry; it was two weeks since I did an update, and it could be an updated kernel or updated xserver packages from Timo's PPA. I have the 375 driver. And it works really well, it's marvellous to behold no tearing on the laptop panel.

Doug McMahon (mc3man)
description: updated
Revision history for this message
Rogério Vinhal Nunes (rogeriovn) wrote :

So, I just upgraded to 17.04 with Xorg 1.19.3 and nvidia 375.xx drivers. By default, Ubuntu installed a modprobe.d file to set drm modeset = 0 for the nvidia kernel module and that seem to prevent Prime Synchronization from working.

I tried to change the modeset to 1 so I could finally try the synchronization configuration, but that froze the system hard as long as lightdm booted. I installed gnome with gdm3 and I could get to gdm3 and try to login to gnome with no avail. But after a few tries (without changing anything) it just logged in, but prime synchronization was off for both the laptop screen as my TV. I did the "modprobe -v nvidia-drm" to check the modeset and it was 1, but whenever I tried to set the Prime Synchronization via xrandr, the screen went black for a sec and came back, but xrandr --verbose still displayed Prime Synchronization off.

Why is that cat /etc/modprobe.d/nvidia-graphics-drivers.conf with the "options nvidia_375_drm modeset=0"? Why does changing it to 1 freeze the whole system thereafter?

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

Checking in 17.10 PRIME Synchronization can be enabled & works in UbuntuGnome but doesn't in Ubuntu. Main reason is in UbuntuGnome nvidia_drm.modeset can be enabled, in Ubuntu it can't.

ex.'s
UbuntuGnome, gdm3
$ sudo cat /sys/module/nvidia_drm/parameters/modeset
[sudo] password for doug:
Y
$ 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: 21140
 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:
 _MUTTER_PRESENTATION_OUTPUT: 0
 EDID:
  00ffffffffffff0030e4d90200000000
  00150103802313780a15d59e59509826
  0e505400000001010101010101010101
  0101010101017e3680b070381f403020
  350059c2100000190000000000000000
  00000000000000000000000000fe004c
  4720446973706c61790a2020000000fe
  004c503135365746312d544c4232004b
 PRIME Synchronization: 1
  supported: 0, 1

Same machine in Ubuntu
sudo cat /sys/module/nvidia_drm/parameters/modeset
[sudo] password for doug:
N
$ 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: 12578
 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: 0
  supported: 0, 1

So until shown otherwise am adding lightdm

summary: - PRIME synchronization not working with xserver-1.19.x
+ PRIME synchronization not working with xserver-1.19.x in Ubuntu
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in lightdm (Ubuntu):
status: New → Confirmed
Revision history for this message
Doug McMahon (mc3man) wrote :

Is now working but users need to set up themselves, instructions here
https://ubuntuforums.org/showthread.php?t=2365449&p=13663158&viewfull=1#post13663158

Changed in lightdm (Ubuntu):
status: Confirmed → Fix Released
Changed in nvidia-prime (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Tommy Nevtelen (dal) wrote :

What do you mean when you say it's working? On 17.10 the display just freezes when I load the nvidia driver 378 or 384 with modeset=1.

Revision history for this message
Doug McMahon (mc3man) wrote : Re: [Bug 1674304] Re: PRIME synchronization not working with xserver-1.19.x in Ubuntu

On 07/19/2017 01:22 PM, Tommy Nevtelen wrote:
> What do you mean when you say it's working? On 17.10 the display just
> freezes when I load the nvidia driver 378 or 384 with modeset=1.
>
Did you do as I laid out in link above? Works just fine here in 17.10 &
16.04.3 (from -proposed

Revision history for this message
Tommy Nevtelen (dal) wrote :

I even tried to manually load the module with modeset=1, yes.
Will have to try again, maybe there has been a change since I last tried that fixes it. But I'm sceptical.

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.