How to properly install the nvidia-open-dkms drivers?

I have been having issues for a very long time where my laptop would not wake up from sleep. I have posted several threads on this forum regarding this issue. Many solutions have been offered, but the problem was never solved [1].

The laptop (Thinkpad P52) has an nvidia gpu through which external monitors are connected. All the cases for which the laptop fails to wake from sleep happen after putting the laptop to sleep when connected to an external monitor, disconnecting the monitor, and then waking the laptop back up. This is not something I can reproduce, but when the laptop fails to wake up from sleep, it is always after disconnecting the external monitor.

The causes of this issue could be related to the nvidia drivers. I have tried rolling back to older drivers, but the problem persisted. I have decided to try out the nvidia-open-dkms driver, and installed it via the command nvidia-inst -o. It installed successfully. This is the first time I am using this driver, so I have no idea what to expect. Is the driver installed successfully, is it loaded? At the moment, there’s something wrong since I can no longer encode my videos using the h264-nvec codec in ffmpeg or kdenlive. I need some help to solve this issue.

~ ❯ lspci -k | grep -A 2 -E "(VGA|3D)"
libkmod: kmod_config_parse: /etc/modprobe.d/nvidia-power-management.conf line 1: ignoring bad line starting with '#'
00:02.0 VGA compatible controller: Intel Corporation Coffee Lake-S GT2 [UHD Graphics P630]
	Subsystem: Lenovo Device 225f
	Kernel driver in use: i915
--
01:00.0 VGA compatible controller: NVIDIA Corporation GP107GLM [Quadro P2000 Mobile] (rev a1)
	Subsystem: Lenovo Device 225f
	Kernel modules: nouveau, nvidia_drm, nvidia



~ ❯ nvidia-settings                                 

ERROR: NVIDIA driver is not loaded


(nvidia-settings:4130): GLib-GObject-CRITICAL **: 16:23:33.410: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

** (nvidia-settings:4130): CRITICAL **: 16:23:33.411: ctk_powermode_new: assertion '(ctrl_target != NULL) && (ctrl_target->h != NULL)' failed

ERROR: nvidia-settings could not find the registry key file or the X server is not accessible. This
       file should have been installed along with this driver at
       /usr/share/nvidia/nvidia-application-profiles-key-documentation. The application profiles will
       continue to work, but values cannot be prepopulated or validated, and will not be listed in the
       help text. Please see the README for possible values and descriptions.

sudo pacman -S nvidia-dkms
is all I have ever done when doing it manual.

There also is the package nvidia-open-dkms. Not sure if that’s what you are looking for?

Edit: Your output shows it’s running on nouveau open source driver. Also this error.

/etc/modprobe.d/nvidia-power-management.conf line 1: ignoring bad line starting with '#'

What do commands

pacman -Q | grep nvidia
lsmod | grep nvidia
inxi -Gzac0

show?

I have removed the nvidia-open-dkms driver and went with the propertiery one.

I did:

sudo pacman -S nvidia-dkms nvidia-settings nvidia-utils

Meanwhile,

sudo pacman -S nvidia-open-dkms nvidia-settings nvidia-utils

reported that the driver was not loaded.