26

I am having trouble with booting my new PC (graphics card), and have to repeatedly change stuff in Grub.

However, GRUB is really really slow. It takes 1 second for each key. And I cannot even queue my input, I literally have to wait 1 second until I can type the next key. This will slow down my whole night by hours.

Is this what Grub should behave like? I am reading things which require to edit grub settings - however, I don't have a running OS at the moment and editing something from GRUB takes N seconds, with N being the number of keystrokes to perform for the change.

Is there a solution? I am trying to install Ubuntu 19.10 by the way.

Update: It may be noteworthy that I have a 4K display. When Grub enters initially, I can see the borders being drawn over the screen, which takes like 1 second. Is that the delay I am seeing for every change?

Janos
  • 457
  • 1
  • 5
  • 12
  • 1
    Hey man, I'm having the exact same issue! It started happening after I put the SSD with the OS on it, into my new pc (I didn't update any files). I was quite happy to find that it would just boot, only after a few bootups I started to notice the extreme sluggish performance of GRUB. Maybe it is required to update some GRUB files? Did you find a solution? – Elias May 24 '20 at 14:30
  • Unfortunately I couldn't solve the issue yet. And I am scared of the moment when I screw up my system and have to go through that procedure again :(. I still believe it could be simply the graphics refresh time, but that is a lot of guessing. – Janos May 24 '20 at 18:08
  • You could flash a "grub rescue" image onto a USB beforehand, with it you could (if you messed grub up) easily boot into your os and do a reinstall of grub. Actually, doing a reinstall of grub might be what I will be trying if I have the time. It must be some hardware id/driver/interface related thingy. – Elias May 25 '20 at 07:11
  • It seems to be related to the resolution. /etc/default/grub has an entry GRUB_GFXMODE="1920x1080" (you mileage may vary with the resolution). Increasing it to my actual monitor size made it even slower. BTW this bug is probably about a decade old. https://ubuntuforums.org/showthread.php?t=2310219 https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/480159 https://bugzilla.redhat.com/show_bug.cgi?id=822123 https://unix.stackexchange.com/questions/285642/make-grub-menu-appear-faster-not-like-an-animation All seem to be talking about this issue (and that's just the first few hits on google) – Elias May 25 '20 at 07:47
  • I googled for "grub slow render" enjoy reading through some old threads if you have time lol. And let me know if you figure anything out. (It may also be worth noting that my old PC used an Intel processor and my new one has an AMD one.) – Elias May 25 '20 at 07:48
  • Same here, before I had Intel, now AMD Ryzen 9. Nvidia graphics. – Janos May 25 '20 at 19:01
  • I'm seeing a pattern lol, this may be worth a new question with those new details. So I'm almost certain that it doesn't affect AMD only users otherwise we would have heard about it (I'm on Nvidia graphics as well). So it must be some configuration (or version) which is specifically made for intel processors. – Elias May 26 '20 at 16:35
  • I opened a new issue here if you have anything to add https://askubuntu.com/questions/1246780/grub-slow-with-new-cpu-intel-amd – Elias Jun 04 '20 at 12:50
  • For reference, here's the bug report on this I found on GNU GRUB: https://savannah.gnu.org/bugs/?func=detailitem&item_id=61190 – Márcio Feb 28 '23 at 03:07

3 Answers3

19

Grub seems to have problems with high resolutions on certain systems. Setting grub to use a lower resolution fixed the input lag for me.

To do that edit the grub config file: /etc/default/grub

Look for the line GRUB_GFXMODE and change it to a suitable lower resolution for you system. E.g. in my case:

GRUB_GFXMODE=1280x1024x32,auto

Finally run update-grub as root to write the config changes.

Note: the resolution you choose must be supported on your system. To check them boot into grub, hit 'c' to get to the grub command line and type videoinfo to list the supported modes.

Ideally change the GFXmode as above so that it includes fallback resolutions if something goes wrong and add 'auto' (the default) at the end of the list. E.g. something like my_preferred_resolution,low_fallback_resolution,auto where each resolution is width x height [x depth]

spinxz
  • 1,319
  • I had the same issue for a bootable USB device. You can also edit the grub configurations there. For me, it was at /boot/grub/grub.cfg. The respective line there would be this: set gfxmode=1280x1024x32,auto. – bellackn Dec 18 '22 at 16:56
  • in a 4K monitor, navigating GRUB with the keyboard was practically impossible (keypresses were doubled 99% of the time) and grub screen draw/erase was super slow). Using the GFXMODE line above fixed the problem. Prior to finding this I thought the issue were USB settings in BIOS/UEFI, or the wireless (logitech) keyboard dongle etc. Of course none of that was the actual problem. – Ari Feb 21 '23 at 00:34
  • What is the x32 for? Can't we set it to just 1280x1024 as that's a resolution? I'm confused by the x32. Can you please explain? – J86 Aug 26 '23 at 00:19
  • 1
    @J86 The x32 is the number of bits per pixel used for color information. See https://en.wikipedia.org/wiki/Color_depth Note that 32 bits is actually 24 bits with 8 bits for alpha or unused. – Paul Hansen Mar 12 '24 at 18:17
0

Disabling secure boot in the BIOS seems to fix this problem for me.

I came to this conclusion after seeing that running videoinfo in the grub cli gave me secure boot related errors.

Philipp
  • 146
0

Found the solution to the same problem:

Enable CSM Support in BIOS

Its night and day

p.s. I found out the solution in a forum asking about why people use GRUB and someone replied that there are server configurations that need CSM and are buggy with UEFI, I guess grub is CSM based!