Screen tearing with GeForce 940MX on Xubuntu 18.04.5

HI… I have screen tearing on a fresh install of Xubuntu 18.04.5 with Nvidia-drivers installed. How do I fix this :? Below is my laptop info & many thanks in advanced for helping me…

LAPTOP >> Thinkpad E470
OS >> Xubuntu-core 18.04.5
KERNEL >> 5.4.0-73-generic
GRAPHICS CARD >> NVIDIA Corporation: GM108M [GeForce 940MX]
GRAPHICS DRIVER >> nvidia-driver-460 (proprietary, tested)
CPU >> Intel(R) Core™ i5-7200U CPU @ 2.50GHz // Inteml Corporation HD Graphics 620 (rev 02)
nvidia-bug-report.log.gz (1.5 MB)

did you add the kernel parameter nvidia-drm.modeset=1 ?

I tried adding that to grub, then updating grub, followed by rebooting, but screen tearing was still present…

does it show up with:
cat /proc/cmdline

This is what I see from that…

BOOT_IMAGE=/boot/vmlinuz-5.4.0-73-generic root=UUID=ff15759a-f39a-4317-bc6b-20df687f4f8d ro splash quiet nvidia-drm.modeset=1 vt.handoff=1

OK.
Did you try fiddling with “Force Composition Pipeline” and “Force Full Composition Pipeline” in nvidia-settings?

This is what my NVIDIA X Server Settings looks like >> http://i.imgur.com/dqsuUWa.png

Nothing else? No other settings available?
Please run nvidia-bug-report.sh as root and attach the resulting file here. (not promising that I can help, but then at least everyone can take a look).

Yea I ran the bug report & attached it to my original post. Thank you so much though for just replying :) Oh and yes that is all that appears whenever I open the settings window…

The nvidia driver cannot load, because nvidiafb is holding the device hostage.
Blacklist the nvidiafb driver.
Here is what is on my system:
grep -r nvidiafb /etc/modprobe.d
/etc/modprobe.d/blacklist-framebuffer.conf:blacklist nvidiafb

If that does not work, delete /var/log/kern.log, because it blows up the bug-report to about 70MB, reboot and create a new report.

How do I blacklist the driver ?? Sorry I´ve never done anything like this before…

create a file in /etc/modprobe.d name it i.e. blacklist-nvidiafb.conf and put this line into it: blacklist nvidiafb
Reboot

I created that file with that line in it. I’ve rebooted and now I’m stuck at a black screen with a blinking cursor in the top left of the screen. CTRL+ALT+F1/2 etc does not work…

Please try this:
with the blacklist file in place run: sudo prime-select nvidia then sudo update-initramfs -u -k $(uname -r) - reboot.
If that does not work, run sudo prime-select intel then sudo update-initramfs -u -k $(uname -r) - reboot and create a new bug report. (hopefully you purged your massive /var/log/kern.log in the first place)

Yes I purged that log before I rebooted. How do I enter those commands if I cannot access a terminal ?? Is there a terminal in recovery mode ??

Yes terminal is available in recovery mode.

sudo prime-select intel & sudo update-initramfs -u -k $(uname -r) got me back to the desktop :) Here is a new bug report.
nvidia-bug-report.log.gz (93.0 KB)

Oh and my nvidia settings window still looks exactly the same…

Ok now it gets complicated (for me)…

[ 0.294104] pci 0000:01:00.0: can’t claim BAR 6 [mem 0xfff80000-0xffffffff pref]: no compatible bridge window
[ 0.294109] pci 0000:00:1d.0: bridge window [io 0x1000-0x0fff] to [bus 03] add_size 1000
[ 0.294110] pci 0000:00:1d.0: bridge window [mem 0x00100000-0x000fffff 64bit pref] to [bus 03] add_size 200000 add_align 100000
[ 0.294111] pci 0000:00:1d.0: bridge window [mem 0x00100000-0x000fffff] to [bus 03] add_size 200000 add_align 100000
[ 0.294116] pci 0000:00:1d.0: BAR 14: assigned [mem 0xbf800000-0xbf9fffff]
[ 0.294119] pci 0000:00:1d.0: BAR 15: assigned [mem 0xbfa00000-0xbfbfffff 64bit pref]
[ 0.294121] pci 0000:00:1d.0: BAR 13: assigned [io 0x2000-0x2fff]
[ 0.294123] pci 0000:01:00.0: BAR 6: no space for [mem size 0x00080000 pref]
[ 0.294124] pci 0000:01:00.0: BAR 6: failed to assign [mem size 0x00080000 pref]

  journalctl -b -2:
May 18 09:38:49 reviziis kernel: Command line: BOOT_IMAGE=/boot/vmlinuz-5.4.0-73-generic root=UUID=ff15759a-f39a-4317-bc6b-20df687f4f8d ro splash quiet nvidia-drm.modeset=1 vt.handoff=1
May 18 09:38:49 reviziis kernel: Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.4.0-73-generic root=UUID=ff15759a-f39a-4317-bc6b-20df687f4f8d ro splash quiet nvidia-drm.modeset=1 vt.handoff=1
May 18 09:39:12 reviziis kernel: nvidia-nvlink: Nvlink Core is being initialized, major device number 237
May 18 09:39:12 reviziis kernel: NVRM: loading NVIDIA UNIX x86_64 Kernel Module  460.73.01  Thu Apr  1 21:40:36 UTC 2021
May 18 09:39:12 reviziis kernel: nvidia-modeset: Loading NVIDIA Kernel Mode Setting Driver for UNIX platforms  460.73.01  Thu Apr  1 21:32:31 UTC 2021
May 18 09:39:12 reviziis kernel: [drm] [nvidia-drm] [GPU ID 0x00000100] Loading driver
May 18 09:39:13 reviziis kernel: NVRM: GPU at PCI:0000:01:00: GPU-2b046aef-a19a-dba6-c390-8db34451e0e8
May 18 09:39:13 reviziis kernel: NVRM: Xid (PCI:0000:01:00): 62, pid=409, 3a91(5f98) 00000000 00000000
May 18 09:39:13 reviziis kernel: [drm] Initialized nvidia-drm 0.0.0 20160202 for 0000:01:00.0 on minor 1
May 18 09:39:13 reviziis kernel: nvidia-uvm: Loaded the UVM driver, major device number 234.

May 18 09:39:24 reviziis kernel: NVRM: Xid (PCI:0000:01:00): 31, pid=864, Ch 00000008, intr 10000000. MMU Fault: ENGINE GRAPHICS GPCCLIENT_TPCCS_2 faulted @ 0x1_000bb000. Fault is of type FAULT_INFO_TYPE_UNSUPPORTED_KIND ACCESS_TYPE_WRITE

It looks to me there is a problem assigning PCI resources.
You could try to boot with the kernel parameter pci=realloc. And look if that get’s the BAR 6 error messages out of the way (look at dmesg).
Best create a new bug-report.
I won’t be around for the next hours…

Thank you for the help so far :) I have added that line & updated grub. Will try rebooting shortly & created / upload a new bug report if needed. Have an awesome day :)

Here is a new bug report…
nvidia-bug-report.log.gz (95.2 KB)

[ UPDATE ]
I have just tried to open a few different videos with mpv and they all fail to open with the following error showing in the terminal.

[vo] Video output gpu not found!
Error opening/initializing the selected video_out (–vo) device.