Lenovo X1 boot crash with HDMI cable attached and laptop lid closed

Bug #1876741 reported by Raoul Scarazzini
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Expired
Undecided
Unassigned
plymouth (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

Hey everyone,
just upgraded to 20.04 in my Lenovo X1 Carbon laptop and found myself in really big troubles.

I always started my laptop pressing the power button and then closing the laptop lid, because I'm using an external HDMI display. This worked always well with Ubuntu 19.10. With 20.04 the system crash.

These are the actions that reproduce the problem:

1 - Boot the system, pressing the power button and closing the laptop lid with an external HDMI display attached to the laptop;
2 - See on the external HDMI display the boot progress: BIOS loading and then grub not appearing;
3 - Listen to the fans that are about to make the laptop lift;
4 - Press the power button to force off the laptop;

At this point the only way to have everything back is:

1 - Detach any external device;
2 - Detach the power cable;
3 - Wait 3 seconds or more;
4 - Open the laptop lid;
5 - Attach the power cable;
6 - Press the power button;

Without doing exactly as I written the laptop will not boot up, even if I force power off, after starting it again, after the BIOS display, the screen goes blank and the fans lift.

NOTE 1: I already disabled secure boot in the BIOS, and also selected discrete graphics for the display (otherwise I'm not able to even start X);

NOTE 2: the scenario is exactly the same with nvidia-driver-435 and nvidia-driver-440;

NOTE 3: if I leave the laptop lid open, everything is just fine;

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: linux-image-5.4.0-28-generic 5.4.0-28.32
ProcVersionSignature: Ubuntu 5.4.0-28.32-generic 5.4.30
Uname: Linux 5.4.0-28-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.11-0ubuntu27
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC2: rasca 2750 F.... pulseaudio
 /dev/snd/controlC1: rasca 2750 F.... pulseaudio
 /dev/snd/controlC0: rasca 2750 F.... pulseaudio
CasperMD5CheckResult: skip
CurrentDesktop: ubuntu:GNOME
Date: Mon May 4 16:24:47 2020
InstallationDate: Installed on 2019-12-10 (146 days ago)
InstallationMedia: Ubuntu 19.10 "Eoan Ermine" - Release amd64 (20191017)
MachineType: LENOVO 20QVCTO1WW
ProcFB: 0 EFI VGA
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-5.4.0-28-generic root=UUID=c61df9cc-bd36-4ed2-8f52-de114bbf3fc3 ro rd.driver.blacklist=nouveau
RelatedPackageVersions:
 linux-restricted-modules-5.4.0-28-generic N/A
 linux-backports-modules-5.4.0-28-generic N/A
 linux-firmware 1.187
SourcePackage: linux
UpgradeStatus: Upgraded to focal on 2020-04-28 (6 days ago)
dmi.bios.date: 03/24/2020
dmi.bios.vendor: LENOVO
dmi.bios.version: N2OET43W (1.30 )
dmi.board.asset.tag: Not Available
dmi.board.name: 20QVCTO1WW
dmi.board.vendor: LENOVO
dmi.board.version: SDK0T08861 WIN
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: None
dmi.modalias: dmi:bvnLENOVO:bvrN2OET43W(1.30):bd03/24/2020:svnLENOVO:pn20QVCTO1WW:pvrThinkPadX1Extreme2nd:rvnLENOVO:rn20QVCTO1WW:rvrSDK0T08861WIN:cvnLENOVO:ct10:cvrNone:
dmi.product.family: ThinkPad X1 Extreme 2nd
dmi.product.name: 20QVCTO1WW
dmi.product.sku: LENOVO_MT_20QV_BU_Think_FM_ThinkPad X1 Extreme 2nd
dmi.product.version: ThinkPad X1 Extreme 2nd
dmi.sys.vendor: LENOVO

Revision history for this message
Raoul Scarazzini (rasca) wrote :
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Status changed to Confirmed

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Raoul Scarazzini (rasca) wrote :

Just a follow up with my investigations in the issue, that might be useful for users in a similar situation.

The problem related to grub not loading and fans lifting with no tomorrow is related to Thunderbolt. If I leave any kind of device (network adapter, webcam, whatever) attached to any of the two Thunderbolt ports, then any kind of boot (or reboot) will likely fail like I described above.

While looking for solutions, I got into the certification page of my laptop [1] and saw that it says:

"This system was tested with 18.04 LTS, running the 4.15.0-1059-oem kernel."

Now, this kernel is not present in 20.04, but I've installed 5.6.0-1008-oem and despite of the certification, nothing changes at all. So, the state of things right now:

- If I want to be sure the system will load grub, then nothing should be connected to the Thunderbolt port;
- If I want to use HDMI output I MUST set "Discrete" (and not "Hybrid") in the BIOS for the display adapter;
- If I want GDM/LightDM/Whatsoever to be loaded than the laptop lid should be left open until the end of the boot process, otherwise a blank screen with a single cursor (and a concert of fans) will be the only thing you'll have;

Note that this counts for ANY kind of Thunderbolt setting I set inside the BIOS, so likely to be a Grub/EFI compatibility issue, but I have no more clue for now.

With this kind of problems I think that writing this laptop is certified by Ubuntu seems ridiculous.

I'm available for any kind of suggestions/proposal you have.

[1] https://certification.ubuntu.com/hardware/201906-27150

Revision history for this message
AaronMa (mapengyu) wrote :

Tried the steps to boot with LID close.
found that LID close until the BIOS logo show, unless the laptop will shut down.

Then all work good. GDM shows on external monitor.
Test with typec/HDMI/thunderbolt-dock-typc external monitor, thunderbolt dock is always connected.

BIOS should be default setting with optimized enabled, secure boot is disabled.
GPU is hybrid.

Only difference should be BIOS.
You are using a withdrawn BIOS version.
Could you try the new one?
https://pcsupport.lenovo.com/us/en/products/laptops-and-netbooks/thinkpad-p-series-laptops/thinkpad-p1-gen-2-type-20qt-20qu/downloads/DS540308

Revision history for this message
Raoul Scarazzini (rasca) wrote :

Hey AaronMa,
What do you mean with "found that LID close until the BIOS logo show, unless the laptop will shut down."?

So you tested using the HDMI cable directly attached to the laptop and everything worked even with something attached to the thunderbolt port? Which kind of docking station are you using?

With that said I've tried the latest BIOS:

BIOS Information
        Vendor: LENOVO
        Version: N2OET42W (1.29 )
        Release Date: 01/20/2020
        Address: 0xE0000
        Runtime Size: 128 kB
        ROM Size: 32 MB
        Characteristics:
                PCI is supported
                PNP is supported
                BIOS is upgradeable
                BIOS shadowing is allowed
                Boot from CD is supported
                Selectable boot is supported
                EDD is supported
                3.5"/720 kB floppy services are supported (int 13h)
                Print screen service is supported (int 5h)
                8042 keyboard services are supported (int 9h)
                Serial services are supported (int 14h)
                Printer services are supported (int 17h)
                CGA/mono video services are supported (int 10h)
                ACPI is supported
                USB legacy is supported
                BIOS boot specification is supported
                Targeted content distribution is supported
                UEFI is supported
        BIOS Revision: 1.29
        Firmware Revision: 1.22

And results are the same: if something is attached to thunderbolt, no way to see even grub, if nothing is attached (and LID is closed) then I see grub loading on the external monitor but I don't get GDM.

What do you mean exactly with "BIOS should be default setting with optimized enabled"?

Thanks!

Revision history for this message
AaronMa (mapengyu) wrote :

Open LID, press power button, wait for BIOS show logo. close LID.

Set Optimized=Enable before load default setting.

ThinkPad Thunderbolt 3 Dock Gen 2:
https://pcsupport.lenovo.com/us/en/solutions/pd500265

GPU is hybrid, BIOS can't be shown on external monitor.
no grub shown, wait enough time, GDM show on external monitor.
HDMI directly on laptop, typec monitor on laptop, DP monitor on dock are all OK.

Revision history for this message
Raoul Scarazzini (rasca) wrote :

I was able to get LightDM (or GDM) with hybrid graphics only by manually specifying an /etc/X11/xorg.conf file like follows (I generated it with nvidia-xconfig and then made manual modifications following this [1]):

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig: version 440.64

Section "ServerLayout"
    Identifier "Layout0"
    Screen 0 "Screen0"
    InputDevice "Keyboard0" "CoreKeyboard"
    InputDevice "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "InputDevice"

    # generated from default
    Identifier "Mouse0"
    Driver "mouse"
    Option "Protocol" "auto"
    Option "Device" "/dev/psaux"
    Option "Emulate3Buttons" "no"
    Option "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier "Keyboard0"
    Driver "kbd"
EndSection

Section "Monitor"
    Identifier "Monitor0"
    VendorName "Unknown"
    ModelName "Unknown"
    Option "DPMS"
EndSection

Section "Device"
    Identifier "Device0"
    Driver "nvidia"
    VendorName "NVIDIA Corporation"
    BoardName "GeForce GTX 1650 with Max-Q Design"
    BusID "PCI:1:0:0"
EndSection

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

Section "Screen"
    Identifier "Screen1"
    Device "Device1"
EndSection

Section "Screen"
    Identifier "Screen0"
    Device "Device0"
    Monitor "Monitor0"
    DefaultDepth 24
    Option "AllowEmptyInitialConfiguration" "True"
    SubSection "Display"
        Depth 24
    EndSubSection
EndSection

Are you using a similar configuration for X or it just works for you out of the box?

About the BIOS, I checked and "Set Optimized" was Disable for me, turning it to Enable seems to make me able to reboot with a Thunderbolt adapter connected to the port.

Many thanks for your help!

[1] https://gist.github.com/alexlee-gk/76a409f62a53883971a18a11af93241b

Revision history for this message
Raoul Scarazzini (rasca) wrote :

Hi there,
I wanted to add that I've tried the Thunderbolt dock and everything seems to be working as expected, even if there's a lot more of fan noise while the laptop is attached to the dock (maybe I'll open a specific bug on this issue).

For this bug I don't think there's only one thing to clarify before closing it, and it is the one related to the Xorg configuration. Since out-of-the-box I was not able to have an X session working unless using the manual Xorg configuration described in the previous comment. Is there any advice on this? It is just the way it should be?

Once we clarify this I think we can safely close this bug.

Thanks!

Revision history for this message
AaronMa (mapengyu) wrote :

Hi,

I tested it with fresh install 20.04, then install nvidia-driver-440.64.
Then everything works fine.

Usually no need to use custom conf by nvidia-xconfig.

But prime-select nvidia is a must.

Revision history for this message
Raoul Scarazzini (rasca) wrote :

Do you have any suggestions about what could be the difference here? Since I didn't do a fresh install, but an upgrade from 19.10? Without that xorg.conf there's no way to see X.

Revision history for this message
Maria Han (mpc00) wrote :

Hi,

I think what I experience on my Thinkpad T460s might be the same bug. I do not have a dock but if I boot with an HDMI cable attached I get stuck after grub - at the screen with the Lenovo logo and a spinner.

This only happens, if I choose "Single Display" in the displays setting, using only the external screen attached via HDMI (i.e. the thinkpad screen is off, even though the lid is not closed). If instead I use "Join Displays", where both screens are on, I can boot with the HDMI cable attached.

The problem appeared after upgrading from 19.10. I only have built-in graphics (Intel Corporation Skylake GT2 [HD Graphics 520]).

Revision history for this message
Raoul Scarazzini (rasca) wrote :

Hi Maria,
I don't think your issue is the same I got. Note that my problem happened with or without the dock, and I wasn't even reaching grub. That's the big difference here. If you lose the video after grub, than your problem is elsewhere, and my suggestion is to boot without "quiet splash" on the grup command line, so that you can see where the boot is stuck.

If it reaches the end of the boot process and it is just unable to start X (so GDM, LightDM or whatever), then your problem might be related to the drivers, maybe not blacklisting nouveau or things like these. Maybe as suggested elsewhere [1], you just need to uninstall the buggy xserver-xorg-video-intel package.

What is more important here is that my problem got solved by setting the "Set Optimized" option in the BIOS to true. This solved a huge amount of problems, the last one I'm waiting to solve before closing this bug is to understand how to boot without a customized /etc/X11/xorg.conf.

Hope this helps.

[1] https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/1879484

Revision history for this message
Maria Han (mpc00) wrote :

Hi Raoul,

yes, your probably right it is not exactly the same. I overlooked in your initial post that the problem happened before grub and the title sounds so much like my problem. I think I assumed from here

> if something is attached to thunderbolt, no way to see even grub, if nothing is attached (and LID is closed) then I see grub loading on the external monitor but I don't get GDM.

that you also had a problem after grub that is not associated with the thunderbolt issue.

Thanks for your suggestions, I quickly tried both of them. Uninstalling xserver-xorg-video-intel did not solve it, but if I boot without "quiet splash" I can get to the login screen and login normally even though the HDMI cable is attached. I first see some log lines from the booting process on the screen, as expected, but the page with the Lenovo logo and Spinner does not come up and I just get to the login screen.

Sorry if I am posting to the wrong thread here.

Revision history for this message
Michal Kucirka (michalkucirka) wrote :

Hi,I have the same problem as Maria. I filed a bug report here

https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1881252

Revision history for this message
Kai-Heng Feng (kaihengfeng) wrote :

I can reproduce the issue on Lenovo T580.

Remove "quiet splash" can make the boot process reach to GDM.

Changed in linux (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Raoul,

1. If you believe something has crashed then please follow these instructions:

   https://wiki.ubuntu.com/Bugs/Responses#Missing_a_crash_report_or_having_a_.crash_attachment

2. If removing "splash" solves the problem for you then we should probably mark this as a duplicate of bug 1871641.

Changed in linux (Ubuntu):
status: Triaged → Incomplete
Changed in plymouth (Ubuntu):
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for linux (Ubuntu) because there has been no activity for 60 days.]

Changed in linux (Ubuntu):
status: Incomplete → Expired
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for plymouth (Ubuntu) because there has been no activity for 60 days.]

Changed in plymouth (Ubuntu):
status: Incomplete → Expired
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.