Nvidia Problem, laggy

Hi everyone, I have recently installed manjaro kde and I have a problem with the gpu. I have a 3060 ti and the games hold up very well at 60 fps but it all seems very laggy. If I scroll down on google chrome some text seems blurry. Since I have a 4k 60Hz monitor I would like to always keep vsync active (on windows 11 I never had lag problems keeping it always on). The resolution is 1080p because I switch to another monitor and prefer to have it that way. Post my system information.

System:
  Host: PC-Gaming-Linux Kernel: 5.17.1-3-MANJARO arch: x86_64 bits: 64
    Desktop: KDE Plasma v: 5.24.4 Distro: Manjaro Linux
Machine:
  Type: Desktop System: Micro-Star product: MS-7B79 v: 1.0
    serial: <superuser required>
  Mobo: Micro-Star model: X470 GAMING PRO (MS-7B79) v: 1.0
    serial: <superuser required> UEFI: American Megatrends LLC. v: 1.I0
    date: 01/26/2022
CPU:
  Info: 6-core model: AMD Ryzen 5 2600X bits: 64 type: MT MCP cache:
    L2: 3 MiB
  Speed (MHz): avg: 2110 min/max: 2200/3600 cores: 1: 2097 2: 1868 3: 1733
    4: 1978 5: 1736 6: 3416 7: 2795 8: 1733 9: 1721 10: 1834 11: 1734 12: 2676
Graphics:
  Device-1: NVIDIA GA103 [GeForce RTX 3060 Ti] driver: nvidia v: 510.60.02
  Display: x11 server: X.Org v: 1.21.1.3 driver: X: loaded: nvidia
    gpu: nvidia resolution: 1: 1920x1080~60Hz 2: N/A
  OpenGL: renderer: NVIDIA GeForce RTX 3060 Ti/PCIe/SSE2
    v: 4.6.0 NVIDIA 510.60.02
Audio:
  Device-1: NVIDIA driver: snd_hda_intel
  Device-2: AMD Family 17h HD Audio driver: snd_hda_intel
  Sound Server-1: ALSA v: k5.17.1-3-MANJARO running: yes
  Sound Server-2: PulseAudio v: 15.0 running: yes
  Sound Server-3: PipeWire v: 0.3.49 running: yes
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    driver: r8168
  IF: enp34s0 state: up speed: 1000 Mbps duplex: full
    mac: 30:9c:23:e0:f3:e0
Drives:
  Local Storage: total: 1.14 TiB used: 513.12 GiB (44.1%)
  ID-1: /dev/sda vendor: Samsung model: SSD 860 EVO 250GB size: 232.89 GiB
  ID-2: /dev/sdb vendor: Seagate model: ST1000DM010-2EP102 size: 931.51 GiB
Partition:
  ID-1: / size: 219.22 GiB used: 95.73 GiB (43.7%) fs: ext4 dev: /dev/sda2
  ID-2: /boot/efi size: 299.4 MiB used: 288 KiB (0.1%) fs: vfat
    dev: /dev/sda1
Swap:
  ID-1: swap-1 type: partition size: 8.8 GiB used: 0 KiB (0.0%)
    dev: /dev/sda3
Sensors:
  System Temperatures: cpu: N/A mobo: N/A gpu: nvidia temp: 49 C
  Fan Speeds (RPM): N/A gpu: nvidia fan: 0%
Info:
  Processes: 303 Uptime: 41m Memory: 15.61 GiB used: 2.88 GiB (18.5%)
  Shell: Zsh inxi: 3.3.15
[    0.410879] SPI driver ili9163 has no spi_device_id for newhaven,1.8-128160EF
[    0.891921] ata1.00: supports DRM functions and may not be fully accessible
[    0.896322] ata1.00: supports DRM functions and may not be fully accessible
[    4.478426] systemd-journald[349]: File /var/log/journal/861884b3fccd483da7acf90b550cd9cc/system.journal cor
rupted or uncleanly shut down, renaming and replacing.
[    4.546161] acpi PNP0C14:02: duplicate WMI GUID 05901221-D566-11D1-B2F0-00A0C9062910 (first instance was on
PNP0C14:01)
[    4.592578] razerkbd: loading out-of-tree module taints kernel.
[    4.611785] nvidia: module license 'NVIDIA' taints kernel.
[    4.611790] Disabling lock debugging due to kernel taint

[    4.650639] r8168  Copyright (C) 2021 Realtek NIC software team <nicfae@realtek.com>  
               This program comes with ABSOLUTELY NO WARRANTY; for details, please see <http://www.gnu.org/lic
enses/>.  
               This is free software, and you are welcome to redistribute it under certain conditions; see <ht
tp://www.gnu.org/licenses/>.  
[    4.695483] NVRM: loading NVIDIA UNIX x86_64 Kernel Module  510.60.02  Wed Mar 16 11:24:05 UTC 2022
[    5.116689] nvidia_uvm: module uses symbols from proprietary module nvidia, inheriting taint.
[    5.442767] FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[    5.451073] kauditd_printk_skb: 38 callbacks suppressed
[    7.899705] systemd-journald[349]: File /var/log/journal/861884b3fccd483da7acf90b550cd9cc/user-1000.journal
corrupted or uncleanly shut down, renaming and replacing.
[   15.727704] kauditd_printk_skb: 46 callbacks suppressed
[  136.840259] show_signal_msg: 2 callbacks suppressed
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 510.60.02


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"

    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Samsung U28E590"
    HorizSync       135.0 - 135.0
    VertRefresh     40.0 - 60.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "NVIDIA GeForce RTX 3060 Ti"
    Option         "Coolbits" "31"
    Option         "TripleBuffer" "on"
EndSection

Section "Screen"

# Removed Option "metamodes" "1920x1080 +0+0 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}; 1920x1080 +0+0 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-1"
    Option         "metamodes" "DP-0: 1920x1080_60 +0+0 {ForceCompositionPipeline=On}; HDMI-0: 1920x1080 +0+0 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

you can try ‘tweaks’ from this link and see

Thanks for the reply! I followed this guide last night but nothing. The only thing I don’t have from this guide is the Rendering backend: OpenGL 3.1(there isn’t this option).

thats unfortunate that it didnt work… yes the rendering options were removed from plasma…

So there are no fixes for the problem I have?

there probably are, but i really am not knowledgeable in this… do you run your games with prime run … also just to be sure, post output from mhwd -l && mhwd -li
also noticed youre running the 5.17 kernel, try switching to 5.15 LTS

mhwd -l && mhwd -li

0000:22:00.0 (0200:10ec:8168) Network controller Realtek Semiconductor Co., Ltd.:

              NAME               VERSION          FREEDRIVER           TYPE

     network-r8168            2016.04.20                true            PCI

0000:27:00.0 (0300:10de:2414) Display controller nVidia Corporation:

              NAME               VERSION          FREEDRIVER           TYPE

      video-nvidia            2021.12.18               false            PCI
       video-linux            2018.05.04                true            PCI
 video-modesetting            2020.01.13                true            PCI
        video-vesa            2017.03.12                true            PCI

Installed PCI configs:

              NAME               VERSION          FREEDRIVER           TYPE

     network-r8168            2016.04.20                true            PCI
      video-nvidia            2021.12.18               false            PCI

I don’t know for example the games that are laggy a lot are the cemu emulator started by lutris where I added these commands at startup but nothing: __GL_SYNC_TO_VBLANK 1 and __GL_THREADED_OPTIMIZATIONS 1. I noticed that with opengl and the active vsync it runs very well but with vulkan and the triple buffering runs laggy but in both cases the fps are at 60. Another game is final fantasy vii remake which is too unplayable that lagging, and I noticed that in the game menu I arrive at 500fps (I have on the force composition pipeline, How is it possible?). I try to pass as you told me at 5.15 lts and I update you, thanks.

i didnt noticed that you have only one gpu, so ignore the prime thing…
try disable compositor with: alt + shift + f12 and try play games - you can enable it again with the same shortcut…
then check this link out

was removed because now also wayland can load, hence the Compositor settings was changed, no need to worry about that.

Please do not use FCP with FFCP together. It is pointless. Also

In that case you might also need the kwin.sh part … see here

I cleaned up the config, try it:

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

Section "Files"
EndSection

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

Section "InputDevice"
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Samsung"
    ModelName      "Samsung U28E590"
    HorizSync       135.0 - 135.0
    VertRefresh     40.0 - 60.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "NVIDIA GeForce RTX 3060 Ti"
    Option         "Coolbits" "31"
    Option         "TripleBuffer" "on"
    Option  "ConnectToAcpid"    "Off"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-1"
    Option         "metamodes" "DP-0: 1920x1080_60 +0+0 {ForceCompositionPipeline=On}; HDMI-0: 1920x1080 +0+0 {ForceCompositionPipeline=On}"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

Section "Extensions"
    Option         "COMPOSITE" "Enable"
EndSection

 
Section "InputClass"
    Identifier          "Keyboard Defaults"
    MatchIsKeyboard        "yes"
    Option              "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection
 

Then run this command:

sudo mhwd-gpu --setmod nvidia --setxorg /etc/X11/mhwd.d/nvidia.conf

Reboot.

1 Like

Sorry for the late reply, I was doing some tests. I have updates. So for the problem of tearing of google chrome scrolling I solved it by going to the search bar

chrome: // flags

disabling Smooth Scrolling.

For the cemu emulator since it does not yet have native support for linux the only way to play it without lag is to switch vulkan to opengl even if the shader compilation is slower and more stutter but once compiled it runs very well, as far as another is concerned game I forced the vsync through the steam commands by adding

__GL_SYNC_TO_VBLANK = 1 %command%

For the rest of the things you recommended I had already done, that of kwin.sh and others, I just modified the nvidia.conf you gave me, thanks, now everything seems to go smoothly… there are still some lags but many less than before. Thanks for the support!!

I solved the vsync issue in some games and I understand a bit how it all works but still have bad screen tearing and lag in some games, very annoying. So the problem still exists. Has anyone managed to fix this problem? I also tried creating an nvidia-drm.conf file in modprobe.d and putting

options nvidia_drm modeset=1

but nothing!! :pensive: I’m about to give up!

PS: I am using the latest drivers

did you tried the ‘tweaks’ from the link above

Yes, all of them.

with the option __GL_THREADED_OPTIMIZATIONS=1 the mpv Player encode with nvenc_copy
without correct nvenc
disable it !

You can add export __GL_SYNC_TO_VBLANK=0 to /etc/evironment

i have only 2 options in the nvidia settings under opengl :
Allow G-Sync/G-Sync compatible
Use Conformant Texture Clamping

Thanks for the reply. Regarding

__GL_THREADED_OPTIMIZATIONS = 1

I put it as a variable to start the emulator it is not a global variable of the OS. As for your settings, I assume you have a gsync screen with a high refresh rate. I have a monitor without gsync and with a refresh rate locked at 60 unfortunately. As for

__GL_SYNC_TO_VBLANK = 0

(in my case =1 because i want vsync always on) do you intend to insert it in etc/profile.d/kwin.sh?

I have not made any other changes

Guys thanks everyone but I finally SOLVED it. I don’t know why but the Force Composition Pipeline was the culprit (with my setup), now that I’ve deactivated it I have no more problems (no more micro lag). I left only “sync to vblank” and “allow flipping” active in the nvidia settings and since I don’t have a gsync screen, for games where I need vsync active and it cannot be activated from the game settings I use goverlay.