Can't use nvidia-drivers on Ubuntu 22.04 with Geforce 940M (Zenbook UX303)

EDIT: see my second post as I managed to boot on a specific version of the kernel.

I can’t get the nvidia drivers to work with a Geforce 940M on Ubuntu 22.04 with linux kernel 6.5.0-26-generic and 6.2.0-39-generic. The laptop is a Asus Zenbook UX303, so it has also the Intel graphics (HD Graphics 520).

Each time I try to install an other driver, the screen seems to be freezed just after Plymouth asks for a passphrase to decrypt the disk, or, sometimes, I can get to a terminal. I tried various GRUB options like nomodeset i915.nomodeset nouveau.modeset=0, etc. Only acpi=off allowed me to get to a slow graphical interface.

When logged in, nvidia-smi failed because it couldn’t communicate with the driver or gave me this:

Failed to initialize NVML: Driver/library version mismatch

I tried this:

  1. a standard ubuntu-drivers install (which defaults to 535)
  2. the same command with various versions (470 and 550, this one with the PPA graphics-drivers)
  3. a manual install, as presented in https://ubuntu.com/server/docs/nvidia-drivers-installation following the Building your own kernel modules using the NVIDIA DKMS package part

With no success.

This is the output of ubuntu-drivers devices:

== /sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0 ==
modalias : pci:v000010DEd00001347sv00001043sd00001B1Dbc03sc02i00
vendor   : NVIDIA Corporation
model    : GM108M [GeForce 940M]
driver   : nvidia-driver-450-server - distro non-free
driver   : nvidia-driver-470 - distro non-free
driver   : nvidia-driver-470-server - distro non-free
driver   : nvidia-driver-545 - distro non-free
driver   : nvidia-driver-525 - distro non-free
driver   : nvidia-driver-525-server - distro non-free
driver   : nvidia-driver-390 - distro non-free
driver   : nvidia-driver-535 - distro non-free recommended
driver   : nvidia-driver-535-server - distro non-free
driver   : nvidia-driver-418-server - distro non-free
driver   : xserver-xorg-video-nouveau - distro free builtin

I managed to generate two bug-reports (with different kernel/driver versions but not sure which one is which right now …

nvidia-bug-report-1.log.gz (137.0 KB)
nvidia-bug-report-2.log.gz (107.8 KB)

I’m a bit lost about what to do now, any ideas?
Tell me if something isn’t clear, I’ll do my best to clarify this :)

Okay, I need to update my first post. Seeing some strange nvidia leftover package, I tried to remove it and did 2 other tentatives:

  1. manually install the 470 on 4.5 and 4.2 kernels
  2. ubuntu official method with 535 and the same kernels

With both, I can’t boot on the 4.5 kernel but it works with 4.2 kernel.

nvidia-driver-470

nvidia-settings warned me about this:

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.

I followed this solution: ERROR: nvidia-settings could not find the registry key file - #3 by geoffrey.hoffman

There is a strange message but it seems okay (see: PRIME not supported after installing nvidia-driver-470 for Ubuntu 20.04 LTS):

$ nvidia-settings
[...]
** Message: 10:19:04.177: PRIME: No offloading required. Abort
** Message: 10:19:04.177: PRIME: is it supported? no
$ nvidia-smi
Failed to initialize NVML: Driver/library version mismatch

Well in /var/log/kern.log I got:

Mar 25 10:16:09 Noisette kernel: [  377.287961] NVRM: API mismatch: the client has the version 470.239.06, but
Mar 25 10:16:09 Noisette kernel: [  377.287961] NVRM: this kernel module has the version 470.223.02.  Please
Mar 25 10:16:09 Noisette kernel: [  377.287961] NVRM: make sure that this kernel module and all NVIDIA driver
Mar 25 10:16:09 Noisette kernel: [  377.287961] NVRM: components have the same version.

I tried this

sudo dkms remove nvidia/470.239.06 --all
sudo dkms --force install nvidia/470.239.06 -k 6.2.0-39-generic

But even after a reboot, the same error appears.

nvidia-bug-report.470.log.gz (136.3 KB)

nvidia-driver-535

With the ubuntu-drivers tool, this is what I get:

NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

nvidia-bug-report.535.log.gz (111.9 KB)

Please delete /etc/X11/xorg.conf and boot the 6.5 kernel. The 6.2 kernel is an old leftover and doesn’t have headers installed so there’s no nvidia driver. Don’t set “nomodeset”.

1 Like

Thanks, it works ! I suppose that deleting /etc/X11/xorg.conf was the solution as I already removed nomodeset.

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