Screen tearing with Mint 19 cinnamon and GTX960M

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
Turboszczel

Screen tearing with Mint 19 cinnamon and GTX960M

Post by Turboszczel »

I encountered popular problem with cinnamon and NVIDIA: screen tearing in videos and games.

output of inxi -Fxz

Code: Select all

System:    Host: laptopDELL Kernel: 4.15.0-20-generic x86_64
           bits: 64 gcc: 7.3.0
           Desktop: Cinnamon 3.8.8 (Gtk 3.22.30-1ubuntu1)
           Distro: Linux Mint 19 Tara
Machine:   Device: laptop System: Dell product: Inspiron 7566 serial: N/A
           Mobo: Dell model: 042NDD v: A00 serial: N/A
           UEFI [Legacy]: Dell v: 1.0.3 date: 10/26/2016
Battery    BAT0: charge: 74.0 Wh 120.2% condition: 61.5/74.0 Wh (83%)
           model: Samsung SDI DELL 0GFJ66A status: Full
CPU:       Quad core Intel Core i7-6700HQ (-MT-MCP-) 
           arch: Skylake-S rev.3 cache: 6144 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 20736
           clock speeds: max: 3500 MHz 1: 900 MHz 2: 900 MHz 3: 900 MHz
           4: 900 MHz 5: 900 MHz 6: 900 MHz 7: 900 MHz 8: 900 MHz
Graphics:  Card-1: Intel HD Graphics 530 bus-ID: 00:02.0
           Card-2: NVIDIA GM107M [GeForce GTX 960M] bus-ID: 01:00.0
           Display Server: x11 (X.Org 1.19.6 )
           drivers: modesetting,nvidia (unloaded: fbdev,vesa,nouveau)
           Resolution: 1920x1080@60.00hz
           OpenGL: renderer: GeForce GTX 960M/PCIe/SSE2
           version: 4.6.0 NVIDIA 396.45 Direct Render: Yes
Audio:     Card Intel Sunrise Point-H HD Audio
           driver: snd_hda_intel bus-ID: 00:1f.3
           Sound: Advanced Linux Sound Architecture v: k4.15.0-20-generic
Network:   Card-1: Realtek RTL8111/8168/8411 PCIE Gigabit Ethernet Controller
           driver: r8169 v: 2.3LK-NAPI port: d000 bus-ID: 02:00.0
           IF: enp2s0 state: down mac: <filter>
           Card-2: Intel Wireless 3165 driver: iwlwifi bus-ID: 03:00.0
           IF: wlp3s0 state: up mac: <filter>
Drives:    HDD Total Size: 756.2GB (7.1% used)
           ID-1: /dev/sda model: ADATA_SU800NS38 size: 256.1GB temp: 67C
           ID-2: /dev/sdb model: WDC_WD5000LPCX size: 500.1GB temp: 40C
Partition: ID-1: / size: 136G used: 39G (30%) fs: ext4 dev: /dev/sda5
RAID:      No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors:   System Temperatures: cpu: 53.0C mobo: N/A gpu: 0.0:54C
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 254 Uptime: 15 min Memory: 2498.4/31861.2MB
           Init: systemd runlevel: 5 Gcc sys: 7.3.0
           Client: Shell (bash 4.4.191) inxi: 2.3.56 
I have no default xorg.conf file, the one generated by nvidia-xconfig, followed with message

Code: Select all

WARNING: Unable to locate/open X configuration file.

Package xorg-server was not found in the pkg-config search path.
Perhaps you should add the directory containing `xorg-server.pc'
to the PKG_CONFIG_PATH environment variable
No package 'xorg-server' found
New X configuration file written to '/etc/X11/xorg.conf'
is following:

Code: Select all

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 396.45  (buildmeister@swio-display-x64-rhel04-14)  Fri Jul 13 02:10:48 PDT 2018

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection
xorg.conf generated by GUI (Save to X Configuration File in X Server Display Configuration):

Code: Select all

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 390.42  (buildd@lcy01-amd64-029)  Thu Mar 22 17:34:03 UTC 2018

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 396.45  (buildmeister@swio-display-x64-rhel04-14)  Fri Jul 13 02:10:48 PDT 2018

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce GTX 960M"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    DefaultDepth    24
    Option         "UseDisplayDevice" "none"
    SubSection     "Display"
        Virtual     1920 1080
        Depth       24
    EndSubSection
EndSection

When I'm in X Server Display Configuration, clicking on Advanced does not show additional options. From selection list I can only choose PRIME Display and X screen 0. I thought that this might be an important information indicating some problem with laptop screen. Also, creating xorg.conf, no matter how, causes system to start with blackscreen, so I did not try to change it's content.

So far I have tried following steps:
1. Using

Code: Select all

nvidia-settings --assign CurrentMetaMode="$(nvidia-settings -q CurrentMetaMode -t|tr '\n' ' '|sed -e 's/.*:: \(.*\)/\1\n/g' -e 's/}/, ForceCompositionPipeline = On}/g')" > /dev/null
2. Using

Code: Select all

$ nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +0+0 { ForceFullCompositionPipeline = On }"
3. Adding to file /etc/profile

Code: Select all

export __GL_YIELD="USLEEP"
And to /etc/environment

Code: Select all

CLUTTER_PAINT=disable-clipped-redraws:disable-culling
CLUTTER_VBLANK=True
4. By following https://www.youtube.com/watch?v=oYWer86A20s and getting following xrandr output:

Code: Select all

Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 16384 x 16384
eDP-1-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 344mm x 193mm
   1920x1080     60.00*+  59.97    59.96    59.93    48.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)
I used command:

Code: Select all

nvidia-settings --assign CurrentMetaMode="eDP-1-1:1920x1080_60 +0+0 { ForceFullCompositionPipeline = On }"
I would be very grateful for any help, as a beginner I'm struggling to find the source of this problem. If this problem is hard to solve for Cinnamon Mint and NVIDIA, I may consider changing Linux distro or desktop environment.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
trytip
Level 14
Level 14
Posts: 5371
Joined: Tue Jul 05, 2016 1:20 pm

Re: Screen tearing with Mint 19 cinnamon and GTX960M

Post by trytip »

start by adding triplebuffer and validation, copy the last three lines to your Section "Device" of xorg.conf: here what i have with nvidia-340 mint19 cinomn. you can choose to add coolbits it will do nothing but add fan control, or leave it out. you can test here https://ptpb.pw/K8Vr.webm

Code: Select all

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "GeForce 9800 GT"
    Option         "ModeValidation" "AllowNonEdidModes"
    Option         "TripleBuffer" "1"
    Option         "Coolbits" "4"
EndSection
. reboot and test. where do you get the tear? is in browser, game videos. test webgl here http://webglsamples.org/aquarium/aquarium.html (click the options and select normal maps, reflections,fog,bubbles,lightrays to disable and enable. any tear in transition?)
Image
Turboszczel

Re: Screen tearing with Mint 19 cinnamon and GTX960M

Post by Turboszczel »

Creating xorg.conf, containing even only "Device" section causes black screen on reboot. As for links, tearing appears only in first.
User avatar
trytip
Level 14
Level 14
Posts: 5371
Joined: Tue Jul 05, 2016 1:20 pm

Re: Screen tearing with Mint 19 cinnamon and GTX960M

Post by trytip »

Creating xorg.conf, containing even only "Device" section
i don't know what this means. what drivers are you able to choose in driver manager? can you choose nvidia-390. have you removed nouveau driver from synaptic?
Image
Turboszczel

Re: Screen tearing with Mint 19 cinnamon and GTX960M

Post by Turboszczel »

Yes, 390 driver is in Driver Manager and is selected. I didn't remove nouveau packages. About xorg.conf. If this file exists, system can't boot. Instead of login screen there is a black screen with prompt, if i delete xorg.conf then after reboot Mint loads properly.
User avatar
trytip
Level 14
Level 14
Posts: 5371
Joined: Tue Jul 05, 2016 1:20 pm

Re: Screen tearing with Mint 19 cinnamon and GTX960M

Post by trytip »

ok open nvidia-settings as root select what you think is best for your resolution then when you save the configuration navigate to X11/xorg.conf.d and save the file as 20-nvidia.conf which would give a a file named /X11/xorg.conf.d/20-nvidia.conf reboot see if you get black screen and if not open nvidia as root again and change resolution and save just to test that your config is actually loaded and settings are kept after reboot
Image
Locked

Return to “Graphics Cards & Monitors”