MSI Laptop / Ubuntu 22.04 / xorg - nvidia driver not loaded

Hello everyone, I have MSI laptop, intel/nvidia cards.
Ubuntu installed after windows if it matters.
Secure boot / fast boot disabled in uefi.
Initially Ubuntu suspend was not working because some modprobe (probbly nvidia) was failing to suspend.
I switched from Wayland to Xorg and purged/reinstalled nvidia drivers, now suspending work, but still not nvidia driver as seen from terminal when starting nvidia-settings:

~$ nvidia-settings

ERROR: NVIDIA driver is not loaded

(nvidia-settings:34389): GLib-GObject-CRITICAL **: 17:31:15.791: g_object_unref: assertion ‘G_IS_OBJECT (object)’ failed

** (nvidia-settings:34389): CRITICAL **: 17:31:15.793: 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.

** Message: 17:31:15.814: PRIME: Requires offloading
** Message: 17:31:15.815: PRIME: is it supported? yes
** Message: 17:31:15.834: PRIME: Usage: /usr/bin/prime-select nvidia|intel|on-demand|query
** Message: 17:31:15.834: PRIME: on-demand mode: “1”
** Message: 17:31:15.834: PRIME: is “on-demand” mode supported? yes

I can switch between nvidia / ondemand in nvidia settings GUI or using nvidia-prime but it has no effect and as I remember when driver is loaded - in nvidia settings there should be siome info about GPU, not it’s missing.

My /etc/gdm3/custom.conf

[daemon]
AutomaticLoginEnable=true
AutomaticLogin=gor

# Uncomment the line below to force the login screen to use Xorg
WaylandEnable=false

/lib/modprobe.d/blacklist-nvidia.conf doesn’t exist

My GRUB config:

GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_sleep=nonvs acpi_osi=Linux"
GRUB_CMDLINE_LINUX=""

I was trying add “pci=realloc”
both with acpi_sleep=nonvs acpi_osi=Linux and without (which I added trying to fix suspend issue)
But with pci=realloc system fails to boot, shows some “audit” staff in the boot log forever.

nvidia-bug-report.log.gz (496.1 KB)

Nvidia bug report attached.

I also checked in Windows, card seems to work.
Attaching GPU-Z from windows, and some more logs from ubuntu.


journalctl.log (1.8 MB)
dmesg.log (264.1 KB)

Update: I’ve managed to boot with “pci=realloc” - to do so I had to switch from “UEFI with csm” to just UEFI (secure boot off in all cases), boot in recovery mode, purge all the nvidia reboot successfully on default driver and install nvidia again.
Now it can boot with pci=realloc.

Btw I found in journalctl a lot of errors regarding permission for some /var/run/nvidia-persistenced dir, it was actually missing.
So I created one and did chown -R nvidia-persistenced:nvidia-persistenced /var/run/nvidia-persistenced.
After that or after I reinstalled drivers NVIDIA Persistence Daemon is starting fine, journalctl looks better (attached)

But after all it doesn’t help, still driver was not loaded and it’s still a mess in dmesg.
Just in case, generated buf report again, maybe there is some progress already.

dmesg.log (115.2 KB)
journalctl.log (5.4 KB)
nvidia-bug-report.log.gz (2.2 MB)

More update, as I found with “pci=realloc” it sometimes boots, sometimes stuck with failing blutooth, sometimes stuck with infinite “audit” log messages appending, so I had to remove “pci=realloc”.
Please help, what else should I try


Most if not all recent msi notebooks have the same bios bug, the nvidia gpu will only be accessible with pci=realloc.
You have the wrong driver installed. Please use Software & Updates to switch to the non “-open” driver version.
Please check for a bios update, maybe msi fixed things meanwhile.
Please create a new nvidia-bug-report.log after installing the correct driver.

1 Like

I tried already not open version also tried to switch to older driver version and it was not working.
But as soon as you replied and I did switch again to non-open 525 and added pci=realloc to grub - it started working, you probably scared my laptop so it started behaving.

Only thing when I start nvidia-settings I see in terminal:

nvidia-settings

(nvidia-settings:3626): GLib-GObject-CRITICAL **: 16:33:19.789: g_object_unref: assertion ‘G_IS_OBJECT (object)’ failed
** Message: 16:33:19.907: PRIME: Requires offloading
** Message: 16:33:19.907: PRIME: is it supported? yes
** Message: 16:33:19.927: PRIME: Usage: /usr/bin/prime-select nvidia|intel|on-demand|query
** Message: 16:33:19.927: PRIME: on-demand mode: “1”
** Message: 16:33:19.927: PRIME: is “on-demand” mode supported? yes

But I see all the video-related details in settings app.
Can I safely ignore this GLib-GObject-CRITICAL?
Just in case attaching fresh bug report.
nvidia-bug-report.log.gz (6.0 MB)

Yes, it’s always displayed.
The logs look clean now.

Thanks a lot!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.