Nvidia 340 Xorg driver is installed but not loaded after OS upgrade

Bug #1946987 reported by Jarno Suni
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
nvidia-graphics-drivers-340 (Ubuntu)
Undecided
Unassigned

Bug Description

I tried both nouveau and nvidia-340 drivers. It used to work at least by the latter one in Xubuntu 18.04, even with HWE kernel

When using the nvidia-340 driver:
$ xrandr
xrandr: Failed to get size of gamma for output default
Screen 0: minimum 1920 x 1200, current 1920 x 1200, maximum 1920 x 1200
default connected 1920x1200+0+0 0mm x 0mm
   1920x1200 77.00*

A device is connected in HDMI and xrand does not even list the connector. When using nouveau, HDMI is listed but it shows as disconnected.

WORKAROUND when using nvidia driver:
Log out of session. Then lightdm screen shows on both monitors. And if I then log in to a session, the extrernal monitor works there, too.

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: xorg 1:7.7+19ubuntu14
ProcVersionSignature: Ubuntu 5.4.0-88.99-generic 5.4.140
Uname: Linux 5.4.0-88-generic x86_64
NonfreeKernelModules: nvidia
.proc.driver.nvidia.gpus.0000.01.00.0: Error: path was not a regular file.
.proc.driver.nvidia.registry: Binary: ""
.proc.driver.nvidia.version:
 NVRM version: NVIDIA UNIX x86_64 Kernel Module 340.108 Wed Dec 11 11:06:58 PST 2019
 GCC version: gcc version 9.3.0 (Ubuntu 9.3.0-17ubuntu1~20.04)
.proc.driver.nvidia.warnings.fbdev:
 Your system is not currently configured to drive a VGA console
 on the primary VGA device. The NVIDIA Linux graphics driver
 requires the use of a text-mode VGA console. Use of other console
 drivers including, but not limited to, vesafb, may result in
 corruption and stability problems, and is not supported.
ApportVersion: 2.20.11-0ubuntu27.20
Architecture: amd64
BootLog: Error: [Errno 13] Permission denied: '/var/log/boot.log'
CasperMD5CheckResult: skip
CompositorRunning: None
CurrentDesktop: XFCE
Date: Wed Oct 13 16:27:00 2021
DistUpgraded: 2021-10-13 15:24:05,135 DEBUG Running PostInstallScript: '/usr/lib/ubuntu-advantage/upgrade_lts_contract.py'
DistroCodename: focal
DistroVariant: ubuntu
DkmsStatus: nvidia-340, 340.108, 5.4.0-88-generic, x86_64: installed
ExtraDebuggingInterest: Yes
GraphicsCard:
 NVIDIA Corporation G84GLM [Quadro FX 570M] [10de:040c] (rev a1) (prog-if 00 [VGA controller])
   Subsystem: Hewlett-Packard Company G84GLM [Quadro FX 570M] [103c:30c5]
InstallationDate: Installed on 2019-05-08 (888 days ago)
InstallationMedia: Xubuntu 18.04.2 LTS "Bionic Beaver" - Release amd64 (20190210)
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-5.4.0-88-generic root=UUID=dd272475-45e5-4fca-b9ab-1b1f3f3015bd ro quiet splash vt.handoff=7
SourcePackage: xorg
UpgradeStatus: Upgraded to focal on 2021-10-13 (0 days ago)
dmi.bios.date: 12/01/2011
dmi.bios.vendor: Hewlett-Packard
dmi.bios.version: 68MVD Ver. F.20
dmi.board.name: 30C5
dmi.board.vendor: Hewlett-Packard
dmi.board.version: KBC Version 71.36
dmi.chassis.type: 10
dmi.chassis.vendor: Hewlett-Packard
dmi.modalias: dmi:bvnHewlett-Packard:bvr68MVDVer.F.20:bd12/01/2011:svnHewlett-Packard:pn:pvrF.20:rvnHewlett-Packard:rn30C5:rvrKBCVersion71.36:cvnHewlett-Packard:ct10:cvr:
dmi.product.family: 103C_5336AN
dmi.product.version: F.20
dmi.sys.vendor: Hewlett-Packard
nvidia-settings:
 ERROR: Unable to load info from any available system

 ERROR: Unable to load info from any available system
version.compiz: compiz N/A
version.libdrm2: libdrm2 2.4.105-3~20.04.2
version.libgl1-mesa-dri: libgl1-mesa-dri 21.0.3-0ubuntu0.3~20.04.3
version.libgl1-mesa-glx: libgl1-mesa-glx 21.0.3-0ubuntu0.3~20.04.3
version.nvidia-graphics-drivers: nvidia-graphics-drivers-* N/A
version.xserver-xorg-core: xserver-xorg-core 2:1.20.11-1ubuntu1~20.04.2
version.xserver-xorg-input-evdev: xserver-xorg-input-evdev N/A
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:19.1.0-1
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.99.917+git20200226-1
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:1.0.16-1

Revision history for this message
Jarno Suni (jarnos) wrote :
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

It appears the Nvidia driver is somehow not installed properly. Xorg is using software rendering instead of the Nvidia driver on this machine. That's also why it doesn't support the HDMI connector.

Try uninstalling and reinstalling the Nvidia driver. Also check to see if you have any custom Xorg config files that might cause the Nvidia driver to not get loaded.

affects: xorg (Ubuntu) → nvidia-graphics-drivers-340 (Ubuntu)
summary: - HDMI not recognized after upgrading from 18.04 to 20.04.3
+ Nvidia 340 Xorg driver is installed but not loaded
Revision history for this message
Jarno Suni (jarnos) wrote : Re: Nvidia 340 Xorg driver is installed but not loaded

There exists no /etc/X11/xorg.conf file. I already switched to nouveau using "Software & Updates" rebooted, switched back to nvidia-340 by the same application, and rebooted, but it did not help.

Jarno Suni (jarnos)
description: updated
Revision history for this message
Jarno Suni (jarnos) wrote :

I don't know if it is relevant, but even with Xubuntu 18.04 I had to force pulseaudio sample rate to 44100 to be able to successfully play sound via HDMI.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Your XorgLog.txt mentions that it's getting the problematic settings like these from a config file somewhere:

[ 7.396] (**) |-->Screen "Default Screen Section" (0)
[ 7.396] (**) | |-->Monitor "<default monitor>"
...
[ 8.110] (**) FBDEV(1): claimed PCI slot 1@0:0:0

It also suggests to look in /usr/share/X11/xorg.conf.d for the offending file.

Revision history for this message
Jarno Suni (jarnos) wrote :

There is no string "Default Screen Section" in /usr/share/X11/xorg.conf.d directory.

The directory contains files: 10-amdgpu.conf
10-quirks.conf
10-radeon.conf
40-libinput.conf
51-synaptics-quirks.conf
70-synaptics.conf
70-wacom.conf
nvidia-drm-outputclass-ubuntu.conf

The last one is attached.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The broken config file you are looking for will mention "fbdev", but I'm not sure where you will find it.

Revision history for this message
Jarno Suni (jarnos) wrote :

I searched for all .conf files in the device for "fbdev" (case insensitive) and found these:

/usr/src/linux-headers-5.4.0-84-generic/include/config/auto.conf
CONFIG_XEN_FBDEV_FRONTEND=m CONFIG_DRM_FBDEV_EMULATION=y CONFIG_DRM_FBDEV_OVERALLOC=100
/usr/src/linux-headers-5.4.0-84-generic/include/config/tristate.conf
CONFIG_XEN_FBDEV_FRONTEND=M
/usr/src/linux-headers-5.4.0-88-generic/include/config/auto.conf
CONFIG_XEN_FBDEV_FRONTEND=m CONFIG_DRM_FBDEV_EMULATION=y CONFIG_DRM_FBDEV_OVERALLOC=100
/usr/src/linux-headers-5.4.0-88-generic/include/config/tristate.conf
CONFIG_XEN_FBDEV_FRONTEND=M

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Maybe I was misled by XorgLog.txt because "FBDEV" is actually the correct driver to try if /dev/dri/card0 is missing (as it is when the Nvidia kernel driver is loaded). So this might just be the *absence* of a valid config file telling Xorg to load the nvidia driver. Try using the 'nvidia-xconfig' command to create one.

tags: added: nvidia
Revision history for this message
Jarno Suni (jarnos) wrote :

Hmm. I have another computer that is more successful with nvidia-340 in Xubuntu 20.04. When I compare to Xorg.0.log files, I see differences after line

"(II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration". The successful one has

"[ 77.338] (II) xfree86: Adding drm device (/dev/dri/card0)
[ 77.341] (**) OutputClass "nvidia" ModulePath extended to "/usr/lib/nvidia-340/xorg,/usr/lib/xorg/modules"

In the working system there doesn't seem to be a config file:

"nvidia-xconfig -t" prints

"WARNING: Unable to locate/open X configuration file.

Unable to locate/open XConfig file."

(with or without run as superuser)

so I wonder why this failing one should have?

Revision history for this message
Jarno Suni (jarnos) wrote :

One more thing. I get an error dialog after startup in the desktop. It does not tell what went wrong, but it has an option to report to developers and so I did.

Revision history for this message
Jarno Suni (jarnos) wrote :

Could there be something in upgrading process that caused this that clean install wouldn't have done? Could the relevant parts be clean installed now?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Yes it's always possible the upgrade process can give a different result (and bugs compared) to that of a clean install.

Revision history for this message
Jarno Suni (jarnos) wrote :

Where can those differences be? I could compare to another machine with the same driver. The graphics card is different, though.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

The differences (in my experience) are mostly:

1. Personal config files in $HOME (filenames and directories usually starting with a dot, so are hidden)

2. System config files (like those for Xorg or Nvidia) in /etc/X11 or /usr/share/X11/xorg.conf.d or other locations mentioned in the documentation: http://manpages.ubuntu.com/manpages/focal/en/man5/xorg.conf.5.html

Revision history for this message
Jarno Suni (jarnos) wrote :

BTW after every boot I see "System program problem detected?" dialog and every time I choose "Report problem...". I booted today, too.

$ LC_ALL=C ls -l /var/crash/
total 4624
-rw-r----- 1 jarnos whoopsie 1416740 Oct 14 11:05 _usr_bin_xfce4-power-manager.1000.crash
-rw-r----- 1 root whoopsie 3314750 Oct 13 16:03 _usr_lib_xorg_Xorg.0.crash

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Please use the 'ubuntu-bug' tool to report each of those crash files. If 'ubuntu-bug' doesn't work then you can use 'apport-cli'.

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

I would try this on the non-working system:

  sudo nvidia-xconfig

Revision history for this message
Jarno Suni (jarnos) wrote :

What does the "Report problem..." button in the dialog do, then if I have to use command line to report the crash files?

I see "sudo nvidia-xconfig" generates some basic /etc/X11/xorg.conf file.

Regardless, I noted the following:

If I log out from the Xfce session back to the LightDM greeter the HDMI output is used, too. And if I thereafter log in back to my session, the HDMI output works there, too. I wonder why it does not work right after the first login after boot?

Revision history for this message
Daniel van Vugt (vanvugt) wrote :

"Report problem..." creates a new bug, as you should for each .crash file.

Jarno Suni (jarnos)
description: updated
summary: - Nvidia 340 Xorg driver is installed but not loaded
+ Nvidia 340 Xorg driver is installed but not loaded after OS upgrade
Revision history for this message
Jarno Suni (jarnos) wrote :

Maybe lightdm could do something differently? What causes HDMI to appear when I log out of session?

Revision history for this message
Jarno Suni (jarnos) wrote :
To post a comment you must log in.