9

Like the title says I can't figure out a way to force my laptop to use PRIME Synchronization and from what I understand, it may very well be the reason I get quite a lot of screen tearing when watching videos.

I've tried pretty much everything I could find that was reasonably recent and nothing works.

I've made sure that the drm file was configured properly:

(base) alex@alex:/etc/modprobe.d$ cat nvidia-drm.conf 
options nvidia-drm modeset=1

I tried to force it with xrandr --output eDP-1-1 --set "PRIME Synchronization" 1but it stays at 0.

I made sure to do the following command and reboot:

(base) alex@alex:/etc/modprobe.d$ sudo update-initramfs -u
[sudo] password for alex: 
update-initramfs: Generating /boot/initrd.img-5.3.0-24-generic
I: The initramfs will attempt to resume from /dev/nvme0n1p4
I: (UUID=4ef37681-250c-4d75-954b-c8cf78fd5e65)
I: Set the RESUME variable to override this.

*when I tried the same thing but by creating a zz-nvidia-modesetconf file like I read on some posts the update-initramfs command generated a lot of errors.

After all that I still get the following result:

(base) alex@alex:/etc/modprobe.d$ sudo cat /sys/module/nvidia_drm/parameters/modeset
N

I have a Dell xps 9570 with the GTX 1050 ti card and I'm running Ubuntu 19.10.

Here are a few more outputs to help (my monitor is eDP-1-1):

base) alex@alex:/etc/modprobe.d$ xrandr --prop
Screen 0: minimum 8 x 8, current 2560 x 1440, maximum 32767 x 32767
eDP-1-1 connected primary 2560x1440+0+0 (normal left inverted right x axis y axis) 344mm x 194mm
    _MUTTER_PRESENTATION_OUTPUT: 0 
    EDID: 
        00ffffffffffff004d108d1400000000
        051c0104a52213780eef4fa95334bc25
        0d515400000001010101010101010101
        0101010101014dd000a0f0703e803020
        350058c2100000180000000000000000
        00000000000000000000000000fe0046
        4e564452804c51313536443100000000
        0002410328011200000b010a2020004c
    PRIME Synchronization: 0 
        supported: 0, 1
    scaling mode: Full aspect 
        supported: Full, Center, Full aspect
    max bpc: 12 
        range: (6, 12)
    Broadcast RGB: Automatic 
        supported: Automatic, Full, Limited 16:235
    link-status: Good 
        supported: Good, Bad
    CONNECTOR_ID: 86 
        supported: 86
    non-desktop: 0 
        range: (0, 1)
   3840x2160     60.00 +  59.98    59.97  
   3200x1800     59.96    59.94  
   2880x1620     59.96    59.97  
   2560x1600     59.99    59.97  
   2560x1440     59.99    59.99*   59.96    59.95  
   2048x1536     60.00  
   1920x1440     60.00  
   1856x1392     60.01  
   1792x1344     60.01  
   2048x1152     59.99    59.98    59.90    59.91  
   1920x1200     59.88    59.95  
   1920x1080     60.01    59.97    59.96    59.93  
   1600x1200     60.00  
   1680x1050     59.95    59.88  
   1600x1024     60.17  
   1400x1050     59.98  
   1600x900      59.99    59.94    59.95    59.82  
   1280x1024     60.02  
   1440x900      59.89  
   1400x900      59.96    59.88  
   1280x960      60.00  
   1440x810      60.00    59.97  
   1368x768      59.88    59.85  
   1360x768      59.80    59.96  
   1280x800      59.99    59.97    59.81    59.91  
   1152x864      60.00  
   1280x720      60.00    59.99    59.86    59.74  
   1024x768      60.04    60.00  
   960x720       60.00  
   928x696       60.05  
   896x672       60.01  
   1024x576      59.95    59.96    59.90    59.82  
   960x600       59.93    60.00  
   960x540       59.96    59.99    59.63    59.82  
   800x600       60.00    60.32    56.25  
   840x525       60.01    59.88  
   864x486       59.92    59.57  
   800x512       60.17  
   700x525       59.98  
   800x450       59.95    59.82  
   640x512       60.02  
   720x450       59.89  
   700x450       59.96    59.88  
   640x480       60.00    59.94  
   720x405       59.51    58.99  
   684x384       59.88    59.85  
   680x384       59.80    59.96  
   640x400       59.88    59.98  
   576x432       60.06  
   640x360       59.86    59.83    59.84    59.32  
   512x384       60.00  
   512x288       60.00    59.92  
   480x270       59.63    59.82  
   400x300       60.32    56.34  
   432x243       59.92    59.57  
   320x240       60.05  
   360x202       59.51    59.13  
   320x180       59.84    59.32  
DP-1-1 disconnected (normal left inverted right x axis y axis)
    PRIME Synchronization: 1 
        supported: 0, 1
    Content Protection: Undesired 
        supported: Undesired, Desired, Enabled
    max bpc: 12 
        range: (6, 12)
    Broadcast RGB: Automatic 
        supported: Automatic, Full, Limited 16:235
    audio: auto 
        supported: force-dvi, off, auto, on
    link-status: Good 
        supported: Good, Bad
    CONNECTOR_ID: 92 
        supported: 92
    non-desktop: 0 
        range: (0, 1)
DP-1-2 disconnected (normal left inverted right x axis y axis)
    PRIME Synchronization: 1 
        supported: 0, 1
    Content Protection: Undesired 
        supported: Undesired, Desired, Enabled
    max bpc: 12 
        range: (6, 12)
    Broadcast RGB: Automatic 
        supported: Automatic, Full, Limited 16:235
    audio: auto 
        supported: force-dvi, off, auto, on
    link-status: Good 
        supported: Good, Bad
    CONNECTOR_ID: 100 
        supported: 100
    non-desktop: 0 
        range: (0, 1)
DP-1-3 disconnected (normal left inverted right x axis y axis)
    PRIME Synchronization: 1 
        supported: 0, 1
    Content Protection: Undesired 
        supported: Undesired, Desired, Enabled
    max bpc: 12 
        range: (6, 12)
    Broadcast RGB: Automatic 
        supported: Automatic, Full, Limited 16:235
    audio: auto 
        supported: force-dvi, off, auto, on
    link-status: Good 
        supported: Good, Bad
    CONNECTOR_ID: 106 
        supported: 106
    non-desktop: 0 
        range: (0, 1)


(base) alex@alex:/etc/modprobe.d$ dmesg | grep drm
[    0.000000] Command line: BOOT_IMAGE=/vmlinuz-5.3.0-24-generic root=UUID=3aed6bfe-476b-4f03-a33a-8265acaf1a5a ro quiet splash acpi_rev_override=1 acpi_osi=Linux nouveau.modeset=0 pcie_aspm=force drm.vblankoffdelay=1 scsi_mod.use_blk_mq=1 nouveau.runpm=0 mem_sleep_default=deep pti=off spectre_v2=off l1tf=off nospec_store_bypass_disable no_stf_barrier vt.handoff=7
[    0.131737] Kernel command line: BOOT_IMAGE=/vmlinuz-5.3.0-24-generic root=UUID=3aed6bfe-476b-4f03-a33a-8265acaf1a5a ro quiet splash acpi_rev_override=1 acpi_osi=Linux nouveau.modeset=0 pcie_aspm=force drm.vblankoffdelay=1 scsi_mod.use_blk_mq=1 nouveau.runpm=0 mem_sleep_default=deep pti=off spectre_v2=off l1tf=off nospec_store_bypass_disable no_stf_barrier vt.handoff=7
[    3.004066] [drm] Incompatible option detected: enable_guc=3, GuC submission not supported!
[    3.004066] [drm] Switching to non-GuC submission mode!
[    3.004671] fb0: switching to inteldrmfb from EFI VGA
[    3.016968] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[    3.016969] [drm] Driver supports precise vblank timestamp query.
[    3.024951] [drm] Finished loading DMC firmware i915/kbl_dmc_ver1_04.bin (v1.4)
[    3.096695] [drm] HuC: Loaded firmware i915/kbl_huc_ver02_00_1810.bin (version 2.0)
[    3.107310] [drm] GuC: Loaded firmware i915/kbl_guc_32.0.3.bin (version 32.0)
[    3.107444] [drm] CT: enabled
[    3.137213] [drm] Initialized i915 1.6.0 20190619 for 0000:00:02.0 on minor 0
[    3.376284] [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
[    3.376286] [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 1
[    3.413727] fbcon: i915drmfb (fb0) is primary device
[    3.413802] i915 0000:00:02.0: fb0: i915drmfb frame buffer device


(base) alex@alex:/etc/modprobe.d$ nvidia-smi
Sat Dec  7 13:10:10 2019       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 435.21       Driver Version: 435.21       CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GTX 105...  Off  | 00000000:01:00.0 Off |                  N/A |
| N/A   44C    P8    N/A /  N/A |    600MiB /  4042MiB |     31%      Default |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|=============================================================================|
|    0      1520      G   /usr/lib/xorg/Xorg                            72MiB |
|    0      2495      G   /usr/lib/xorg/Xorg                           137MiB |
|    0      2768      G   /usr/bin/gnome-shell                         207MiB |
|    0      3410      G   ...quest-channel-token=2905873432716077065   133MiB |
+-----------------------------------------------------------------------------+

Any ideas is very much appreaciated, thanks!

Alex
  • 171
  • 2
  • 6
  • 1
    For starters if using a .conf file vs. a kernel boot option the option is written options nvidia_drm modeset=1 So try editing yours.. (I've always used the zz-nvidia-modeset.conf name so read last..) As far as the "update-initramfs .." messages, is that a swap partition? sudo blkid should show or try cat /proc/swaps – doug Dec 08 '19 at 03:07
  • So I have all these files created and corrected the one where I had a typo and still not working: – Alex Dec 08 '19 at 19:01
  • (base) alex@alex:/etc/modprobe.d$ cat nvidia-drm-nomodeset.conf options nvidia-drm modeset=1 (base) alex@alex:/etc/modprobe.d$ cat nvidia-drm.conf options nvidia_drm modeset=1 (base) alex@alex:/etc/modprobe.d$ cat zz-nvidia-modeset.conf options nvidia_drm modeset=1 (base) alex@alex:/etc/modprobe.d$ xrandr --output eDP-1-1 --set "PRIME Synchronization" 1 (base) alex@alex:/etc/modprobe.d$ sudo cat /sys/module/nvidia_drm/parameters/modeset N – Alex Dec 08 '19 at 19:07
  • 5
    that xrandr --set is useless. Try removing all the files you've created & run sudo update-initramfs -u Then run sudo nano /etc/default/grub & add this to the end of the GRUB_CMDLINE_LINUX_DEFAULT=" " line (keep inside quotes). nvidia-drm.modeset=1 Then run sudo update-grub and reboot. If you want to 1st. test then instead of editing file do from the grub menu on bootup. See https://wiki.ubuntu.com/Kernel/KernelBootParameters – doug Dec 09 '19 at 15:47
  • 1
    woohoo! @doug's comment fixed it for me. Please post as answer so I can upvote it! – foobarbecue Apr 22 '20 at 15:01

1 Answers1

7

This answer is provided by @doug in the comments on the question above.

I tested this solution on a Dell XPS 9570 with a GTX 1050 Ti running Ubuntu 18.04 and it worked.

  • sudo update-initramfs -u
  • Modify /etc/default/grub by running sudo nano /etc/default/grub
    • Change the GRUB_CMDLINE_LINUX_DEFAULT= line to include the setting nvidia-drm.modeset=1
    • If the line was GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" then you would change it to GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvidia-drm.modeset=1"
  • sudo update-grub
  • Reboot

If you want to try this first before modifying grub, you can edit the boot options from the grub menu when you boot the machine.

gene_wood
  • 481
  • 2
    I've tried this in Ubuntu 20.04 and it worked perfectly. You can check that synchronization is active by running xrandr --properties | grep PRIME and if there are only 1's and no zeros then you should have no more screen tearing issues. – Rodrigo Oliveira Oct 24 '20 at 22:33
  • also worked on 21.04 and don't forget to use 5.8.18 kernel on the XPS 9570 to get the sound and microphone working too :) – Goblinhack Jun 06 '21 at 08:14