# Use nouveau for framebuffer, unload, use nvidia for X - ????

## returnof Snekiepete

I have searched, and cannot find any information to allow me to use the nouveau module to load my framebuffer (since the nvidia driver does not do this) an then unload nouveau when I start X.

How do I initiate the nouveau module right away in the boot process then kill it when I launch X?

----------

## axl

let's start with the basics. kernel version. board version. etc.

----------

## returnof Snekiepete

4.17.8-gentoo

I am using an nVidia GTX 1080 card. EFIFB gives me a framebuffer at a max of 1280x1024. When I build nouveau into the kernel, I can get a framebuffer at 4k but no nvidia-driver love for X.

I currently have nouveau selected as a module, but blacklisted at boot so I can use X. I am guessing there is a way to load the nouveau module early enough to get the console resolution at 4k and then unload nouveau and then load nvidia-driver if/when I want to start X?

----------

## axl

modprobe.blacklist=nouveau modprobe.blacklist=nvidia. 

you can set those in the bootloader as kernel parameters. and use best of both systems. as long as it works and you remember to switch eselect opengl/cl.

----------

## returnof Snekiepete

But I want nouveau to load to get the high res framebuffer, right?

For some reason, when I blacklist nvidia and not nouveau, my boot hangs. Are there any other options for a high res console with nvidia and EFI?

----------

## axl

 *returnof Snekiepete wrote:*   

> But I want nouveau to load to get the high res framebuffer, right?
> 
> For some reason, when I blacklist nvidia and not nouveau, my boot hangs. Are there any other options for a high res console with nvidia and EFI?

 

https://bugzilla.kernel.org/show_bug.cgi?id=199853

try kernels bellow 4.12.10. not sure it's gonna help...

----------

## bammbamm808

 *returnof Snekiepete wrote:*   

> I have searched, and cannot find any information to allow me to use the nouveau module to load my framebuffer (since the nvidia driver does not do this) an then unload nouveau when I start X.
> 
> How do I initiate the nouveau module right away in the boot process then kill it when I launch X?

 

There are a couple of kludgy ways to do it using module switching and scripts, but I avoided all that by using fb_efi and then launching my kernel in graphical mode using rEFInd. Not sure how you would do this using Grub, or whatever launching methodology you have chosen. I use rEFI to set the fb to 1920 x 1080.

My kernel has only dri, generic fb and fb_efi. I set my fb to 1080p using rEFInd, then it launches my efistub kernels in graphical mode. I suppose you could do the same thing using Grub. This has worked for kernels from 4.9 up to my current 4.17.6

----------

## returnof Snekiepete

I am just not smart enough to figure out rEFInd... It looks pretty cool - but moving from grub to it isn't working for me. I can't fathom that in 2018 this is such a difficult task to get a working framebuffer on such a fancy graphics card

----------

## bammbamm808

 *returnof Snekiepete wrote:*   

> I am just not smart enough to figure out rEFInd... It looks pretty cool - but moving from grub to it isn't working for me. I can't fathom that in 2018 this is such a difficult task to get a working framebuffer on such a fancy graphics card

 

Give rEFInd a try and post in this thread when you get stuck, or pass the graphical boot option to your kernel via Grub. I spent quite a bit of time seeking what you are, hi res console and nvidia-drivers for X. Should be do-able. Don't give up. Struggling is how you learn these things.

----------

## Marcih

 *bammbamm808 wrote:*   

> [...] pass the graphical boot option to your kernel via Grub. I spent quite a bit of time seeking what you are, hi res console and nvidia-drivers for X. Should be do-able.

 

Wait, returnof Snekiepete, is getting your FB to be at a higher resolution all you're trying to do? Loading nouveau and nvidia-driver for FB and X respectively seems a bit much for the task. I have EFI FB as my only framebuffer compiled in kernel and I use GRUB2 as my bootloader, all I need to do to get a 1920x1080 resolution for the console is to set the desired resolution in /etc/defaults/grub on the GRUB_GFXMODE line, i.e.

```
GRUB_GFXMODE=1920x1080x32,640x480x32,auto
```

(640x480 and auto were the defaults, I left them there as a fallback)

Try that before getting yourself into a world of headache with loading different display drivers at runtime; my first guess would be starting at .xinit with unloading nouveau and loading nvidia-drivers.

----------

## bammbamm808

 *Marcih wrote:*   

>  *bammbamm808 wrote:*   [...] pass the graphical boot option to your kernel via Grub. I spent quite a bit of time seeking what you are, hi res console and nvidia-drivers for X. Should be do-able. 
> 
> Wait, returnof Snekiepete, is getting your FB to be at a higher resolution all you're trying to do? Loading nouveau and nvidia-driver for FB and X respectively seems a bit much for the task. I have EFI FB as my only framebuffer compiled in kernel and I use GRUB2 as my bootloader, all I need to do to get a 1920x1080 resolution for the console is to set the desired resolution in /etc/defaults/grub on the GRUB_GFXMODE line, i.e.
> 
> ```
> ...

 

Even better. I was unable to use higher resolutions in my board's efifb without 'use_graphics_for linux' in my refind.conf. Is that down to each board's UEFI firmware?

----------

## returnof Snekiepete

I did try the Grub method described above, unfortunately, the highest I can get from that is 1280x1024. I am going to give the rEFInd option another shot this weekend.

----------

## bammbamm808

 *returnof Snekiepete wrote:*   

> I did try the Grub method described above, unfortunately, the highest I can get from that is 1280x1024. I am going to give the rEFInd option another shot this weekend.

 

I dont know how to configure grub since I moved to rEFInd once I had UEFI hardware, but compile efistub support into your kernels and copy them to /boot. Emerge rEFInd or install manually. With luck, you will only have to edit /boot/refind_linux.conf to point to your rootfs, and if needed, pass 'nomodeset' to your kernel. If this gets you booting, albeit at a lower resolution,  adding 'use_graphics_for linux' to /boot/efi/EFI/refind.conf, and setting your desired resolution, will hopefully get you what you're after. Your exact efi partition structure might be a bit different, but rEFInd more or less searches /boot and subdirectories, at a minimum, anyway.

Get back to us with your progress.

----------

## returnof Snekiepete

I finally had a chance to get rEFInd up and running. I am still only getting 1280x1024 throughout the boot process. When rEFInd starts, it yells at me only allowing resolution up the the 1280x1024. I have the 'use_graphics_for linux' set and the only options I have selected in the kernel are efifb. 

Maybe the 1280 res is the best I will be able to get? When I use Nouveau I can get the 4k console, but as known, no nvidia blob for X.

----------

## Jaglover

I have currently no nVidia hardware, but last time I used the blob I remember it had its own KMS module. If it still exists you may need to force its loading.

----------

## returnof Snekiepete

I am halfway there with my original path. If I enable the nouveau module in the kernel and blacklist the nvidia modules I get the nice console resolution. Then I can

```
rmmod nouveau -f & modprobe nvidia & rc-service xdm start
```

And I get to my lightdm login. So I am thinking this will be simple to automate on the front end. However, getting back out of X has proven challenging.

I have tried 

```
killall X & rmmod nvidia_modeset nvidia_drm nvidia -f & modprobe nouveau
```

BUt, it's not working for logout/reboot.

----------

## bammbamm808

What prebuilt/motherboard do you have?

----------

## returnof Snekiepete

MSI Z370 SLI Plus

----------

## bammbamm808

I set this all up a while ago. I will go through my .config and my rEFInd config files to see if there is anything else that might help.

----------

## returnof Snekiepete

Thanks bammbamm! I reviewed your config files in another post, but couldn't get this figured out. Is it a limitation of the motherboard?

----------

## bammbamm808

 *returnof Snekiepete wrote:*   

> Thanks bammbamm! I reviewed your config files in another post, but couldn't get this figured out. Is it a limitation of the motherboard?

 

Im thinking it might be. Perhaps that is all your UEFI implementation allows. I'll post back after I've reviewed all the pertinent configuration on my system.

----------

## bammbamm808

(Self-replied so that OP would be notified of new post)

Kernel version is 4.17.6-gentoo with experimenal use flag set. In my kernel, I have:

<*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)  --->

       [*]   Enable legacy fbdev support for your modesetting driver

#under framebuffer devices:

[*] EFI-based Framebuffer Support

In /boot/efi/EFI/refind/refind.conf, I have threse

resoolution 1920 1080

use_graphics_for linux

I'm also starting with 'nomodeset" because without it, I get no display as the kernel initializes. This is passed via /boot/refind_linux.conf

Your efi tree might vary. Adjust as needed.

----------

## returnof Snekiepete

I feel silly, but I have this figured out. I set the BIOS to UEFI mode only (selecting in the OS section Windows 10 WHQL support. My bios even looks much cooler now as well! Thanks for all the help!

----------

## bammbamm808

 *returnof Snekiepete wrote:*   

> I feel silly, but I have this figured out. I set the BIOS to UEFI mode only (selecting in the OS section Windows 10 WHQL support. My bios even looks much cooler now as well! Thanks for all the help!

 

And only now I remember that the 'compatibility' mode limits efi fb resolution. Glad you sorted it though.

----------

