Video Stuttering- Nvidia

Delete that file.
You manually edited it and save it there. Since Manjaro is suing MHWD, the proper place is as mentioned, and also /etc/X11/xorg.conf.d/90-mhwd.conf should be a symlink to /etc/X11/mhwd.d/nvidia.conf

You excluded the last few lines in the conf, so here is as i recommend it, close to default.

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"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "ViewSonic VX2757"
    HorizSync       83.0 - 83.0
    VertRefresh     48.0 - 76.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "NVIDIA GeForce GTX 1060 6GB"
    Option  "ConnectToAcpid"    "Off"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-4"
    Option         "metamodes" "DP-2: nvidia-auto-select +0+0, HDMI-0: nvidia-auto-select +1920+0"
    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

Once you save it in /etc/X11/mhwd.d/nvidia.conf run this command from terminal:

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

and reboot the system.
If is not much of a change, there is another thing we can try.

2 Likes

@bogdancovaciu Thank’s for the detailed write up. I followed all the above steps with only one small change to the screen section of nvidia.conf to include my third monitor:

From this: Option "metamodes" "DP-2: nvidia-auto-select +0+0, HDMI-0: nvidia-auto-select +1920+0"
To this: Option "metamodes" "DP-2: nvidia-auto-select +1920+120, HDMI-0: nvidia-auto-select +0+0, DP-5: nvidia-auto-select +3840+120"

I created the symlink /etc/X11/xorg.conf.d/90-mwhd.conf and then ran the setxorg command.

After a reboot unfortunately the problem still persists, what would your other suggestion be?

EDIT: I didn’t even have those last few lines that you mentioned I was missing in the conf, but I have added them.

So to be clear: It is only video playback and NOT the whole desktop?

Use this instead:

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"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "ViewSonic VX2757"
    HorizSync       83.0 - 83.0
    VertRefresh     48.0 - 76.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "NVIDIA GeForce GTX 1060 6GB"
    Option         "TripleBuffer"  "On"
    Option  "ConnectToAcpid"    "Off"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-4"
    Option "metamodes" "DP-2: nvidia-auto-select +1920+120 {ForceCompositionPipeline=On}, HDMI-0: nvidia-auto-select +0+0 {ForceCompositionPipeline=On}, DP-5: nvidia-auto-select +3840+120 {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

create the file /etc/profile.d/kwin.sh
add this lines to it

export KWIN_TRIPLE_BUFFER=1
export __GL_YIELD=USLEEP
export __GL_MaxFramesAllowed=1

Reboot and see if you notice improvements.

1 Like

@megavolt Yes, only video playback and NOT the whole desktop.

1 Like

So it happens to any videos? Are videos at 2k or 4k resolution? If so, then you need to enable gpu acceleration.

@bogdancovaciu Thanks again for the steps, I changed my nvidia.conf to the above and added the kwin.sh file.

Unfortunately there is still no difference, the video stutter is still there the same as it was before. Do you have any other sugggestions?

@megavolt Yes with any video, I just found some old 480p videos and tried them with the same result. Same when streaming in a browser window, it doesn’t matter what quality the video is played in.

My monitors are only 1080p and the videos I’m playing are 10880p max, definitely not in 2k or 4k.

EDIT: For clarification, it also happens when playing videos in VLC so not just in a browser.

Ok that reminds of something: Maybe Nvidia’s GLX is not active?

journalctl --boot 0 --user --grep "\([A-Z][A-Z]\)" --no-hostname 

Look for something like that:

/usr/lib/gdm-x-session[786]: (II) LoadModule: "glx"
/usr/lib/gdm-x-session[786]: (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
/usr/lib/gdm-x-session[786]: (II) Module glx: vendor="X.Org Foundation"
/usr/lib/gdm-x-session[786]: (II) LoadModule: "nvidia"
/usr/lib/gdm-x-session[786]: (II) LoadModule: "glxserver_nvidia"
/usr/lib/gdm-x-session[786]: (II) Loading /usr/lib/nvidia/xorg/libglxserver_nvidia.so
/usr/lib/gdm-x-session[786]: (II) Module glxserver_nvidia: vendor="NVIDIA Corporation"

Since I have only 1 screen, I just this as config:

$ cat /etc/X11/xorg.conf.d/91-nvidia.conf                                                                                            ✔ 

Section "Device"
	Identifier	"nvidia"
	driver		"nvidia"
	BusID		"PCI:1:0:0"
EndSection

Section "Screen"
    Identifier     "nvidia"
    Device         "nvidia"
    Option "AllowEmptyInitialConfiguration"
EndSection

Everything is detected automatically and I use nvidia 470xx driver.

1 Like

@megavolt Thanks, I found this:

/usr/lib/gdm-x-session[1963]: (II) LoadModule: "glx"
/usr/lib/gdm-x-session[1963]: (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
/usr/lib/gdm-x-session[1963]: (II) Module glx: vendor="X.Org Foundation"
/usr/lib/gdm-x-session[1963]: (II) LoadModule: "nvidia"

and this:

/usr/lib/gdm-x-session[1963]: (II) LoadModule: "glxserver_nvidia"
/usr/lib/gdm-x-session[1963]: (II) Loading /usr/lib/nvidia/xorg/libglxserver_nvidia.so
/usr/lib/gdm-x-session[1963]: (II) Module glxserver_nvidia: vendor="NVIDIA Corporation"

So it looks like GLX is fine, but I did also find the below, not sure if it might indicate an issue or not.

/usr/lib/gdm-x-session[1963]: (II) Initializing extension GLX
/usr/lib/gdm-x-session[1963]: (II) Initializing extension GLX
/usr/lib/gdm-x-session[1963]: (II) Indirect GLX disabled.
/usr/lib/gdm-x-session[1963]: (II) GLX: Another vendor is already registered for screen 0

I’m using the most recent driver: 510.68.02 - Installed via Manjaro Settings Manager (video-nvidia)
As this issue is somewhat recent, maybe I should try an older driver?

Could be worth a try. Also, maybe a dumb question, but could it be that you run “Gnome Classic” (fallback option)? It has no OpenGL acceleration.

1 Like

Definitely not a dumb question, it wouldn’t be the first time that a problem is solved by something so simple that it’s overlooked! I actually wasn’t sure so I logged out and back in to see which option is selected at the login screen and GNOME is what I’m using NOT Gnome Classic.

I don’t have the time atm to change drivers and test, dinner is calling. But I’ll give it a try tomorrow after work when I have some free time.

I really appreciate the time you’ve taken to help me out (you too @bogdancovaciu) If you happen to have any other ideas please let me know!!

@megavolt @bogdancovaciu So I tried an earlier nvidia driver (470xx) and the problem still persists, upon further inspection, it could be that the whole desktop is suffering from the stutter.

It’s not something that I noticed previously, but I noticed a loading bar on an app that seemed to have the same stutter, I then noticed it when scrolling a webpage quickly I then ran glxgears and that has the same stutter.

So it seems it might be a different issue altogether, any advice?

Can you post inxi -G ?
And: is there another graphics driver installed ?
mhwd -li

@Keruskerfuerst thanks for the reply.

Graphics:
  Device-1: NVIDIA GP104 [GeForce GTX 1060 6GB] driver: nvidia v: 470.129.06
  Display: x11 server: X.Org v: 21.1.3 with: Xwayland v: 22.1.1 driver: X:
    loaded: nvidia gpu: nvidia resolution: 1: 1920x1080~60Hz 2: 1920x1080~60Hz
    3: 1920x1200~60Hz
  OpenGL: renderer: NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2
    v: 4.6.0 NVIDIA 470.129.06

and

> Installed PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
    video-nvidia-470xx            2021.12.18               false            PCI
     video-modesetting            2020.01.13                true            PCI
           video-linux            2018.05.04                true            PCI
            video-vesa            2017.03.12                true            PCI

So yes there is other drivers installed but not being used… should I remove them?

That one make me think… please check this file:

cat /etc/X11/xorg.conf.d/90-mhwd.conf 

If there is a vesa driver mentioned, then you run xorg in generic vesa mode. Nvidia has been initialized, but it uses vesa anyway.

@megavolt so /etc/X11/xorg.conf.d/90-mhwd.conf didn’t exist until the other day, I was following bogdancovaciu’s advice with my nvidia.conf file and now I do have 90-mhwd.conf but it is just a symlink to /etc/X11/mhwd.d/nvidia.conf

Nothing seemed to change after the creation of this file, however there is a /etc/X11/mhwd.d/vesa.conf file, unsure whether it is in use:

##
## Generated by mhwd - Manjaro Hardware Detection
##
 
 
Section "Device"
    Identifier  "Device0"
    Driver      "vesa"
    BusID       "PCI:0:2:0"
	Option      "DRI"    "true"
EndSection
 
 
Section "DRI"
        Group  "video"
        Mode   0666
EndSection
 
 
Section "Extensions"
    Option "Composite" "Enable"
    Option "RENDER"    "Enable"
EndSection
 
 
Section "InputClass"
    Identifier          "Keyboard Defaults"
    MatchIsKeyboard        "yes"
    Option              "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection

Should I remove the vesa driver? (or even all the open source drivers)? and the vesa.conf file. Will xorg then use nvidia by default?

/etc/X11/mhwd.d/ doesnt matter for xorg. What matters is this dir: /etc/X11/xorg.conf.d/.

Please check this:

lspci -kv | sed -n "/VGA compatible controller/,/Kernel modules/p"

output is:

01:00.0 VGA compatible controller: NVIDIA Corporation GP104 [GeForce GTX 1060 6GB] (rev a1) (prog-if 00 [VGA controller])
	Subsystem: Gigabyte Technology Co., Ltd Device 37ca
	Flags: bus master, fast devsel, latency 0, IRQ 143
	Memory at de000000 (32-bit, non-prefetchable) [size=16M]
	Memory at c0000000 (64-bit, prefetchable) [size=256M]
	Memory at d0000000 (64-bit, prefetchable) [size=32M]
	I/O ports at e000 [size=128]
	Expansion ROM at 000c0000 [virtual] [disabled] [size=128K]
	Capabilities: <access denied>
	Kernel driver in use: nvidia
	Kernel modules: nouveau, nvidia_drm, nvidia

So it looks like nvidia is being used. Here’s my /etc/X11/xorg.conf.d/90-mhwd.conf (which is just a link to /etc/X11/mhwd.d/nvidia.conf)

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"
    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "ViewSonic VX2757"
    HorizSync       83.0 - 83.0
    VertRefresh     48.0 - 76.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "NVIDIA GeForce GTX 1060 6GB"
    Option         "TripleBuffer"  "On"
    Option  "ConnectToAcpid"    "Off"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-4"
    Option "metamodes" "DP-2: nvidia-auto-select +1920+120 {ForceCompositionPipeline=On}, HDMI-0: nvidia-auto-select +0+0 {ForceCompositionPipeline=On}, DP-5: nvidia-auto-select +3840+120 {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

Ok well… please create a new file and let the nvidia driver detect everything:

sudo nano /etc/X11/xorg.conf.d/91-nvidia-emptyinit.conf 

Put this in it:

Section "Device"
	Identifier	"nvidia"
	driver		"nvidia"
	BusID		"PCI:1:0:0"
EndSection

Section "Screen"
    Identifier     "nvidia"
    Device         "nvidia"
    Option         "AllowEmptyInitialConfiguration"
EndSection

Since it is has a higher priority 91, it will be prioritized over 90-mhwd.conf and therefore loaded first.

Restart the display-manager:

sudo systemctl restart display-manager.service

and check the journal:

journalctl --boot 0 --user --grep "\([A-Z][A-Z]\)" --no-hostname --no-pager 

Please post the output here. Thanks.