Ubuntu 18.04 after installing NVIDIA graphics drivers still getting lag

8,476

OK now i can say this is 95% solved,

∘ 1/ The real problem comes down to Refresh Rate and Sync Rate of the Nvidia card and the screen(s)

‣ With nvidia-prime then there is no possibility of vsync yet - arghhhh

With Nvidia's drivers for linux and"Optimus" cards they left out the simple code to do this to save resources for the masses - STUPID!!!!!

‣ Get PRIME Synchronization on Optimus

Solution (now for none specific Nvidia Drivers - AWESOME!)

To check if it (Synchronization) is set or not set use this command:

sudo cat /sys/module/nvidia_drm/parameters/modeset

∘ It should say "y" for modeset=1, which means it is synchronized at 60 fps (I believe) for your Monitor.  ...  ex. HDMI-1-1, or  eDP-1-1

∘ If Not - Create a new file in  /etc/modprobe.d/nvidia-drm-nomodeset.conf 

sudo gedit /etc/modprobe.d/nvidia-drm-nomodeset.conf

∘ and make sure the following line is present;

options nvidia-drm modeset=1 ∘ after Update Intramfs and Reboot

sudo update-initramfs -u • reboot

ALSO reducing Swappiness may help to lower swappiness also (if you have lots of RAM)...

∘ To check the swappiness value (default=60)

$ cat /proc/sys/vm/swappiness

sudo gedit /etc/sysctl.conf

‣ Search for vm.swappiness and change its value as desired. If vm.swappiness does not exist, add it to the end of the file like so:

# sharply reduce Swappiness inclination

vm.swappiness=1

Share:
8,476

Related videos on Youtube

yeah_oh_yeah
Author by

yeah_oh_yeah

Updated on September 18, 2022

Comments

  • yeah_oh_yeah
    yeah_oh_yeah almost 2 years

    I have a GTX 750 ti and I'm using Ubuntu 18.04. I have never had problems before with graphics drivers not working well. So before I installed drivers, I was getting massive amounts of screen tearing and lag. Afterwards, I still notice a lot of lag in animations (clicking "Show Applications", maximizing windows, minimizing windows, etc.) and sometimes when moving windows around or resizing them. When scrolling through web pages on browsers it will lag and I notice screen tearing. I have tried installing many different drivers, including the nvidia-375 and nvidia-384 drivers that are in the default Ubuntu repository. I also tried using drivers from the Graphics Drivers repo (https://launchpad.net/~graphics-drivers/+archive/ubuntu/ppa). No matter what I do, it never gets rid of lag in the animations or screen tearing within browsers.

    • Terrance
      Terrance about 6 years
      Have you removed all 3rd party repositories that deal with video drivers and just tried installing the nvidia-drivers-390 from the Ubuntu repositories instead? I could not get the graphics-drivers ppa to work properly. The only ones were from Ubuntu themselves.
    • Cleb
      Cleb about 6 years
      For me sudo ubuntu-drivers autoinstall did the job. Check this link for more options.
    • Alexandre V.
      Alexandre V. almost 6 years
      Removing all 3rd party repos and reinstalling nvidia-drivers-390 does not solve the issue.
  • yeah_oh_yeah
    yeah_oh_yeah over 5 years
    after doing "sudo gedit /etc/modprobe.d/nvidia-drm-nomodeset.conf" and then adding the line "options nvidia-drm modeset=1" i get stuck on a black screen with the line "/dev/sdc1: clean" and it wont boot into the OS
  • yeah_oh_yeah
    yeah_oh_yeah over 5 years
    So I’m able to access the command line, but not the operating system GUI stuff. I see that when I do “sudo cat /sys/module/nvidia_drm/parameters/modeset” it now returns “Y”
  • rvalue
    rvalue about 4 years
    please don't change vm.swappiness if "having lots of RAM" is your justification; it does not change what you think it changes