gpu-manager generates an invalid xorg.conf file

Bug #1485236 reported by Rafał Cieślak
38
This bug affects 8 people
Affects Status Importance Assigned to Milestone
ubuntu-drivers-common (Ubuntu)
Fix Released
High
Alberto Milone
Trusty
Triaged
High
Alberto Milone
Wily
Triaged
High
Alberto Milone

Bug Description

I use Ubuntu 15.04. I have both a nvidia graphics card and an integrated intel one. Sometimes, I boot my system without nvidia card, and sometimes with both. Until recently this setup worked correctly, so that when the nvidia card was enabled, the system would boot up using nvidia drivers, and in the other case it would use intel card. Now I am unable to boot up without nvidia card. Booting with it removes the xorg.conf file (it is empty). When I reboot with intel card only, Xorg fails to start because of the following error:

Data incomplete in file /etc/X11/xorg.conf
Undefined Screen "nvidia" referenced by ServerLayout "layout".

I check gpu-manager's logs, and indeed it claims to have generated the xorg.conf file:

==gpu-manager.log==
log_file: /var/log/gpu-manager.log
last_boot_file: /var/lib/ubuntu-drivers-common/last_gfx_boot
new_boot_file: /var/lib/ubuntu-drivers-common/last_gfx_boot
grep dmesg status 0
dmesg status 0 == 0? Yes
grep dmesg status 256
dmesg status 256 == 0? No
Is nvidia loaded? no
Was nvidia unloaded? yes
Is nvidia blacklisted? no
Is fglrx loaded? no
Was fglrx unloaded? no
Is fglrx blacklisted? no
Is intel loaded? yes
Is radeon loaded? no
Is radeon blacklisted? no
Is nouveau loaded? no
Is nouveau blacklisted? yes
Is fglrx kernel module available? no
Is nvidia kernel module available? yes
Vendor/Device Id: 8086:412
BusID "PCI:0@0:2:0"
Is boot vga? yes
Vendor/Device Id: 10de:1184
BusID "PCI:1@0:0:0"
Is boot vga? no
The device is a pci passthrough. Skipping...
Skipping "/dev/dri/card0", driven by "i915"
Skipping "/dev/dri/card0", driven by "i915"
Found "/dev/dri/card0", driven by "i915"
output 0:
 DisplayPort connector
Number of connected outputs for /dev/dri/card0: 1
Does it require offloading? yes
last cards number = 1
Has amd? no
Has intel? yes
Has nvidia? no
How many cards? 1
Has the system changed? No
main_arch_path x86_64-linux-gnu, other_arch_path i386-linux-gnu
Current alternative: /usr/lib/x86_64-linux-gnu/mesa/ld.so.conf
Current core alternative: (null)
Is nvidia enabled? no
Is fglrx enabled? no
Is mesa enabled? yes
Is pxpress enabled? no
Is prime enabled? no
Is nvidia available? no
Is fglrx available? no
Is fglrx-core available? no
Is mesa available? yes
Is pxpress available? no
Is prime available? no
Single card detected
PRIME detected
pci bus from dmesg status 0
can't open /sys/module/nvidia/version
/sys/class/dmi/id/product_version="To Be Filled By O.E.M."
/sys/class/dmi/id/product_name="To Be Filled By O.E.M."
1st try: bbswitch without quirks
Loading bbswitch with "load_state=-1 unload_state=1" parameters
2nd try: bbswitch with quirks
Loading bbswitch with "load_state=-1 unload_state=1 skip_optimus_dsm=1" parameters
Warning: can't load bbswitch, switching between GPUs won't work
Selecting nvidia
Error: no alternative found for nvidia
Error: failed to enable the driver
Selecting mesa
/usr/bin/update-alternatives --set x86_64-linux-gnu_gl_conf /usr/lib/x86_64-linux-gnu/mesa/ld.so.conf
update-alternatives status 0
Calling ldconfig
ldconfig status 0
/usr/bin/update-alternatives --set i386-linux-gnu_gl_conf /usr/lib/i386-linux-gnu/mesa/ld.so.conf
update-alternatives status 0
Calling ldconfig
ldconfig status 0
Error: no alternative found for unblacklist
Removing xorg.conf. Path: /etc/X11/xorg.conf
can't access /etc/X11/xorg.conf
Check failed
Removing xorg.conf. Path: /etc/X11/xorg.conf
Moved /etc/X11/xorg.conf to /etc/X11/xorg.conf.08152015
Regenerating xorg.conf. Path: /etc/X11/xorg.conf
No need to change the current bbswitch status
===================

However, the generated xorg.conf file is clearly invalid:

=====xorg.conf=====
Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "intel"
EndSection

Section "Device"
    Identifier "intel"
    Driver "intel"
    BusID "PCI:0@0:2:0"
    Option "AccelMethod" "SNA"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection
===================

So Xorg is right to report the error that screen "nvidia" is undefined. Apparently the xorg.conf file that gpu-manager generated is incorrect, and this issue prevents me from booting my system correctly, and this makes me believe this bug may be considered significant.

Revision history for this message
Alberto Milone (albertomilone) wrote :

gpu-manager.log shows two cards being available at the following addresses:

Vendor/Device Id: 8086:412
BusID "PCI:0@0:2:0"
Is boot vga? yes
Vendor/Device Id: 10de:1184
BusID "PCI:1@0:0:0"

Also, no nvidia driver seems to be available (strangely enough the kernel module is available):

"Error: no alternative found for nvidia
Error: failed to enable the driver"

"Is nvidia available? no"

Can you try installing or re-installing the nvidia driver, please?

If that doesn't solve your problem, can you please reproduce the error and get the output of dmesg, your /var/log/Xorg.0.log, and /var/log/Xorg.0.log.old, please?

Revision history for this message
Rafał Cieślak (rafalcieslak256) wrote :

Thanks for your reply. Indeed, this might have been my fault, apparently this happened when my nvidia driver was broken. Now that I fixed the driver it seems the issue is resolved, but I will test it further and reopen this bug if I am able to reproduce the problem.

Changed in ubuntu-drivers-common (Ubuntu):
status: New → Invalid
Revision history for this message
Laszlo Marai (atleta.hu) wrote :
Download full text (6.1 KiB)

I'm facing this same issue. I'm trying to move my old system (previously running on a lenovo t410 with discrete nvidia graphics) to a t450, only that has intel graphics. However, the generated xorg.conf still contains a reference to nvidia (I have Screen 0 "nvidia").

I have removed all traces of the nvidia driver from the system, but still experienced this issue. Fortunately I found this bug report. After looking at the source of gpu-manager, the problem is that it thinks that the nvidia module was unloaded. The reason is that what it does is that it looks at the syslog (instead of dmesg, as the comment for 'has_unloaded_module' states) and my syslog still contains the trace of the last boot on the old machine (the "nvidia: module" string fragment, that has_unloaded_module looks for).

Note, that dmesg (of course) does not contain anything about nvidia. The solution would be to really scan dmesg instead of syslog (fixing line 708 here: https://github.com/tseliot/ubuntu-drivers-common/blob/master/share/hybrid/gpu-manager.c ).

This bug may well have caused the problem for Rafał above. The quick fix is forcing rotation of (or removing) syslog and removing /etc/X11/xorg.conf .

The relevant files:
------ /var/log/gpu-manager.log ----
log_file: /var/log/gpu-manager.log
last_boot_file: /var/lib/ubuntu-drivers-common/last_gfx_boot
new_boot_file: /var/lib/ubuntu-drivers-common/last_gfx_boot
grep dmesg status 0
dmesg status 0 == 0? Yes
grep dmesg status 256
dmesg status 256 == 0? No
Is nvidia loaded? no
Was nvidia unloaded? yes
Is nvidia blacklisted? no
Is fglrx loaded? no
Was fglrx unloaded? no
Is fglrx blacklisted? no
Is intel loaded? yes
Is radeon loaded? no
Is radeon blacklisted? no
Is nouveau loaded? no
Is nouveau blacklisted? no
Is fglrx kernel module available? no
Is nvidia kernel module available? no
Vendor/Device Id: 8086:1616
BusID "PCI:0@0:2:0"
Is boot vga? yes
Skipping "/dev/dri/card0", driven by "i915"
Skipping "/dev/dri/card0", driven by "i915"
Found "/dev/dri/card0", driven by "i915"
output 0:
        eDP connector
Number of connected outputs for /dev/dri/card0: 1
Does it require offloading? yes
last cards number = 1
Has amd? no
Has intel? yes
Has nvidia? no
How many cards? 1
Has the system changed? No
main_arch_path x86_64-linux-gnu, other_arch_path i386-linux-gnu
Current alternative: /usr/lib/x86_64-linux-gnu/mesa/ld.so.conf
Current core alternative: (null)
Is nvidia enabled? no
Is fglrx enabled? no
Is mesa enabled? yes
Is pxpress enabled? no
Is prime enabled? no
Is nvidia available? no
Is fglrx available? no
Is fglrx-core available? no
Is mesa available? yes
Is pxpress available? no
Is prime available? no
Single card detected
PRIME detected
pci bus from dmesg status 0
can't open /sys/module/nvidia/version
can't access /usr/share/nvidia-prime/prime-quirks
Error: /usr/share/nvidia-prime/prime-quirks does not exist or is empty.
1st try: bbswitch without quirks
Loading bbswitch with "load_state=-1 unload_state=1" parameters
2nd try: bbswitch with quirks
Loading bbswitch with "load_state=-1 unload_state=1 skip_optimus_dsm=1" parameters
Warning: can't load bbswitch, switching between GPUs won't work
Selecting nvidia
Error: no alternativ...

Read more...

Laszlo Marai (atleta.hu)
Changed in ubuntu-drivers-common (Ubuntu):
status: Invalid → New
Revision history for this message
Laszlo Marai (atleta.hu) wrote :

The error in gpu-manager.c is on line 708 not 780.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu-drivers-common (Ubuntu):
status: New → Confirmed
Changed in ubuntu-drivers-common (Ubuntu):
importance: Undecided → High
status: Confirmed → In Progress
assignee: nobody → Alberto Milone (albertomilone)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubuntu-drivers-common - 1:0.4.14

---------------
ubuntu-drivers-common (1:0.4.14) xenial; urgency=medium

  * gpu-manager.{c|py}:
    - Rely on udev for card detection. This helps detecting if a module
      was unloaded or if a card was disabled on a hybrid system.
      In addition to being more accurate (LP: #1485236), this should also
      be much faster on boot (LP: #1307069).
    - Restrict the search for built modules to the dkms directory. This
      improves performance.
  * debian/rules, setup.py, 71-u-d-c-gpu-detection.rules,
    u-d-c-print-pci-ids:
    - Provide a udev rule to detect cards and modules.

 -- Alberto Milone <email address hidden> Wed, 13 Jan 2016 10:35:18 +0100

Changed in ubuntu-drivers-common (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Giedrius (r-se-0) wrote :

Also affects 15.10 (Wily)

Changed in ubuntu-drivers-common (Ubuntu Trusty):
status: New → Triaged
Changed in ubuntu-drivers-common (Ubuntu Wily):
status: New → Triaged
Changed in ubuntu-drivers-common (Ubuntu Trusty):
importance: Undecided → High
Changed in ubuntu-drivers-common (Ubuntu Wily):
importance: Undecided → High
Changed in ubuntu-drivers-common (Ubuntu Trusty):
assignee: nobody → Alberto Milone (albertomilone)
Changed in ubuntu-drivers-common (Ubuntu Wily):
assignee: nobody → Alberto Milone (albertomilone)
Revision history for this message
Fabio C. Barrionuevo (luzfcb) wrote :

@albertomilone

since Ubuntu 14.04 should still be supported until 2019, there is a possibility of creating a backport this fix?
this problem is very annoying. I am unable to use my nvidia because I always gain a black screen when active

Ubuntu 14.04 64bits, Dell Latitude 3450, core i7-5500U

fabio@luzfcb:~$ lspci
00:00.0 Host bridge: Intel Corporation Broadwell-U Host Bridge -OPI (rev 09)
00:02.0 VGA compatible controller: Intel Corporation Broadwell-U Integrated Graphics (rev 09)
00:03.0 Audio device: Intel Corporation Broadwell-U Audio Controller (rev 09)
00:14.0 USB controller: Intel Corporation Wildcat Point-LP USB xHCI Controller (rev 03)
00:16.0 Communication controller: Intel Corporation Wildcat Point-LP MEI Controller #1 (rev 03)
00:1b.0 Audio device: Intel Corporation Wildcat Point-LP High Definition Audio Controller (rev 03)
00:1c.0 PCI bridge: Intel Corporation Wildcat Point-LP PCI Express Root Port #1 (rev e3)
00:1c.2 PCI bridge: Intel Corporation Wildcat Point-LP PCI Express Root Port #3 (rev e3)
00:1c.3 PCI bridge: Intel Corporation Wildcat Point-LP PCI Express Root Port #4 (rev e3)
00:1c.4 PCI bridge: Intel Corporation Wildcat Point-LP PCI Express Root Port #5 (rev e3)
00:1d.0 USB controller: Intel Corporation Wildcat Point-LP USB EHCI Controller (rev 03)
00:1f.0 ISA bridge: Intel Corporation Wildcat Point-LP LPC Controller (rev 03)
00:1f.2 SATA controller: Intel Corporation Wildcat Point-LP SATA Controller [AHCI Mode] (rev 03)
00:1f.3 SMBus: Intel Corporation Wildcat Point-LP SMBus Controller (rev 03)
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 10)
03:00.0 Network controller: Intel Corporation Wireless 7265 (rev 59)
04:00.0 3D controller: NVIDIA Corporation GM108M [GeForce 830M] (rev ff)

Revision history for this message
Yang Ding (dingyang) wrote :

I am having this issue on 16.04. I am not sure if that is due to nvidia driver installed on the machine.

Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "intel"
EndSection

Section "Device"
    Identifier "intel"
    Driver "modesetting"
    BusID "PCI:0@0:2:0"
    Option "AccelMethod" "None"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

However, I do not have nvidia GPU on the machine. I will uninstall all nvidia packages to try.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.