System lag and slow rendering on both primary and external monitors when run on NVIDIA card

My laptop has an HDMI hard wired to NVIDIA card. I couldn’t get it working on dual mode and thus switched to NVIDIA for both primary and external. However, since last few days, this setup has become extremely slow and laggy. I can’t seem to run even simple tasks. Can someone help with this?
I am running i3wm

nvidia-smi
Wed Sep 28 11:55:28 2022       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 515.65.01    Driver Version: 515.65.01    CUDA Version: 11.7     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  On   | 00000000:01:00.0 Off |                  N/A |
| N/A   41C    P8    N/A /  N/A |      1MiB /  4096MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+
                                                                               
+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|  No running processes found                                                 |
+-----------------------------------------------------------------------------+
inxi --admin --verbosity=7 --filter --no-host --width
inxi --admin --verbosity=7 --filter --no-host --width
System:
  Kernel: 5.19.7-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-5.19-x86_64
    root=UUID=54e0495f-71f5-4922-a37e-2055e714e5d1 rw quiet apparmor=1
    security=apparmor udev.log_priority=3 nvidia_drm.modeset=1
  Desktop: i3 v: 4.20.1 info: i3bar vt: 7 dm: LightDM v: 1.32.0
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Laptop System: Acer product: Nitro AN515-52 v: V1.28
    serial: <superuser required>
  Mobo: CFL model: Freed_CFS v: V1.28 serial: <superuser required>
    UEFI: Insyde v: 1.28 date: 08/05/2019
Memory:
  RAM: total: 7.61 GiB used: 3.85 GiB (50.7%)
  RAM Report: permissions: Unable to run dmidecode. Root privileges
    required.
CPU:
  Info: model: Intel Core i7-8750H bits: 64 type: MT MCP arch: Coffee Lake
    gen: core 8 level: v3 built: 2018 process: Intel 14nm family: 6
    model-id: 0x9E (158) stepping: 0xA (10) microcode: 0xF0
  Topology: cpus: 1x cores: 6 tpc: 2 threads: 12 smt: enabled cache:
    L1: 384 KiB desc: d-6x32 KiB; i-6x32 KiB L2: 1.5 MiB desc: 6x256 KiB
    L3: 9 MiB desc: 1x9 MiB
  Speed (MHz): avg: 1850 high: 2200 min/max: 800/2200 scaling:
    driver: intel_pstate governor: powersave cores: 1: 2200 2: 2200 3: 2200
    4: 2200 5: 2200 6: 800 7: 2200 8: 2200 9: 2200 10: 800 11: 800 12: 2200
    bogomips: 52815
  Flags: 3dnowprefetch abm acpi adx aes aperfmperf apic arat
    arch_capabilities arch_perfmon art avx avx2 bmi1 bmi2 bts clflush
    clflushopt cmov constant_tsc cpuid cpuid_fault cx16 cx8 de ds_cpl dtes64
    dtherm dts epb ept ept_ad erms est f16c flexpriority flush_l1d fma fpu
    fsgsbase fxsr ht hwp hwp_act_window hwp_epp hwp_notify ibpb ibrs ida
    intel_pt invpcid invpcid_single lahf_lm lm mca mce md_clear mmx monitor
    movbe mpx msr mtrr nonstop_tsc nopl nx pae pat pbe pcid pclmulqdq pdcm
    pdpe1gb pebs pge pln pni popcnt pse pse36 pti pts rdrand rdseed rdtscp
    rep_good sdbg sep smap smep ss ssbd sse sse2 sse4_1 sse4_2 ssse3 stibp
    syscall tm tm2 tpr_shadow tsc tsc_adjust tsc_deadline_timer vme vmx vnmi
    vpid x2apic xgetbv1 xsave xsavec xsaveopt xsaves xtopology xtpr
  Vulnerabilities:
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT
    vulnerable
  Type: mds mitigation: Clear CPU buffers; SMT vulnerable
  Type: meltdown mitigation: PTI
  Type: mmio_stale_data mitigation: Clear CPU buffers; SMT vulnerable
  Type: retbleed mitigation: IBRS
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via
    prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer
    sanitization
  Type: spectre_v2 mitigation: IBRS, IBPB: conditional, RSB filling,
    PBRSB-eIBRS: Not affected
  Type: srbds mitigation: Microcode
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel CoffeeLake-H GT2 [UHD Graphics 630] vendor: Acer
    Incorporated ALI driver: i915 v: kernel arch: Gen-9.5 process: Intel 14nm
    built: 2016-20 ports: active: eDP-1 empty: none bus-ID: 00:02.0
    chip-ID: 8086:3e9b class-ID: 0300
  Device-2: NVIDIA GP107M [GeForce GTX 1050 Ti Mobile] vendor: Acer
    Incorporated ALI driver: nvidia v: 515.65.01 alternate: nouveau,nvidia_drm
    non-free: 515.xx+ status: current (as of 2022-08) arch: Pascal code: GP10x
    process: TSMC 16nm built: 2016-21 pcie: gen: 1 speed: 2.5 GT/s lanes: 16
    link-max: gen: 3 speed: 8 GT/s bus-ID: 01:00.0 chip-ID: 10de:1c8c
    class-ID: 0300
  Device-3: Quanta HD Webcam type: USB driver: uvcvideo bus-ID: 1-5:3
    chip-ID: 0408:a060 class-ID: 0e02 serial: <filter>
  Display: x11 server: X.Org v: 21.1.4 compositor: Picom v: git-7e568
    driver: X: loaded: modesetting unloaded: intel alternate: fbdev,vesa
    gpu: i915 display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.00x11.22")
    s-diag: 582mm (22.93")
  Monitor-1: eDP-1 model: LG Display 0x05d8 built: 2018 res: 1920x1080
    hz: 60 dpi: 142 gamma: 1.2 size: 344x194mm (13.54x7.64") diag: 395mm (15.5")
    ratio: 16:9 modes: 1920x1080
  OpenGL: renderer: Mesa Intel UHD Graphics 630 (CFL GT2) v: 4.6 Mesa 22.1.7
    direct render: Yes
Audio:
  Device-1: Intel Cannon Lake PCH cAVS vendor: Acer Incorporated ALI
    driver: snd_hda_intel v: kernel alternate: snd_soc_skl,snd_sof_pci_intel_cnl
    bus-ID: 00:1f.3 chip-ID: 8086:a348 class-ID: 0403
  Device-2: NVIDIA GP107GL High Definition Audio vendor: Acer Incorporated
    ALI driver: snd_hda_intel v: kernel pcie: gen: 1 speed: 2.5 GT/s lanes: 16
    link-max: gen: 3 speed: 8 GT/s bus-ID: 01:00.1 chip-ID: 10de:0fb9
    class-ID: 0403
  Sound Server-1: ALSA v: k5.19.7-1-MANJARO running: yes
  Sound Server-2: JACK v: 1.9.21 running: no
  Sound Server-3: PulseAudio v: 16.1 running: yes
  Sound Server-4: PipeWire v: 0.3.57 running: yes
Network:
  Device-1: Intel Cannon Lake PCH CNVi WiFi driver: iwlwifi v: kernel
    bus-ID: 00:14.3 chip-ID: 8086:a370 class-ID: 0280
  IF: wlp0s20f3 state: up mac: <filter>
  IP v4: <filter> type: dynamic noprefixroute scope: global
    broadcast: <filter>
  IP v6: <filter> type: noprefixroute scope: link
  Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Acer Incorporated ALI driver: r8169 v: kernel pcie: gen: 1
    speed: 2.5 GT/s lanes: 1 port: 3000 bus-ID: 06:00.1 chip-ID: 10ec:8168
    class-ID: 0200
  IF: enp6s0f1 state: down mac: <filter>
  WAN IP: <filter>
Bluetooth:
  Device-1: Intel Bluetooth 9460/9560 Jefferson Peak (JfP) type: USB
    driver: btusb v: 0.8 bus-ID: 1-14:4 chip-ID: 8087:0aaa class-ID: e001
  Report: rfkill ID: hci0 rfk-id: 3 state: down bt-service: enabled,running
    rfk-block: hardware: no software: yes address: see --recommends
Logical:
  Message: No logical block device data found.
RAID:
  Hardware-1: Intel 82801 Mobile SATA Controller [RAID mode] driver: ahci
    v: 3.0 port: 5060 bus-ID: 00:17.0 chip-ID: 8086:282a rev: N/A class-ID: 0104
Drives:
  Local Storage: total: 1.03 TiB used: 739.56 GiB (70.4%)
  SMART Message: Required tool smartctl not installed. Check --recommends
  ID-1: /dev/sda maj-min: 8:0 vendor: SK Hynix model: HFS128G39TND-N210A
    size: 119.24 GiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
    type: SSD serial: <filter> rev: 1P10 scheme: GPT
  ID-2: /dev/sdb maj-min: 8:16 vendor: HGST (Hitachi) model: HTS721010A9E630
    size: 931.51 GiB block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s
    type: HDD rpm: 7200 serial: <filter> rev: A3J0 scheme: GPT
  Message: No optical or floppy data found.
Partition:
  ID-1: / raw-size: 118.95 GiB size: 116.52 GiB (97.96%) used: 73.13 GiB
    (62.8%) fs: ext4 dev: /dev/sda2 maj-min: 8:2 label: N/A
    uuid: 54e0495f-71f5-4922-a37e-2055e714e5d1
  ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%) used: 292 KiB
    (0.1%) fs: vfat dev: /dev/sda1 maj-min: 8:1 label: NO_LABEL
    uuid: 5AF8-F547
  ID-3: /run/media/naveed/D raw-size: 296.02 GiB size: 296.02 GiB (100.00%)
    used: 164.33 GiB (55.5%) fs: ntfs dev: /dev/sdb1 maj-min: 8:17 label: D
    uuid: 82D2A4F6D2A4F019
  ID-4: /run/media/naveed/E raw-size: 342.52 GiB size: 342.52 GiB (100.00%)
    used: 273.44 GiB (79.8%) fs: ntfs dev: /dev/sdb2 maj-min: 8:18 label: E
    uuid: 8444F7B644F7A956
  ID-5: /run/media/naveed/F raw-size: 192.34 GiB size: 192.34 GiB (100.00%)
    used: 192.15 GiB (99.9%) fs: ntfs dev: /dev/sdb7 maj-min: 8:23
    label: New Volume uuid: 065C6E8D5C6E7779
  ID-6: /run/media/naveed/G raw-size: 100 GiB size: 100 GiB (100.00%)
    used: 36.52 GiB (36.5%) fs: ntfs dev: /dev/sdb6 maj-min: 8:22 label: N/A
    uuid: C08AED308AED241E
Swap:
  Alert: No swap data was found.
Unmounted:
  ID-1: /dev/sdb3 maj-min: 8:19 size: 529 MiB fs: ntfs label: N/A
    uuid: 96C25E7CC25E6113
  ID-2: /dev/sdb4 maj-min: 8:20 size: 100 MiB fs: vfat label: N/A
    uuid: F2DA-AC74
  ID-3: /dev/sdb5 maj-min: 8:21 size: 16 MiB fs: <superuser required>
    label: N/A uuid: N/A
USB:
  Hub-1: 1-0:1 info: Hi-speed hub with single TT ports: 16 rev: 2.0
    speed: 480 Mb/s chip-ID: 1d6b:0002 class-ID: 0900
  Device-1: 1-1:2 info: Areson Corp 2.4G Receiver type: Keyboard,Mouse
    driver: hid-generic,usbhid interfaces: 2 rev: 1.1 speed: 12 Mb/s
    power: 100mA chip-ID: 25a7:fa23 class-ID: 0301
  Device-2: 1-5:3 info: Quanta HD Webcam type: Video driver: uvcvideo
    interfaces: 2 rev: 2.0 speed: 480 Mb/s power: 500mA chip-ID: 0408:a060
    class-ID: 0e02 serial: <filter>
  Device-3: 1-14:4 info: Intel Bluetooth 9460/9560 Jefferson Peak (JfP)
    type: Bluetooth driver: btusb interfaces: 2 rev: 2.0 speed: 12 Mb/s
    power: 100mA chip-ID: 8087:0aaa class-ID: e001
  Hub-2: 2-0:1 info: Super-speed hub ports: 8 rev: 3.1 speed: 10 Gb/s
    chip-ID: 1d6b:0003 class-ID: 0900
Sensors:
  System Temperatures: cpu: 39.0 C pch: 50.0 C mobo: N/A
  Fan Speeds (RPM): N/A
Info:
  Processes: 301 Uptime: 1h 5m wakeups: 1 Init: systemd v: 251
  default: graphical tool: systemctl Compilers: gcc: 12.2.0 clang: 14.0.6
  Packages: 1425 pm: pacman pkgs: 1419 libs: 369 tools: pamac,yay pm: snap
  pkgs: 6 Shell: Bash v: 5.1.16 running-in: kitty inxi: 3.3.21

mhwd --list
> 0000:01:00.0 (0300:10de:1c8c) Display controller nVidia Corporation:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-intel-nvidia-prime            2021.11.04               false            PCI
video-hybrid-intel-nvidia-470xx-prime            2021.11.04               false            PCI
video-hybrid-intel-nvidia-390xx-bumblebee            2021.11.26               false            PCI
          video-nvidia            2021.11.04               false            PCI
    video-nvidia-470xx            2021.11.04               false            PCI
    video-nvidia-390xx            2021.11.26               false            PCI
           video-linux            2018.05.04                true            PCI
     video-modesetting            2020.01.13                true            PCI
            video-vesa            2017.03.12                true            PCI


> 0000:00:02.0 (0300:8086:3e9b) Display controller Intel Corporation:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
video-hybrid-intel-nvidia-prime            2021.11.04               false            PCI
video-hybrid-intel-nvidia-470xx-prime            2021.11.04               false            PCI
video-hybrid-intel-nvidia-390xx-bumblebee            2021.11.26               false            PCI
           video-linux            2018.05.04                true            PCI
     video-modesetting            2020.01.13                true            PCI
            video-vesa            2017.03.12                true            PCI


> 0000:06:00.1 (0200:10ec:8168) Network controller Realtek Semiconductor Co., Ltd.:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
         network-r8168            2016.04.20                true            PCI

mhwd --listinstalled
> Installed PCI configs:
--------------------------------------------------------------------------------
                  NAME               VERSION          FREEDRIVER           TYPE
--------------------------------------------------------------------------------
           video-linux            2018.05.04                true            PCI
     video-modesetting            2020.01.13                true            PCI
video-hybrid-intel-nvidia-prime            2021.12.18               false            PCI


Warning: No installed USB configs!

Hi @kramer,

Quickly it sounds like a driver issue. However, to diagnose this more accurately more information is necessary. To that end, please see:

Hope you manage!


Tip:

To provide terminal output, copy the text you wish to share, and paste it here, surrounded by three (3) backticks, a.k.a grave accents. Like this:

```

pasted text

```

This will just cause it to be rendered like this:

Portaest sed
elementum
cursus nisl nisi
hendrerit ac quis
sit
adipiscing
tortor sit leo commodo.

Instead of like this:

Portaest sed elementum cursus nisl nisi hendrerit ac quis sit adipiscing tortor sit leo commodo.

Alternatively, paste the text you wish to format as terminal output, select all pasted text, and click the </> button on the taskbar. This will indent the whole pasted section with one TAB, causing it to render the same way as described above.

Thereby improving legibility and making it much easier for those trying to be of assistance.

Please edit your post accordingly.

edited the post with some output

The output of:

inxi --admin --verbosity=7 --filter --no-host --width

…is still missing. Additionally, please also provide the outputs for:

mhwd --listinstalled

and:

mhwd --list

updated

Thank you.

Now let’s see if removing and reinstalling the drivers work. I’m not sure if it will, but I’, figuring it’s worth a try.

First remove all installed drivers:

mhwd --remove video-linux
mhwd --remove video-modesetting

and then, finally,

mhwd --remove video-hybrid-intel-nvidia-prime

I know it might be tempting, but do not reboot.

Now, auto install the best one:

sudo mhwd --install --auto pci nonfree 0300

If there were no errors, feel free to reboot and see if it worked. If, however, there were errors, do not reboot. Instead report back with the errors.

getting errors with delete.

mhwd --remove video-modesetting
Error: invalid use of option: -r/--remove

Then it seems you can skip that one.

happens with all three removals. Not limited to one.
it also gives error with install.
Error: invalid use of option: -i/--install
Strange

Oh. OH!

My mistake. Try with sudo:

For removing:

sudo mhwd --remove video-linux
sudo mhwd --remove video-modesetting

and:

sudo mhwd --remove video-hybrid-intel-nvidia-prime

Then reinstalling:

sudo sudo mhwd --install --auto pci nonfree 0300

Used this page as reference:

Same errors with sudo. Don’t think sudo is the problem

Got it. Had to do

sudo mhwd --remove pci video-hybrid-intel-nvidia-prime

However, it fails

Sourcing /etc/mhwd-x86_64.conf
Has lib32 support: true
Sourcing /var/lib/mhwd/local/pci/video-hybrid-intel-nvidia-prime/MHWDCONFIG
Processing classid: 0300
Sourcing /var/lib/mhwd/scripts/include/0300
checking dependencies...
error: failed to prepare transaction (could not satisfy dependencies)
:: removing libxnvctrl breaks dependency 'libxnvctrl' required by conky
:: removing libxnvctrl breaks dependency 'libXNVCtrl.so=0-64' required by conky
Error: pacman failed!
Error: script failed!

was able to remove video-linux, not the others due to dependencies

Thank you! And congrats for figuring it out!

Edit:

Well, you could always make a backup of your conky config:

cp ~/.config/conky ~/.config/conky.backup

Then remove conky:

pamac remove conky

Followed by removing the driver, installing the new one, and rebooting. As previously described.

If all is then well, you can reinstall conky:

pamac install conky

If all is as it should be, then, feel free too remover the conky backup we created earlier:

rm -r ~/.config/conky.backup

what about the second part? Still not able to delete the last two

Edited.

Install doesn’t work.

sudo mhwd -a pci nonfree 0300
Sourcing /etc/mhwd-x86_64.conf
Has lib32 support: true
Sourcing /var/lib/mhwd/db/pci/graphic_drivers/hybrid-intel-nvidia-prime/MHWDCONFIG
Processing classid: 0300
Sourcing /var/lib/mhwd/scripts/include/0300
:: Synchronizing package databases...
 core downloading...
 extra downloading...
 community downloading...
 multilib downloading...
 DEB_Arch_Extra downloading...
error: target not found: linux513-nvidia
Error: pacman failed!
Error: script failed!

It would seem the kernel you are using is EOL. So you’ll need to switch to a newer one.

So, install said newer one:

sudo mhwd-kernel --install linux515

And then try the above command again:

sudo mhwd --install --auto pci nonfree 0300

And provide the output please.

How can i switch kernels without rebooting? :man_facepalming: anyways i did, and now i am stuck without the x server starting.
Even then the command doesn’t work

I don’t think it’s possible.

Anyway, you can always boot from a live USB, preferable with a relatively new kernel, enter a chroot environment, and install the drivers from there…

Sorry to be blunt, but your advice has led me nowhere. And instead i am stuck outside my system
:man_facepalming: