When resuming from suspend, I frequently receive a black screen which only contains this error:
i915 0000:00:02.0: [drm] *ERROR* failed to enable link training
This issue is a bit odd because most of the time touching the trackpad/mouse is enough for Ubuntu to resume successfully. Other times when I receive this error, my computer becomes unresponsive and requires a cold reboot.
I'm seeing this exact same error and behavior too on a brand new Dell Precision 5570 with a brand new Ubuntu 22.04 install (which defaults to Wayland instead of X11).
Here are a few things I've observed for my case at least.
Note that there may be two things going on here: 1) the freezing and hard reboot required, and 2) the "link training" error above. And, I think my answer below solves only the hard reboot problem, not the "link training" error, which may actually be a separate issue altogether, even though the "link training" error is present when the hard reboot problem is present.
In either case, here are several bugs I've seen with Wayland, but not X11, and here are 3 fixes that I have personally seen to work to stop the freezing which was previously occurring each time I saw the "link training" error. Leave a comment on which OS you have, which computer you have, and which of my "fixes" do or don't work for you. This info. might later be useful in a bug report for Ubuntu.
Wayland window manager causes my computer to stay on a black/blank screen and not wake up
...and not let me log back in after it blackens and locks the screen, or goes to sleep:
I'm seeing this on a brand new Dell Precision 5570 with a brand new Ubuntu 22.04 install.
Ubuntu 22.04 is the first LTS version of Ubuntu (I believe) to come with the Wayland window manager activated by default instead of the X11 Window manager.
Bugs in Wayland
It turns out, Wayland is still not ready for prime time! I'm seeing a variety of Wayland issues or problems. Here are a few of them:
- [bug] This problem. Each time the screen blackens to save power, you can't log in again! See also: DELL XPS 13 9315 Blank screen when waking from suspend.
- [bug] my mouse scroll wheel fix using
imwheel
works in Wayland in programs like Chrome, but not in most other programs, like Sublime Text.
- This is part of that: https://github.com/albertz/mouse-scroll-wheel-acceleration-userspace/issues/8#issuecomment-1575389079
- [incompatibility with Shutter] Shutter is not able to take screenshots
- [incompatibility with
xdotool
] My xdotool
-based "Show Desktop" icon doesn't work.
- [bug] Microsoft Teams screensharing doesn't work in meetings. Wayland doesn't work well with Microsoft Teams. If you try to screenshare while running Wayland, it crashes the Teams program. In X11, however, Microsoft Teams, video meetings, and screensharing all work just fine.
So, here are three "fixes":
...each of which I've personally tested (repeatedly) to work on my Dell Precision 5570 laptop with Ubuntu 22.04.2:
Close the laptop lid. Open it up again. Voila! You can see the log-in screen again now!
Press Ctrl + Alt + F1 to fix the blank screen and log in again.
[best, in my opinion, since it fixes many other things too] Use the X11 Window manager instead of Wayland: In short, log out, click your name, click the gear in the bottom-right, choose the non-Wayland window manager option.
Detailed instructions: to use the X11 Window Manager instead of Wayland in Ubuntu 20.04, 22.04, etc. (originally posted in my answer here):
Log out of Ubuntu.
At the login screen, click your username to begin typing your password.
This enables a little gear icon in the bottom-right, to select your window manager. Click that to select your window manager. Choose the non-Wayland option!
If currently set to the Wayland option, then it will show "Ubuntu" [which means Wayland in this case] and "Ubuntu on Xorg" [which means X11]. Choose the "Ubuntu on Xorg" option. Here are some screenshots:

Again, if it shows "Ubuntu" and "Ubuntu on Xorg", choose "Ubuntu on Xorg":

But if you are in X11, then it will show "Ubuntu" [X11] and "Ubuntu on Wayland" [Wayland].
So, if it shows "Ubuntu" and "Ubuntu on Wayland", then choose "Ubuntu":

Once you are logged in, you can see which window manager is active by going to Ubuntu Settings --> About --> Windowing System, as shown below. I am logged in with the X11 window manager here, as you can see:

So, the total instructions are:
- If using the X11 window manager: nothing to do. It's fixed!
- If using the Wayland window manager:
Your computer blackens the screen and locks it, since 5 minutes or whatever has elapsed (as set in your "Settings --> Power --> Screen blank" setting).
You press a key to wake it up. Nothing. You might see this set of errors quickly flash onto the screen, then it's just black:

When you press some keys, you might see some backlight behind your keys if you had the keyboard backlight activated, but the screen remains black.
Close the laptop lid, and open it back up again. This only works if your Power --> "Enable Lid Switch" setting is turned On in the BIOS/UEFI settings.
Or, press Ctrl + Alt + F1 to fix the blank screen.
Fixed! The screen magically comes back to life and you can log in again.
See also:
- DELL XPS 13 9315 Blank screen when waking from suspend - the question and answers here have both stumbled upon the same "close the lid" and "press Ctrl + Alt + F1" tricks I found too. Interesting. Looks like we are not alone.
- my answer