Installer crashes when booting from USB on Raspberry Pi

Bug #2064208 reported by Dave Jones
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ubiquity (Ubuntu)
Triaged
High
Unassigned

Bug Description

After writing the Ubuntu 24.04 Desktop for Raspberry Pi image to an SSD drive with a USB3 interface (specifically; this issue does not occur when booting from an SD card), booting the drive on a Pi 4 or Pi 5, and running through the installer to the point where the (corrupted) slide deck starts to display during setup, the installer crashes.

[ Workaround ]

A test image is now available; please see comment 1 below for details.

At the time of writing, some workarounds have been found, but none that consistently work on all boards with all drives. One workaround that has worked on a Pi with a Samsung EVO SSD, and a Crucial SSD is as follows:

Before booting the image, find config.txt on the boot partition, and the "dtoverlay=vc4-kms-v3d" line within it. There will be two of these lines, you want the first one under an "[all]" section. Append ",cma-128" to the line. Specifically, the following section:

  dtoverlay=vc4-kms-v3d
  disable_fw_kms_setup=1

Should become:

  dtoverlay=vc4-kms-v3d,cma-128
  disable_fw_kms_setup=1

Unmount the drive cleanly, boot it, and run through the installer. You may revert the change (if you wish) after successful installation.

Another workaround, reported as working on a Pi 5 with an NVMe drive attached over PCIe:

Before booting the image, find config.txt on the boot partition. Under the first "[all]" section append the following line:

  dtparam=pciex1

Unmount the drive cleanly, boot it, and run through the installer.

Please note both workarounds have also been reported as failing with certain drive combinations.

[ Background ]

Given this crash occurs immediately upon the (corrupted) slide deck starting, that it only occurs when booting from USB (but the exact same image works from an SD card), and that merely changing the pre-allocation of the contiguous memory area affects it, I suspect this at least related to (if not a duplicate of) LP: #2037015, particularly since a crash bug is now associated with it too, LP: #2062146.

Still, I'll leave this open as a non-duplicate for now as I'm not positive of root-cause yet.

Related branches

Dave Jones (waveform)
description: updated
Dave Jones (waveform)
Changed in ubiquity (Ubuntu):
status: New → Triaged
importance: Undecided → High
Revision history for this message
Dave Jones (waveform) wrote :

I now have a test image that, using the patch from LP: #2037015, appears to fix the installer issue when booting from USB. If volunteers are interested in testing the image, I've made it available at:

  https://zoidberg.waveform.org.uk/images/ubuntu-24.04-preinstalled-desktop-arm64+raspi.img.xz

The SHA256 of the image, for verification purposes, is b2718d9005a5ea6486b8512b6cf3974ce48ef879d1232a6dc88b2ccaa1dc3390

I've tested booting from two SD cards on both models and both appear fine; I've also tested USB boot on the Pi 4 (which worked happily) and tomorrow I should be able to test NVMe on a Pi 5. However, given the variability displayed by this bug already, the wider the variety of hardware tested, the better.

Naturally, no workarounds should be in place when testing (leave the config.txt "as is"). If things work, please report the model and memory size of your Pi (e.g. Pi 4 4GB) and what you're booting from (SD card, SSD, NVMe). make+model of the boot media would be useful too, but largely to judge if we're covering a reasonable range of hardware.

If things don't work, please report the above information, plus where in the procedure the crash occurred. If possible, re-flash and try to confirm if the crash occurs in the same place each time (we've already seen cases in this bug where "sometimes it does and sometimes it doesn't").

description: updated
Revision history for this message
Marius Quabeck (marius.quabeck) wrote :

Hi Dave,
I'm not sure if this is of any help but I did install your image linked here and it worked perfectly.
This is on a rpi 4 8GB where I previously had issues with the installer crashing while installing to sd card, no matter which of your workarounds I've tried. So... yea your image fixed my issue and I was able to successfully install 24.04!

I have a few spare SD cards laying around, let me know if I can help debug anything.
Thanks man!

Revision history for this message
Graham Haddock (phrogger) wrote (last edit ):

I loaded your 'test image' onto an NVMe SSD on a RPi 5, did not edit the config.txt file or cmdline.text, and it worked!

[RPi5 4 GB, Pimoroni Base, Samsung 256 GB PM991a SSD, Firmware April 20, 2024]

I previously had tried all kinds of things over the last week, different NVMe cards, different imagers, all unsuccessfully.

24.04 running with the noticeable extra speed of a PCIe/NVMe is sweet!

I would suggest you add some kind of suffix or change to the file name, since, if this is going to be the only solution to NVMe or USB operation for a while, you don't want the confusion from two different functionality files with the same name out in the 'wild'.

Thanks for the fix.
--- Graham

Revision history for this message
Graham Haddock (phrogger) wrote :

I ran two additional tests with your "test image."
Both booted, initialized, ran successfully.

RPi5 8GB, USB SanDisk 32 GB USB 3.0, Firmware: April 20, 2024

RPi5 8GB, Pimoroni NVMe Base, AData Legend 800 SSD 1 TB, Firmware: April 20, 2024

--- Graham

Revision history for this message
Dave Jones (waveform) wrote :

@phrogger Brilliant, thanks for the confirmations; I've also tested a Sabrent NVMe drive here (successfully) and an ancient Intel SSD over USB (again successful). I think I'm happy to call this "good" at this point, so I'll push ahead with trying to get LP: #2037015 SRU'd back to noble, and then see if I can get the desktop image re-spun.

Revision history for this message
Dave Jones (waveform) wrote :

Oh, many thanks to @marius.quabeck as well -- all the confirmations are extremely helpful!

Revision history for this message
Konrad Krasowski (krasy8) wrote (last edit ):

Adding to the above:

1. @waveform - thank you so much for the new image!!! - it works! Nothing has worked for me until now, even the initial ubuntu setup from sd card (tried other options: usb stick, sd card via usb adapter, nvme), no matter how I flashed it (r-imager, balenda etcher). I always ended up with failed installation pop-up window, without even displaying the graphic glitch with the progress bar. Now I have managed successfully to set ubuntu 24.04 lts on my pi from the sd card as well as the nvme!

2. Test hardware details:

   - Raspberry pi 5 with 8gb ram
   - micro sd SanDisc Extreme V30 32GB flashed with Balena Etcher - on mac
   - nvme Lexar NM790 1TB (Gen 4x4) flashed with pi-imager using custom image option - on my pi when the above got running
   - Geekworm X1001 M.2 KEY-M NVMe SSD Shield for Raspberry Pi 5 (top)

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

If that patch works then this crash was probably bug 2062146.

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.