After Upgrade from 22.04 to 24.04, second monitor won't function - part 2

Ubuntu Version:

24.04.2 LTS

Desktop Environment (if applicable):

Problem Description:

First of all, yes, I KNOW that this is similar to the issue I opened last week that was never resolved, but this situation reasserted itself today after not being a problem for five days. I have more information now about it and I think we can get to a resolution easier with a fresh thread.

This is a Lenovo Thinkpad P16 Gen2 laptop with a NVIDIA RTX 3500 Ada Generation Laptop GPU.

Since the previous thread, I did the following:

  1. restored system to 22.04 LTS. This produced a workable system.
  2. spent two days restoring from a backup.
  3. upon receipt of a message from Lenovo Tech Support that they had a fix for me, I decided to try the upgrade once again.
    I did the following steps:
sudo apt update
sudo apt dist-upgrade

edited /etc/update-manager/release-upgrades to say ā€œLTSā€ instead of ā€œneverā€
sudo do-release-upgrade

This died in the middle. I opened another issue here about this yesterday and was well helped by @bashing-om who showed me how to fix the upgrade with sudo apt --fix-broken install.
This got me going on 24.04.

But @bashing-om gave me another well-intentioned suggestion that created a problem. Basically to do a cleanup.

The result of this caused my dual monitor to stop working. It also removed the nvidia-settings applet.

And here is sit with a non-functional dual monitor.

It seems clear that something in the cleanup process removed something necessary.

I should also mention that two system crash dialogs occur when the system restarts. I would very much like to know what they say. Where can I find them? Details are sent to the ā€œdevelopersā€.

My goal here is to determine what needs to be put back to make this system fully functional with my second monitor again. I am interested in any diagnostics that could help me answer this question.

=======================================

Relevant System Information:

Screenshots or Error Messages:

What I’ve Tried:

I was able to reinstall the nvidia settings applet. This did not help the dual monitor issue but did restore the settings app. This is what it shows:


I also ran the nvidia-smi app and it provides me a clue but I don’t know what it means or how to fix it.

$ nvidia-smi
Tue Apr 15 12:21:53 2025       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.183.01             Driver Version: 535.183.01   CUDA Version: 12.2     |
|-----------------------------------------+----------------------+----------------------+
| 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 RTX 3500 Ada Gene...    Off | 00000000:01:00.0 Off |                  Off |
| N/A   40C    P8               3W / 115W |      6MiB / 12282MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|  No running processes found                                                           |
+---------------------------------------------------------------------------------------+

When the second monitor is working, under ā€œProcessesā€ it shows /usr/lib/xorg/Xorg

But here it says No running processes found.


More info, looks significant but again, unclear what it means.
This Ubuntu documentation page
recommends that I run

~$ cat /proc/driver/nvidia/version
NVRM version: NVIDIA UNIX x86_64 Kernel Module  535.183.01  Sun May 12 19:39:15 UTC 2024
GCC version:

and

$ sudo ubuntu-drivers list
[sudo] password for scohen: 
udevadm hwdb is deprecated. Use systemd-hwdb instead.
udevadm hwdb is deprecated. Use systemd-hwdb instead.
udevadm hwdb is deprecated. Use systemd-hwdb instead.
udevadm hwdb is deprecated. Use systemd-hwdb instead.
udevadm hwdb is deprecated. Use systemd-hwdb instead.
udevadm hwdb is deprecated. Use systemd-hwdb instead.
udevadm hwdb is deprecated. Use systemd-hwdb instead.
udevadm hwdb is deprecated. Use systemd-hwdb instead.
udevadm hwdb is deprecated. Use systemd-hwdb instead.
oem-sutton-barrett-meta

Okay, what is udevadm hwdb and how do I switch it to systemd-hwdb instead?

Let’s get these little things out of the way before refocusing on drivers.
udevadm >> A control mechanism
see: https://www.commandlinux.com/man-page/man8/udevadm.8.html for the details.

ā€œhow do I switch it to systemd-hwdb instead?ā€:
edit the file /usr/lib/python3/dist-packages/UbuntuDrivers/detect.py
per:
https://github.com/canonical/ubuntu-drivers-common/pull/96/commits/0344328cebf87d10e1251af54f2664bd31252852
https://askubuntu.com/questions/1511919/ubuntu-24-04-nvidia-drivers

-Forward Ho ?-

Thanks again.

We’ll get to this tomorrow. I was onto your askubuntu page this afternoon.

However, the info there is not up-to-date (which may be part of the problem).

I wrote my own askubuntu question. Please check it out:

https://askubuntu.com/questions/1545833/more-issues-with-ubuntu-24-04-nvidia-drivers

There’s probably an answer to this, but i didn’t have time to look further. Basically, the detect.py script has changed since it your page was created.

Well –
I do run 24.04 as my daily driver – and the depreciated file:

 try:
        out = subprocess.check_output(['udevadm', 'hwdb', '--test=' + alias],
                                      universal_newlines=True)
    except (OSError, subprocess.CalledProcessError) as e:
        logging.debug('_get_db_name(%s, %s): udevadm hwdb failed: %s', syspath, alias, str(e))
        return (None, None)

which I too will edit to update - at some point.

-hope this helps-

Note that this is just a deprecation warning but will currently not have any functional impact, I’d just ignore it (this is an official tool that gets tested regularly, if the choice of hwdb would actually cause any breakage this would have been caught during testing)

My thinking was I could get the proper list of other drivers I could try installing one. But I can’t get that because of this incompatibility. It also interested me to see that other users with nVidia hardware are having problems getting from 22.04 to 24.04.

Please remember the problem I am trying to solve: a second monitor which the system detects but won’t allow to make functional. I’d be very interested in seeing logs of what happens, particularly of the two system crash notices I get upon boot which are probably related. I’m not just into fixing stuff for its own sake.

Another thing that might help me: this monitor issue began when I ran

sudo apt autoremove

Evidently my system needed something that apt didn’t know I needed. Is there a log of what was removed so I could maybe see what I should reinstall?

Well, the 550 driver did not get enough testing yet which was the reason to limit it’s use to only the very latest cards:

So whatever hacks you apply will get you into uncharted territory… It could work well or not… Alternatively you could just wait until ubuntu-drivers gets it’s official update from the archive with full 550 support

I don’t care now about 550. I want my second monitor back.

Perhaps you can find something in /var/log/dpkg.log and/or /var/log/apt/history.log

1 Like

Thanks!

Bearing in mind what my immediate goal is:

Getting my second monitor working again given that it was working before running sudo apt autoremove

I here offer a pastebin of
$ grep remove /var/log/dpkg.log | pastebinit -b paste.ubuntu.com
https://paste.ubuntu.com/p/YDvxxG5YzD/

Perhaps someone can indicate which removed packages I might try to reinstall? I see lots of nvidia stuff, much of it also tagged with 24.04 in its name.

Or would this be a bad idea?

Is your above posted output for sudo ubuntu-drivers list complete?

Would you post the output of apt list --installed | grep nvidia?

1 Like

The above list is likely not complete due to the problems that were mentioned upthread.

Here is the apt list output you requested. Hope this helps get to the bottom of the issue.

$  apt list --installed | grep nvidia

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libnvidia-compute-535/noble-updates,noble-security,now 535.183.01-0ubuntu0.24.04.1 amd64 [installed,automatic]
linux-modules-nvidia-535-6.8.0-57-generic/noble-updates,noble-security,now 6.8.0-57.59 amd64 [installed,automatic]
linux-objects-nvidia-535-6.5.0-1022-oem/now 6.5.0-1022.23 amd64 [installed,local]
linux-objects-nvidia-535-6.8.0-57-generic/noble-updates,noble-security,now 6.8.0-57.59 amd64 [installed,automatic]
linux-signatures-nvidia-6.5.0-1022-oem/now 6.5.0-1022.23 amd64 [installed,local]
linux-signatures-nvidia-6.8.0-57-generic/noble-updates,noble-security,now 6.8.0-57.59 amd64 [installed,automatic]
nvidia-firmware-535-535.183.01/noble-updates,noble-security,now 535.183.01-0ubuntu0.24.04.1 amd64 [installed,automatic]
nvidia-kernel-common-535/noble-updates,noble-security,now 535.183.01-0ubuntu0.24.04.1 amd64 [installed,automatic]
nvidia-settings/noble,now 510.47.03-0ubuntu4 amd64 [installed]
nvidia-utils-535/noble-updates,noble-security,now 535.183.01-0ubuntu0.24.04.1 amd64 [installed]

In view of the nvidia-smi output in my original post here, the most interesting omission I find in the pastebin above is at line 712.

2025-04-15 11:46:07 remove xserver-xorg-video-nvidia-535:amd64-535.183.01-0ubuntu0.24.04.1 <none>

The nvidia-smi output mentions no processes running, whereas when the monitor works, an XOrg process is mentioned.

$ apt list --installed | grep -i XOrg | grep -i nvidia

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

So nothing like the xserver-xorg-video-nvidia-535 package in the removed list above is now on the system. How might I find the appropriate package to install, and does it need to be specific to 24.04.2?

Also, there are three other 24.04.2 packages that were removed at lines 636, 743, and 802.

Take a look at package nvidia-graphics-drivers-535. It contains many packages not visible on your actual install.

As far as I understood the option -s for apt simulates the action and reports what will be done.
So the command sudo apt reinstall -s nvidia-driver-535 shouldn’t change your system but list things that will be done if running without option -s.

But I may be wrong - trying to help but also learning …

Indeed it does.

However

$ sudo apt reinstall -s nvidia-graphics-drivers-535
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package nvidia-graphics-drivers-535

So I must not have the right repository?

I think the package is named ā€˜nvidia-driver-535’ in apt. At first I got the same difficulties as you …

[Edit]
Sorry for too many edits. It’s getting late…

This was the solution! Thank you! Dual Monitor restored! Woo-hoo.

sudo apt reinstall nvidia-graphics-drivers-535

put back the missing XOrg driver that sudo apt autoremove had erroneously removed.

$ nvidia-smi
Wed Apr 16 12:23:38 2025       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.183.01             Driver Version: 535.183.01   CUDA Version: 12.2     |
|-----------------------------------------+----------------------+----------------------+
| 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 RTX 3500 Ada Gene...    Off | 00000000:01:00.0  On |                  Off |
| N/A   40C    P8               9W / 115W |    175MiB / 12282MiB |      6%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A      2986      G   /usr/lib/xorg/Xorg                          171MiB |
+---------------------------------------------------------------------------------------+

now shows the XOrg process running, which is evidently necessary to get the second monitor to work.

Moral: Don’t run sudo apt autoremove, especially if you have an nVidia graphics card!

1 Like

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