[SOLVED] [uEFI] grub2-efi, nVidia, high-res efifb (non-nouveau) virtual consoles
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2015
    Location
    US-AL-Chilton County
    Age
    45
    Posts
    6

    [uEFI] grub2-efi, nVidia, high-res efifb (non-nouveau) virtual consoles

    PREFACE: I spent a few hours in early July figuring this out, piecing it from various sources. Most articles were using uEFI CSMs (legacy 16-bit BIOS Int10h and VESA BIOS Extensions, VBE, compatible boot), which does not address native uEFI booting using the native, framebuffer virtual console options. The default EFI framebuffer (efifb) is the console in use if you don't load a GPU-specific console, which is the case if one is running with the proprietary nVidia drivers.** Hence why I wrote this, for those that are as well.

    System Under Test.
    • Dell Precision M4600, Latest Firmware A16 revision
    • Dell PR02X Docking Station (2x DisplayPort / 2x dual-link DVI)
    • nVidia Optimus disabled, configured to try external port first, then LCD
    • Native 64-bit uEFI Boot, no CSM/legacy 16-bit BIOS Int10h Video Services, no VESA BIOS Extensions (VBE) possible
    • Fedora x86-64 release 22 (applicable to most x86-64 distros)


    If you're reading this, you should know why your search found it. You are loading the proprietary nVidia driver**, but you're tired of seeing that limited 100x25 (or similar) EFI Framebuffer driver at standard 800x600 SVGA, and you want to fix it.

    So, to start, here's are the relevant lines for the GRUB default configuration file (/etc/default/grub). You'll need to tailor the resolutions to your supportred GPU, output and display combinations ... more on that in a bit.

    Code:
     GRUB_CMDLINE_LINUX=" ... (cut) ... nouveau.modeset=0 rd.driver.blacklist=nouveau video=vesa:off rhgb quiet"
     GRUB_GFXMODE=2560x1440x32,1920x1080x32,1280x800x32,1024x768x32,800x600x32
     GRUB_GFXPAYLOAD_LINUX=keep
     GRUB_TERMINAL_OUTPUT="gfxterm"
    Of course, you're going to need to rebuild the grub.cfg as well after modification.

    Code:
    # grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
    First off ... since you're using the nVidia proprietary driver, the kernel command line parameters (GRUB_CMDLINE_LINUX) you should have already disabled and blacklisted the nouveau Kernel Mode Setting (KMS) so it is not used for Kernel Framebuffer. Furthermore, for safe measure (probably not require or doesn't work with uEFI, at least those without some Compatibility Support Modules, CSM), prevent the VESA KMS from setting or loading as well.

    Now ... let's get to the meat.
    The three (3) lines we are about here are ...
    1. List of Graphics Modes (GRUB_GFXMODE)
    2. All-important Graphics Payload (GRUB_GFXPAYLOAD_LINUX) "keep" from GRUB2's set to Linux kernel hand-off, and ...
    3. Tell GRUB that the terminal (GRUB_TERMINAL_OUTPUT) is APA, and not text


    uEFI implementations will vary wildly, and top that off, the EFI Framebuffer (efifb) will have different capabilities for different GPUs and their internal framebuffers, which are separate from the OS-uEFI framebuffer. Remember, you're not using a PC with 16-bit BIOS Int 0x10 video services, or even VESA BIOS Extensions, etc...

    Hence these realities I ran into ...
    • I couldn't get anything but 32-bit color to work for efifb
    • It looks like the nVidia GPU framebuffer sizes at the maximum resolution and color depth, and down-scales, depending on the output and connected panel (e.g., DisplayPorts to my Samsungs)
    • This is separate from the OS-efifb framebuffer
    • Supported graphics modes _changed_ based on output


    Now as aforementioned, you'll want to use a list of graphics modes. In my case, I define five (5). Your GPU, output and display may differ in what is supported. E.g., 1280x720 v. 1280x800, etc...

    • A) 2560x1440x32 (16:9 aspect, max of older DP or DVI-DL)
    • B) 1920x1080x32 (16:9 aspect, native of built-in LVDS DFP)
    • C) 1280x800x32 (16:10 aspect, not perfect)
    • D) 1024x768x32 (4:3 aspect, not perfect)
    • E) 800x600x32 (4:3 aspect, default SVGA in efifb)


    When docked, and the DisplayPort 1.2 (but not 1.2a -- limitation of the Intel-provided interconnect, despite being discrete nVidia) connections used, "B" was not available. It resulted in a 320x90 console using the kernel's sun16 8x16 font.

    When not docked, of course "A" isn't available, but "B" is. That resulted in a 240x67 console with the 8x16 font.

    "C" was universal in everything I tried, although a non-perfect 16:10 aspect, as 1280x720 was _not_ available (and would be perfect 2:1 and 3:2, for "A" and "B", respectively). It resulted in a 120x50 console with the 8x16 font.

    "D" is pretty universally supported by everyone.

    "E" is actually the SVGA default for efifb, with a caveat. One would assume the console would 100x37 with a 8x16 font. But for some reason it was 100x25, as if only 400 scan lines. This sounded much like the VGA text mode of 720x400 in the old PC days, using a 9x16 font, despite 640x480 being for APA modes. Here, it's like 800x400 using the 8x16 font, seemingly with filler lines, although not too noticeable.

    Whether "E" was thrown or not, if it resulted in 800x600x32 for efifb as reported by the kernel, it was clearly the fastest scroll, almost as if not APA, but a psuedo text mode for EFI firmware Framebuffer.

    Which is where things get interesting ...

    "A" was the fastest scrolling for the DP panel, as it is native to the DP panel. It seems the nVidia GPU runs best when it's not auto-scaling, because it always seems to be driving the panel at 2560x1440 regardless. I tried 1600x1200 4:3 (1600x900 16:9, 1440x900 16:10 and other modes didn't work), and it was very sluggish, so going to the native, higher res worked best, even over 1280x800 16:10 too.

    Likewise, "B" was the fastest scrolling for the internal LVDS DFP, as it too was native. Same results with trying different resolutions, it's best to have it use 1920x1080. Again, it seems that the nVidia GPU always uses the native resolution, at 32-bit color depth (no other modes would work), and there is overhead on the GPU to do anything else, even if the kernel efifb thinks it's only 1600x1200, 1280x800, etc...

    The only thing "sluggish" was the grub2-efi console/editor when having to use the cursor or edit in the GRUB2 menu itself, proportional to the resolution. The kernel had no such performance issues with efifb, and was fastest in the native resolution.

    I only included "C" and "D" for projector and similar, external support in case I need such. Since I've configured my notebook to prefer the external ports over the internal for the "default" console, hence for the docking station, this will be necessary if I boot with a projector other, external display plugged-in. Of course, once X loads, this is no longer the case (and has my preferences in configurations).

    Just FYI for those using Linux x86-64 and grub2-efi in native 64-bit uEFI boot. No need to load any "modules" (e.g., don't bother to install "grub2-efi-modules") or hack up any GRUB2 scripts. It "just works" although you'll need to play with your resolution lists for your GPU and connected displays.

    In my case, if I'm using my 28" panels, I get 2560x1440 at boot. If I'm not docked, I get 1920x1080 at boot. If I re-dock, the console will remain on the current, default console, even if X is not using it as a result of docking (changes to external dock ports). Part of the reason I'm not using nouveau, I need to be able to dock and undock without issues.**

    Of final note ...I also dislike the font in the "starfield theme" (grub2-starfield-theme) and don't use it. It's totally ugly, especially at lower resolutions, in my view.

    -- bjs

    **P.S. Please no inquiries or questions about "nvidia" v. "nouveau". That's not the purpose of this post.

    For those of us with portables, who need flawless dock/undock support, performance and power optimization (which is difficult with Optimus on Linux, ironically the purpose for Optimus), this is merely a solution I offer. For more on the "versus" of the 4 combinations, see the "Summary" table in this article (about 60% down the scrollbar).
    URL not allowed as I'm too new
    - negativo17.org/complex-setup-with-nvidia-optimus-nouveau-prime-on-fedora-19-2/

    Now ... if you want flawless virtual consoles and X, without issues, at the expensive of various things (dock/undock, performance, power, etc...), then the "nouveau" driver 'unifies' everything (no separate efifb needed for console). Again, I only offer this documentation for those who have decided to use nVidia, and are using a native uEFI boot with no BIOS/VBE support, which means the EFI framebuffer (efifb) driver is used.
    Last edited by TheBS; 13th August 2015 at 11:26 PM.
    Bryan J Smith, LPIC-3, RHCA [ linkedin.com/in/bjsmith ]
    >>20y User - Red Hat Linux May Day to Current Fedora Release - All F26-F28 x86-64 Native uEFI Boot
    Notebook (15.6" 1080p): Dell Precision m4800, i7-4800MQ, 32GiB, 1TB NAND, 2x2TB, K2100M 2GiB
    Mini-ITX/SFX (7x9x11"): SilverStone SG05B, Z97, i7-4790k, 16GiB, 1TB NAND, 4x2TB, GTX1080 8GiB

  2. #2
    Join Date
    Feb 2015
    Location
    the dungeon
    Posts
    3

    Re: [uEFI] grub2-efi, nVidia, high-res efifb (non-nouveau) virtual consoles

    Thank you. Three hours in and I found your post. Worked perfectly.

  3. #3
    Join Date
    Aug 2015
    Location
    US-AL-Chilton County
    Age
    45
    Posts
    6

    Re: [uEFI] grub2-efi, nVidia, high-res efifb (non-nouveau) virtual consoles

    Quote Originally Posted by MindfulCoyote
    Thank you. Three hours in and I found your post. Worked perfectly.
    Yep, still works and is relevant today. I'm now on a Dell Precision M4800 (Haswell generation) with a Quadro K2100M (similar, but higher spec, GTX 740 equivalent). Should still be applicable to the thinner Dell Precisions as well, possibly other options.

    I'm surprised how many people are still using CSM for legacy boot support. For me, the best way to multi-boot, even among different Linux distros (now that Debian-Ubuntu installers-boot have added support), is with native uEFI-GPT storage. And it's definitely the way for Windows 7/8/10 x64 with Linux.
    Bryan J Smith, LPIC-3, RHCA [ linkedin.com/in/bjsmith ]
    >>20y User - Red Hat Linux May Day to Current Fedora Release - All F26-F28 x86-64 Native uEFI Boot
    Notebook (15.6" 1080p): Dell Precision m4800, i7-4800MQ, 32GiB, 1TB NAND, 2x2TB, K2100M 2GiB
    Mini-ITX/SFX (7x9x11"): SilverStone SG05B, Z97, i7-4790k, 16GiB, 1TB NAND, 4x2TB, GTX1080 8GiB

Similar Threads

  1. nvidia nouveau Xorg high cpu charge
    By alex4evr in forum Hardware & Laptops
    Replies: 0
    Last Post: 17th August 2011, 03:49 PM
  2. high temp with nouveau driver and nvidia 8700M GT
    By chepioq in forum F16 Development
    Replies: 2
    Last Post: 20th June 2011, 04:29 PM
  3. F13: How do I disable virtual consoles
    By Vraile in forum Using Fedora
    Replies: 11
    Last Post: 28th September 2010, 09:35 AM
  4. Virtual Consoles
    By primo_larry in forum Installation, Upgrades and Live Media
    Replies: 6
    Last Post: 21st October 2006, 02:04 AM
  5. No text in virtual consoles
    By boback0 in forum Using Fedora
    Replies: 0
    Last Post: 22nd February 2006, 12:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •