Running Ubuntu 22.04 on an Acer Spin 5 SP513-54N

A jellyfish at the Aquarium of the Pacific in Long Beach. Jamminess indeterminate.

Update, 1 September 2022

A fixed kernel for the touchpad/touchscreen driver issues discussed in the original post below has been released for Ubuntu 22.04! Unfortunately it looks like the maintainers chose not to backport it, so it's only available in Jammy Jellyfish on the 5.19 branch of the kernel it was fixed in, but the work-arounds are no longer needed and the device is fully functional.

The original post continues below.

The SP513-54N has always had slightly quirky Linux support, not entirely unexpected given that it's a convertible laptop with an active Wacom pen. Like several Lenovo models (and apparently a Clevo barebones), Acer does something weird that I do not at all understand related to memory reservations for the touchpad and touchscreen which are hotplugged at boot time. After the somewhat-frantic Googling I did back in October 2020 when I first purchased it, I've been happily running each subsequent Ubuntu release with the kernel parameter pci=nocrs. I didn't know what it did under the hood, but it made my touchpad work with the multi-touch gestures I care about, and as a side-benefit it fixed the touchscreen at the same time, although I personally never use it.

When Ubuntu 22.04 "Jammy Jellyfish" dropped, I had a feeling that, being the next LTS, something big was going to be broken, so I waited. Luckily, I had subscribed a long time ago to updates on the original Launchpad bug tracking the pci=nocrs fix, as that bootparam is only ever used when there is what is considered a kernel bug present. And sure enough, a few weeks after 22.04 dropped, someone updated that bug to report the SP513-54N was broken on 22.04, even with the bootparam in place.

The subsequent updates to the Launchpad bug gave me a bit more background information I hadn't understood about the nature of the bug, which was interesting, but several further weeks passed without any noticeable progress. At the beginning of this month, someone reported that installing a mainline kernel brought the laptop back to at least the same functionality as 21.10 with the bootparam. And then when an upstream fix was merged into Linus' tree for kernel 5.19, I decided it was time to give it a shot.

The Spin 5 is my primary personal laptop, which actually makes it the least-critical general-purpose computer in the house, and the first to receive updates. Without being able to update the Spin 5, I wasn't comfortable updating the NUC or my work laptop to 22.04, but the support window was rapidly closing for leaving at least the work laptop on 22.10 (the NUC is on the previous LTS and won't need to be updated for a while, although I will upgrade it soon). I went ahead and tried the mainline kernel on 21.10 first, as it's easier to revert just a kernel upgrade. That went fine, so I upgraded the rest of the system and reinstalled the mainline kernel.

Most distro upgrades are pretty painless for me, this is the hardest I've had to work for one in a while, but I was still pleasantly surprised at how smooth moving from the distro's main kernel to a mainline build was. I'm looking forward to the fix hopefully being backported to Ubuntu's kernel, but it's not the end of the world to keep updating myself on mainline for a while if I need to. 22.04 landed on my Spin 5 and now can be rolled out wherever else in my infra it's needed - even if the arctica-greeter hidpi bug still isn't fixed.

In case you have any of the impacted models (Lenovo IdeaPad 3 14IIL05, 15IIL05, or 17IIL05; Lenovo IdeaPad 5 14IIL05 or 15IIL05, Lenovo IdeaPad Slim 7 14IIL05 or 15IIL05, Lenovo IdeaPad S145-15IIL, S340-14IIL, S340-15IIL, or C340-15IIL, Lenovo BS145-15IIL, V14-IIL, V15-IIL, or V17-IIL, Lenovo Yoga C940-14IIL or S740-14IIL, Lenovo Yoga Slim 7 14IIL05 or 15IIL05, Lenovo IdeaPad Flex 5 14IIL05 or 15IIL05, Lenovo ThinkBook 14-IIL or 15-IIL, Lenovo Yoga S940-14IIL, Acer Spin 5 SP513-54N, Clevo X170KM-G Barebone) and haven't had any fixes in place, here's what you have to do.

First, make sure GRUB always sets the pci=nocrs kernel boot parameter. In Ubuntu (and probably nearly every other distro that ships GRUB, it's pretty standardized these days), this is done by editing /etc/default/grub and changing the GRUB_CMDLINE_LINUX_DEFAULT variable. Here's mine:

GRUB_CMDLINE_LINUX_DEFAULT="splash pci=nocrs i915.enable_dp_mst=0"

The last option there is to fix an issue with DisplayPort Multi-Stream Transport, which is an issue I have with my Thunderbolt dock and external screens blanking randomly, not with the laptop itself. Next time GRUB install runs after a new kernel is installed, which we'll do in a moment, the bootparams will be set to include the fix on all installed kernels.

Then, just follow the instructions to install an upstream kernel. On Ubuntu, that's this wiki, but to summarize, make sure you're not loading any out-of-tree kernel modules, and then install the latest kernel version installed from this directory listing. I'm running the 5.18 branch at the moment, as 5.18.1 is available, but failed to compile for amd64 at the time of writing. These are not signed kernels, so make sure you reboot and disable Secure Boot if it's enabled before installing them. Download all the .deb files to a directory and run:

sudo dpkg -i *.deb

Be careful to watch for errors. When I ran this before upgrading to Ubuntu 22.04, I had an issue with a missing package libssl3 that I had to manually install from the jammy repo before kernel-modules would install properly, but dpkg completed despite this error, which would have been frustrating on reboot if I hadn't been checking the terminal output. Since it's a newer version, it should automatically become the default on next boot.

Jordan Cooks

Jordan Cooks

Jordan listens to too many podcasts, has too many streaming subscriptions, loves dogs, is the Integration Engineer Team Lead at Bitwarden, and makes a mean vegan baked mac and cheeze.
North Bend, OR