elementary / os

The OS build system
https://elementary.io
GNU General Public License v3.0
992 stars 131 forks source link

Use a safe(r) GRUB gfxmode #609

Open carniz opened 2 years ago

carniz commented 2 years ago

This fixes 2 known symptoms/issues with the installer:

  1. The screen goes black after "Try or install" (see https://github.com/elementary/os/issues/546)
  2. Installer fails with "error: out of memory" (see https://github.com/elementary/installer/issues/542)

These issues might be specific to systems using HiDPI/4K monitors. My laptop happens to be one of those, and I've experienced the installer failing in both of these ways with gfxmode=auto.

davidmhewitt commented 2 years ago

I don't think this is a particularly good idea. It might solve those issues for you, but cause different issues for other people. auto is the default because it's supposed to set a sensible resolution for any computer. Either your hardware/firmware is not providing a sensible default to GRUB, or there's a bug with GRUB and/or its drivers on your hardware.

Can you confirm whether the latest Ubuntu 20.04 boots OK on your hardware? If it does, we may have to look at doing something similar to what that's doing, which is the following:

if loadfont /boot/grub/font.pf2 ; then
    set gfxmode=auto
    insmod efi_gop
    insmod efi_uga
    insmod gfxterm
    terminal_output gfxterm
fi
carniz commented 2 years ago

Ubuntu 20.04.3 (ubuntu-20.04.3-desktop-amd64.iso) behaves the same way as elementaryOS 6.x: the monitor just goes black after the Grub screen. NB: Changing gfxmode to 800x600 fixes the issue also for the Ubuntu installer.

Apart from blocking the installer from booting, the auto gfxmode also makes the text on the Grub screen impossible to read on a 15" 4K monitor without a magnifying glass - so merging this PR would fix 2 different types of issues at once.

At least it seems evident to me that the Grub auto gfxmode breaks stuff on certain hardware, and I don't know what other options there are apart from using a "safe" resolution. Shouldn't 800x600 be supported by most (if not all) hardware by now?

carniz commented 2 years ago

DSC_1585 DSC_1587

For reference: here's what the Grub screen looks like with gfxmode=auto and gfxmode=800x600 in the Ubuntu 20.04.3 installer on my Dell Precision 5510 (15" 3840x2160 monitor)

carniz commented 2 years ago

DSC_1780 DSC_1781

Updated the PR with fallback to auto (see https://www.gnu.org/software/grub/manual/grub/html_node/gfxmode.html). Attaching photos of what the elementaryos-7.0-daily.20220127 Grub screen looks like with set gfxmode=800x600,auto on my 15" 4K 3840x2160 monitor.

thel1ghtbr1nger commented 1 year ago

Would love to see a final solution to this, works fine on my desktop at 1920x1080p but not on my laptop with a 13 inch 4k monitor. That being said, I'm curious if touch capabilities affect the matter?

carniz commented 1 year ago

Would love to see a final solution to this, works fine on my desktop at 1920x1080p but not on my laptop with a 13 inch 4k monitor.

That's weird...is it a Dell XPS 13, perhaps? I tried this with elementaryos-7.0-daily.20221201.iso on my Dell Precision 5510 (4k monitor), and it worked as expected. Without the change I get the dreaded "Out of memory" error.

thel1ghtbr1nger commented 1 year ago

Would love to see a final solution to this, works fine on my desktop at 1920x1080p but not on my laptop with a 13 inch 4k monitor.

That's weird...is it a Dell XPS 13, perhaps? I tried this with elementaryos-7.0-daily.20221201.iso on my Dell Precision 5510 (4k monitor), and it worked as expected. Without the change I get the dreaded "Out of memory" error.

I’ve not managed to make the change as editing the iso has proven difficult and it seems I have static options that don’t include elementary os when I use use the method you mentioned previously to write the iso.

However I am using a Razer blade stealth 13 w/4K monitor so I imagine our issue is the same, I’m just getting hung up

carniz commented 1 year ago

Would love to see a final solution to this, works fine on my desktop at 1920x1080p but not on my laptop with a 13 inch 4k monitor.

That's weird...is it a Dell XPS 13, perhaps? I tried this with elementaryos-7.0-daily.20221201.iso on my Dell Precision 5510 (4k monitor), and it worked as expected. Without the change I get the dreaded "Out of memory" error.

I’ve not managed to make the change as editing the iso has proven difficult and it seems I have static options that don’t include elementary os when I use use the method you mentioned previously to write the iso.

The secret is to use unetbootin for creating the bootable USB, since it becomes read-only otherwise. And based on my own experience it sometimes requires more than one try/boot before the firmware/BIOS detects the USB drive. So I'd say give it one more shot, persistence usually wins the game :)

vjr commented 1 year ago

As a workaround have you folks tried increasing the UEFI/BIOS setting for "initial video memory" size? It's called something similar or like "reserved graphics memory".

If available it's usually set to a low value but you could try bumping to the max and see if it makes a difference?

thel1ghtbr1nger commented 1 year ago

Would love to see a final solution to this, works fine on my desktop at 1920x1080p but not on my laptop with a 13 inch 4k monitor.

That's weird...is it a Dell XPS 13, perhaps? I tried this with elementaryos-7.0-daily.20221201.iso on my Dell Precision 5510 (4k monitor), and it worked as expected. Without the change I get the dreaded "Out of memory" error.

I’ve not managed to make the change as editing the iso has proven difficult and it seems I have static options that don’t include elementary os when I use use the method you mentioned previously to write the iso.

The secret is to use unetbootin for creating the bootable USB, since it becomes read-only otherwise. And based on my own experience it sometimes requires more than one try/boot before the firmware/BIOS detects the USB drive. So I'd say give it one more shot, persistence usually wins the game :)

When I try to write with unetbootin, elementary doesn’t show up in my writable options, total noob with unetbootin, does it need to be used from the cli to select a local iso?

thel1ghtbr1nger commented 1 year ago

As a workaround have you folks tried increasing the UEFI/BIOS setting for "initial video memory" size? It's called something similar or like "reserved graphics memory".

If available it's usually set to a low value but you could try bumping to the max and see if it makes a difference?

Will try when I get home

carniz commented 1 year ago

Would love to see a final solution to this, works fine on my desktop at 1920x1080p but not on my laptop with a 13 inch 4k monitor.

That's weird...is it a Dell XPS 13, perhaps? I tried this with elementaryos-7.0-daily.20221201.iso on my Dell Precision 5510 (4k monitor), and it worked as expected. Without the change I get the dreaded "Out of memory" error.

I’ve not managed to make the change as editing the iso has proven difficult and it seems I have static options that don’t include elementary os when I use use the method you mentioned previously to write the iso.

The secret is to use unetbootin for creating the bootable USB, since it becomes read-only otherwise. And based on my own experience it sometimes requires more than one try/boot before the firmware/BIOS detects the USB drive. So I'd say give it one more shot, persistence usually wins the game :)

When I try to write with unetbootin, elementary doesn’t show up in my writable options, total noob with unetbootin, does it need to be used from the cli to select a local iso?

The unetbootin interface isn't very intuitive, but if you don't want to use one of the supported distributions from the "=== Select Distribution ===" drop-down, you can click the Diskimage radio-button (in the lower part of the interface) and then click the ". . ." button to browse to a local .iso file: image

peteruithoven commented 1 year ago

I was experiencing the same issue on a Dell XPS 15 9550, building an ISO based on this PR fixed the issue for me. (More details on my issue).

@vjr I tried looking through the options in my BIOS screen, but couldn't find anything like "initial video memory". Could you clarify?

thpang commented 1 year ago

Any progress here? This one has been out there for quite some time. With many work arounds trying to explain how to create ones own ISO when in reality if this PR was merged then folks could at least move forward. Thx.