Tumbleweed, Nvidia and tearing

Hi, I have bought a Lenovo Legion 5 Pro with an AMD Ryzen 7 CPU with AMD Radeon 680M graphics plus an Nvidia GeForce RTX 3060 graphics card.

lspci | grep VGA
01:00.0 VGA compatible controller: NVIDIA Corporation GA106M [GeForce RTX 3060 Mobile / Max-Q] (rev a1)
34:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Rembrandt [Radeon 680M] (rev c8)

I use the Nvidia card for both the built-in monitor as the external one. As Nvidia driver I use nvidia-video-G06 for GeForce 700 and newer.

In /etc/X11/xorg.conf.d I got a file with name 90-nvidia.conf. This file was placed there during install I think, I did not place it there. When I add the FullCompositionPipeLine option line and reboot I still have tearing and the option line has disappeared from the file, it is obviously rewritten at boot.
Nvidia-settings creates the file xorg.conf and there I do see this (also after reboot):

Option         "metamodes" "nvidia-auto-select +0+520 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}"

But this file is not used since I still have tearing images. Is there a way to make the system use the xorg.conf file nvidia-settings created instead of the 90-nvidia.conf file which was added during driver installation, or to permanently add the composition option to the 90-nvidia.conf file?

I have tried to use Wayland but ended up with 2 black screens after reboot.
Is the Nvidia driver the correct one for my card?
Is there another way to prevent tearing.
Many questions I know but I would like to have this laptop do what it is supposed to do, the way it is supposed to do it.
Thank you all.

Here is some info about my laptop:

inxi -F
System:
  Host: openSUSE Kernel: 6.3.7-1-default arch: x86_64 bits: 64
    Desktop: KDE Plasma v: 5.27.5 Distro: openSUSE Tumbleweed 20230614
Machine:
  Type: Laptop System: LENOVO product: 82RG v: Legion 5 Pro 16ARH7H
    serial: <superuser required>
  Mobo: LENOVO model: LNVNB161216 v: SDK0T76461 WIN
    serial: <superuser required> UEFI: LENOVO v: JUCN51WW date: 08/29/2022
Battery:
  ID-1: BAT0 charge: 83.6 Wh (100.0%) condition: 83.6/80.0 Wh (104.5%)
CPU:
  Info: 8-core model: AMD Ryzen 7 6800H with Radeon Graphics bits: 64
    type: MT MCP cache: L2: 4 MiB
  Speed (MHz): avg: 1588 min/max: 1600/4784 cores: 1: 1600 2: 1397 3: 1397
    4: 1600 5: 1397 6: 2223 7: 1600 8: 1600 9: 1397 10: 1600 11: 1600 12: 1600
    13: 1600 14: 1600 15: 1600 16: 1600
Graphics:
  Device-1: NVIDIA GA106M [GeForce RTX 3060 Mobile / Max-Q] driver: nvidia
    v: 525.116.04
  Device-2: AMD Rembrandt [Radeon 680M] driver: amdgpu v: kernel
  Display: x11 server: X.Org v: 21.1.8 with: Xwayland v: 23.1.2 driver: X:
    loaded: modesetting,nvidia dri: radeonsi gpu: amdgpu,nvidia,nvidia-nvswitch
    resolution: 1: 1920x1080~60Hz 2: 2560x1600~165Hz
  API: OpenGL v: 4.6.0 NVIDIA 525.116.04 renderer: NVIDIA GeForce RTX 3060
    Laptop GPU/PCIe/SSE2
Audio:
  Device-1: AMD Rembrandt Radeon High Definition Audio driver: snd_hda_intel
  Device-2: AMD ACP/ACP3X/ACP6x Audio Coprocessor driver: snd_pci_acp6x
  Device-3: AMD Family 17h/19h HD Audio driver: snd_hda_intel
  API: ALSA v: k6.3.7-1-default status: kernel-api
  Server-1: PipeWire v: 0.3.71 status: active
Network:
  Device-1: MEDIATEK MT7922 802.11ax PCI Express Wireless Network Adapter
    driver: mt7921e
  IF: wlp2s0 state: down mac: 7a:e3:95:c2:f3:29
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    driver: r8169
  IF: eno1 state: up speed: 1000 Mbps duplex: full mac: 9c:2d:cd:b9:59:d0
  IF-ID-1: tun0 state: unknown speed: 10000 Mbps duplex: full mac: N/A
Drives:
  Local Storage: total: 953.87 GiB used: 354.12 GiB (37.1%)
  ID-1: /dev/nvme0n1 vendor: Samsung model: MZVL21T0HCLR-00BL2
    size: 953.87 GiB
Partition:
  ID-1: / size: 39.08 GiB used: 14.08 GiB (36.0%) fs: ext4 dev: /dev/nvme0n1p3
  ID-2: /boot size: 1.9 GiB used: 74.9 MiB (3.8%) fs: ext4
    dev: /dev/nvme0n1p2
  ID-3: /boot/efi size: 299.8 MiB used: 5 MiB (1.7%) fs: vfat
    dev: /dev/nvme0n1p1
  ID-4: /home size: 895.14 GiB used: 339.96 GiB (38.0%) fs: xfs
    dev: /dev/nvme0n1p5
Swap:
  ID-1: swap-1 type: partition size: 16 GiB used: 0 KiB (0.0%)
    dev: /dev/nvme0n1p4
Sensors:
  System Temperatures: cpu: 46.4 C mobo: N/A
  Fan Speeds (RPM): N/A
  GPU: device: nvidia screen: :0.0 temp: 41 C device: amdgpu temp: 42.0 C
Info:
  Processes: 411 Uptime: 0h 23m Memory: available: 14.8 GiB
  used: 4.22 GiB (28.5%) Shell: Bash inxi: 3.3.27

Looks like you use Wayland try pure X11 can be set at logon screen

Hello, when I just looked I saw I was running in System default. I now switched to X11, something I really thought I was using all the time.
Playing a Youtube video tells me something has changed for the better, although scrolling through the various videos Youtube is kindly offering me on the home page I stil see glitches.

Regarding the 2 conf files in /etc/X11/xorg.conf.d: how do I tell the system to use the file which is generated by the Nvidia settings program? The other one: 90-nvidia.conf keeps coming back. I can throw it away but after the next boot it is there again. So I guess it is being used as well. I can write the line for Nvidia’s composition pipeline in it, but since the file is replaced at boot, that line is gone.

Open dolphin as superuser>enter /etc/profile.d> create a file named Tearing.sh>inside write:

export KWIN_TRIPLE_BUFFER=1

Reboot

Are you sure the generated xorg.conf by nvidia-settings is inside the /etc/X11/xorg.conf.d or it is outside like so:
/etc/X11/xorg.conf.

@JanMussche I suspect suse-prime is running since it probably determined at install it was an ‘optimus’ type setup and maybe you selected the nvidia card here and it created the 90-nvidia.conf file…

Sure it’s not the amd gpu needed to drive the external monitor?

Hello Conram,
this is in the contents of the directory /etc/X11/xorg.conf.d:
ls
total 12K
-rw-r–r-- 1 root root 404 Jun 16 15:59 00-keyboard.conf
-rw-r–r-- 1 root root 704 Jun 19 15:50 90-nvidia.conf
-rw-r–r-- 1 root root 1.8K Jun 18 07:22 xorg.conf

xorg.conf is the output of the Nvidia-settings program in which I added the CompositionPipeLine line, the 90-nvidia.conf is a file which is autogenerated somehow. I can change the file but after a reboot it has the old contents.

Hello Malcom,
I don’t see a process called suse-prime at the moment, I do see nvidia-settings. Didn’t start that one by hand.
I did use suse-prime to choose the Nvidia card to be used. I would love to keep using it, I bought it, payed for it so I want to use it, unless I do have to start using the AMD gpu.
Talking about the latter, how do I switch to that GPU? I have tried using select AMD, select AMDGPU but it doesn’t work. What is the code I have to use to start using the AMD GPU?

Hi enziosavio, thank you for your help.
I did what you wrote but I can’t see any differences with before creating this file. Browsing the main Youtube age still gives me the artifacts and watching a video is also not perfect.

@JanMussche suse-prime list I think shows the gpu’s.

Anyway, what is your end game for the Nvidia GPU?

Malcolm,
I found this:

/usr/sbin/prime-select list

NVIDIA/Intel video card selection for NVIDIA Optimus laptops.

usage: prime-select           nvidia|intel|intel2|amd|offload|unset|get-current|get-boot|offload-set|log-view|log-clean
usage: prime-select boot      nvidia|intel|intel2|amd|offload|last
usage: prime-select next-boot nvidia|intel|intel2|amd|offload|abort
usage: prime-select service   check|disable|restore

nvidia:      use the NVIDIA proprietary driver
intel:       use the Intel card with the "modesetting" driver
intel2:      use the Intel card with the "intel" Open Source driver (xf86-video-intel)
amd:         use the Amd card with the "amd" Open Source driver (xf86-video-amdgpu)
offload      PRIME Render Offload possible with >= 435.xx NVIDIA driver
offload-set  choose which intel driver use in PRIME Render Offload
unset:       disable effects of this script and let Xorg decide what driver to use
get-current: display driver currently configured
log-view:    view logfile
log-clean:   clean logfile
boot:        select default card at boot or set last used
             supports kernel parameter nvidia.prime=intel|intel2|nvidia|amd|offload
next-boot:   select card ONLY for next boot, it not touches your boot preference. abort: restores next boot to default
get-boot:    display default card at boot
service:     disable, check or restore prime-select service.

As I wrote before when I used AMD as option it didn’t work, so what to choose to get the AMD GPU?

@JanMussche your running X11 not Wayland? If so can you post the output from;

xrandr --listproviders

Lets see if we can see two GPU’s present.

tearing.sh with a lowercase t

Malcolm, I got this:

xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x1b7; cap: 0x1 (Source Output); crtcs: 4; outputs: 6; associated providers: 1; name: NVIDIA-0
    output DP-0
    output DP-1
    output DP-2
    output DP-3
    output HDMI-0
    output DP-4
Provider 1: id: 0x1fc; cap: 0xf (Source Output, Sink Output, Source Offload, Sink Offload); crtcs: 4; outputs: 7; associated providers: 1; name: modesetting
    output eDP-1-1
    output DP-1-1
    output DP-1-2
    output DP-1-3
    output DP-1-4
    output DP-1-5
    output DP-1-6

Do I need to select modesetting? Bit strange because when switching to Nvidia I selected Nvidia.

@JanMussche Yes all very strange, are there system BIOS settings for the GPU’s?

Normally the primary device would be amdgpu and secondary nvidia, I suspect that selecting nvidia during install has set some defaults as I would have expected amd to be primary and nvidia secondary. Perhaps that’s related to suse-prime being installed.

I have another list for you:

/usr/sbin/prime-select list

NVIDIA/Intel video card selection for NVIDIA Optimus laptops.

usage: prime-select           nvidia|intel|intel2|amd|offload|unset|get-current|get-boot|offload-set|log-view|log-clean
usage: prime-select boot      nvidia|intel|intel2|amd|offload|last
usage: prime-select next-boot nvidia|intel|intel2|amd|offload|abort
usage: prime-select service   check|disable|restore

nvidia:      use the NVIDIA proprietary driver
intel:       use the Intel card with the "modesetting" driver
intel2:      use the Intel card with the "intel" Open Source driver (xf86-video-intel)
amd:         use the Amd card with the "amd" Open Source driver (xf86-video-amdgpu)
offload      PRIME Render Offload possible with >= 435.xx NVIDIA driver
offload-set  choose which intel driver use in PRIME Render Offload
unset:       disable effects of this script and let Xorg decide what driver to use
get-current: display driver currently configured
log-view:    view logfile
log-clean:   clean logfile
boot:        select default card at boot or set last used
             supports kernel parameter nvidia.prime=intel|intel2|nvidia|amd|offload
next-boot:   select card ONLY for next boot, it not touches your boot preference. abort: restores next boot to default
get-boot:    display default card at boot
service:     disable, check or restore prime-select service.

Here it says I can select amd as a choice.

In BIOS I do have a choice between 2 GPU’s:
Discrete and switchable. It was set to switchable, I now selected Discrete. No idea what changed. I am still running the Nvidia GPU according to:

glxinfo|egrep "OpenGL vendor|OpenGL renderer"
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce RTX 3060 Laptop GPU/PCIe/SSE2

If only I knew more about tis subject.

I have another list for you:

/usr/sbin/prime-select list

NVIDIA/Intel video card selection for NVIDIA Optimus laptops.

usage: prime-select           nvidia|intel|intel2|amd|offload|unset|get-current|get-boot|offload-set|log-view|log-clean
usage: prime-select boot      nvidia|intel|intel2|amd|offload|last
usage: prime-select next-boot nvidia|intel|intel2|amd|offload|abort
usage: prime-select service   check|disable|restore

nvidia:      use the NVIDIA proprietary driver
intel:       use the Intel card with the "modesetting" driver
intel2:      use the Intel card with the "intel" Open Source driver (xf86-video-intel)
amd:         use the Amd card with the "amd" Open Source driver (xf86-video-amdgpu)
offload      PRIME Render Offload possible with >= 435.xx NVIDIA driver
offload-set  choose which intel driver use in PRIME Render Offload
unset:       disable effects of this script and let Xorg decide what driver to use
get-current: display driver currently configured
log-view:    view logfile
log-clean:   clean logfile
boot:        select default card at boot or set last used
             supports kernel parameter nvidia.prime=intel|intel2|nvidia|amd|offload
next-boot:   select card ONLY for next boot, it not touches your boot preference. abort: restores next boot to default
get-boot:    display default card at boot
service:     disable, check or restore prime-select service.

Here it says I can select amd as a choice.

In BIOS I do have a choice between 2 GPU’s:
Discrete and switchable. It was set to switchable, I now selected Discrete. No idea what changed. I am still running the Nvidia GPU according to:

glxinfo|egrep "OpenGL vendor|OpenGL renderer"
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce RTX 3060 Laptop GPU/PCIe/SSE2

If only I knew more about tis subject.

What I didn’t mention before is this:
Yast softwaremanager’s windows is too high. I see the bottom 3/4 of the window and at the top of the monitor I can just see the field in which you type what you are looking for. Everything above that is off monitor. This happens in both Switchable GPU as in Discrete.
Now in Discrete my Conky is not visible, it has to be on the built-in monitor but it isn’t there. System-monitor says it isn’t running at all.

I’ll try to switch to the AMD GPU and use that for a while to see if it is any better. Will let you know as soon as I have some results. In the mean time, thanks for all the time and effort you put into my problem.

@JanMussche ahhh so likely to get things working is switchable, also the screen resolution is not set properly hence your issues with some applications.

Hi again,

One step further. I managed to switch to the AMD GPU using:

sudo prime-select boot amd

glxinfo|egrep "OpenGL vendor|OpenGL renderer"
OpenGL vendor string: AMD
OpenGL renderer string: AMD Radeon Graphics (rembrandt, LLVM 16.0.5, DRM 3.52, 6.3.7-1-default)

Plus point: no tearing anymore
Negative point: I only can use the built-in monitor, the external gives me a black screen.
How to start using the external monitor as well and please don’t tell me this is impossible.

@JanMussche Can you show the output from both of the following commands, once when with AMD and once with Nvidia, and with all monitors connected, even if no image/output;

xrandr --listproviders
xrandr --listmonitors

Then need to look at getting rid of all the suse-prime, bbswitch etc and then seeing what the default is… I think it could be suse-prime related…