Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[WORKED-AROUND]Nvidia-drivers+efifb no console at boot
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
AndrewAmmerlaan
Apprentice
Apprentice


Joined: 25 Jun 2014
Posts: 154
Location: Lent

PostPosted: Mon Jul 15, 2019 8:46 am    Post subject: [WORKED-AROUND]Nvidia-drivers+efifb no console at boot Reply with quote

For various reasons I wanted to move the framebuffer console from the monitor connected to my iGPU to the monitor connected to my nvidia GPU.
I used to have BIOS/GRUB output on the nvidia card (because it was set as default in bios), and then have the kernel and openrc messages on the iGPU. Now I would like to have it all on the same monitor, to do that I enabled efifb in the kernel.
This sort of did what I wanted: early kernel messages are now printed on the monitor connected to the nvidia card, but then at the point where openrc should start the monitor just goes black and stays that way until sddm starts.
Now the strange thing is that it works just fine after that, once SDDM/X has started I can switch to a tty (on the monitor connected to the nvidia card) and that will work just fine, and at shutdown I can see all the messages that openrc prints there. The only time it doesn't work is at boot.
If sddm is removed from the runlevel it will just stay black forever.

Code:

andrew-gentoo-pc andrew # dmesg | grep efifb
[    0.254725] pci 0000:01:00.0: BAR 3: assigned to efifb
[    0.362960] efifb: probing for efifb
[    0.362968] efifb: framebuffer at 0xd1000000, using 5632k, total 5632k
[    0.362970] efifb: mode is 1600x900x32, linelength=6400, pages=1
[    0.362970] efifb: scrolling: redraw
[    0.362972] efifb: Truecolor: size=8:8:8:8, shift=24:16:8:0


Full dmesg: http://dpaste.com/2EESQXB

There are now 2 framebuffer devices, as expected:
Code:

andrew-gentoo-pc ~ # ls /dev/fb*
/dev/fb0  /dev/fb1


Does anyone know how I can get rid of the black screen between early-boot and sddm?

(I already tried removing the 'nvidia-drm.modeset=1' parameter)

--------------[EDIT]--------------
Adding nvidia, nvidia_modeset and nvidia_drm to /etc/modules-load.d gives me the following in rc.log:
Code:

* Loading module nvidia ...
* Failed to load nvidia
[ !! ]
* Loading module nvidia_modeset ...
[ ok ]
* Loading module nvidia_drm ...
[ ok ]


(Apparently it gives this error because the module is already loaded)

--------------[EDIT2]--------------
Same with simplefb:
Code:

andrew@andrew-gentoo-pc ~ % dmesg | grep simple
[    0.358479] simple-framebuffer simple-framebuffer.0: framebuffer at 0xd1000000, 0x57f000 bytes, mapped to 0x0000000039b4e62f
[    0.358481] simple-framebuffer simple-framebuffer.0: format=a8r8g8b8, mode=1600x900x32, linelength=6400
[    0.362380] simple-framebuffer simple-framebuffer.0: fb0: simplefb registered!


No errors, but somehow the screen still goes black between early-boot and sddm

Same problem with a different monitor
Same problem if GRUB_GFXPAYLOAD_LINUX=keep is commented out
If GRUB_GFXPAYLOAD_LINUX=text I don't get any console at all

x11-drivers/nvidia-drivers-430.34
_________________
OS: Gentoo KDE x86_64 (~amd64, 5.1.15-gentoo)
MB: MSI Z370-A PRO
CPU: Intel Core i7-8700K
GPU: NVIDIA GTX 1060 6GB & Intel UHD Graphics 630
SSD: Samsung 970 Pro 512GB
RAM: Crucial Ballistix 32GB DDR4-2400


Last edited by AndrewAmmerlaan on Wed Jul 31, 2019 9:51 am; edited 1 time in total
Back to top
View user's profile Send private message
nvaert1986
n00b
n00b


Joined: 05 May 2019
Posts: 19

PostPosted: Tue Jul 30, 2019 9:53 am    Post subject: Reply with quote

Did you emerge nvidia-drivers with the kms and uvm USE flags enabled? As I'm completely sure kms is required, but also noticed some functionality is not working when the uvm USE flag is not set.

Also try generating an initramfs using dracut (I've seen too much issues with genkernel) and include all the nvidia kernel modules to see what it does.
Also try compiling your kernel with the efifb disabled, because in some cases the efifb can give issues with the nvidia-kms driver.
Also make sure you start your system in UEFI mode with CSM disabled (for native resolution) and set the native resolution in your grub configuration and set the GFXPAYLOAD to keep

That should generally work.
Back to top
View user's profile Send private message
AndrewAmmerlaan
Apprentice
Apprentice


Joined: 25 Jun 2014
Posts: 154
Location: Lent

PostPosted: Tue Jul 30, 2019 3:03 pm    Post subject: Reply with quote

nvaert1986 wrote:
Did you emerge nvidia-drivers with the kms and uvm USE flags enabled? As I'm completely sure kms is required, but also noticed some functionality is not working when the uvm USE flag is not set.

ksm is enabled, uvm wasn't, I have enabled it now. I'll check if it works now.
[EDIT] No that didn't do it

nvaert1986 wrote:
Also try generating an initramfs using dracut (I've seen too much issues with genkernel) and include all the nvidia kernel modules to see what it does.

Don't have an initramfs at all atm, I will look into it.

nvaert1986 wrote:
Also try compiling your kernel with the efifb disabled, because in some cases the efifb can give issues with the nvidia-kms driver.

I could do this, but that will give me no framebuffer at all on the monitor connected to the nvidia card, which was the whole point of the operation.

nvaert1986 wrote:
Also make sure you start your system in UEFI mode with CSM disabled (for native resolution) and set the native resolution in your grub configuration and set the GFXPAYLOAD to keep

System is set to UEFI only, and grub boots with the correct resolution, gfxpayload is set to keep.
_________________
OS: Gentoo KDE x86_64 (~amd64, 5.1.15-gentoo)
MB: MSI Z370-A PRO
CPU: Intel Core i7-8700K
GPU: NVIDIA GTX 1060 6GB & Intel UHD Graphics 630
SSD: Samsung 970 Pro 512GB
RAM: Crucial Ballistix 32GB DDR4-2400
Back to top
View user's profile Send private message
AndrewAmmerlaan
Apprentice
Apprentice


Joined: 25 Jun 2014
Posts: 154
Location: Lent

PostPosted: Tue Jul 30, 2019 3:32 pm    Post subject: Reply with quote

Alright, I didn't solve this per se, but I did achieve the desired result of having bios and boot console on the same monitor(s) by setting the intel card as the boot GPU.
_________________
OS: Gentoo KDE x86_64 (~amd64, 5.1.15-gentoo)
MB: MSI Z370-A PRO
CPU: Intel Core i7-8700K
GPU: NVIDIA GTX 1060 6GB & Intel UHD Graphics 630
SSD: Samsung 970 Pro 512GB
RAM: Crucial Ballistix 32GB DDR4-2400
Back to top
View user's profile Send private message
nvaert1986
n00b
n00b


Joined: 05 May 2019
Posts: 19

PostPosted: Wed Jul 31, 2019 9:09 am    Post subject: Reply with quote

Hmm, that's odd.

Did you rum grub-mkconfig after generating the initramfs?
Did grub-mkconfig detect the initramfs and add it to your grub config file?
Did you explicitly state to add the 4 nvidia-drivers to the initramfs in the config file or on the command line (otherwise chances are they're not added)?
Did you verify the files were added to the initramfs?
Could you share the contents of your grub.cfg?

EDIT: Also be sure to read: https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers

For (U)EFI systems, uvesafb will not work. Be warned that enabling efifb support in kernel (CONFIG_FB_EFI=y) causes intermittent problems with the initialization of the NVIDIA drivers. There are reports of success from marking legacy framebuffers as generic and enabling the simple framebuffer while disabling all others.
Back to top
View user's profile Send private message
AndrewAmmerlaan
Apprentice
Apprentice


Joined: 25 Jun 2014
Posts: 154
Location: Lent

PostPosted: Wed Jul 31, 2019 9:49 am    Post subject: Reply with quote

nvaert1986 wrote:
Hmm, that's odd.

Did you rum grub-mkconfig after generating the initramfs?
Did grub-mkconfig detect the initramfs and add it to your grub config file?
Did you explicitly state to add the 4 nvidia-drivers to the initramfs in the config file or on the command line (otherwise chances are they're not added)?
Did you verify the files were added to the initramfs?
Could you share the contents of your grub.cfg?


I haven't tried a initramfs yet, but to my understanding this will only load the drivers earlier in the boot process, and the thing is the framebuffer (efifb/simplefb) works just fine up to the point were openrc starts and the nvidia-drivers get loaded. Therefore, I think that loading the drivers earlier might do nothing at best and at worst just make the problem occur earlier.

In any case the system is working to my satisfaction by setting the intel GPU as the boot GPU, now both the BIOS and the kernel boot messages are displayed on the same monitors and there is no more switching between monitors during the boot process.

nvaert1986 wrote:

EDIT: Also be sure to read: https://wiki.gentoo.org/wiki/NVIDIA/nvidia-drivers

For (U)EFI systems, uvesafb will not work. Be warned that enabling efifb support in kernel (CONFIG_FB_EFI=y) causes intermittent problems with the initialization of the NVIDIA drivers. There are reports of success from marking legacy framebuffers as generic and enabling the simple framebuffer while disabling all others.


I know, however the gentoo wiki is the only page I can find stating this, the arch wiki for instance seems to imply that efifb works just fine, in any case simplefb exhibits exactly the same behaviour.[/quote]
_________________
OS: Gentoo KDE x86_64 (~amd64, 5.1.15-gentoo)
MB: MSI Z370-A PRO
CPU: Intel Core i7-8700K
GPU: NVIDIA GTX 1060 6GB & Intel UHD Graphics 630
SSD: Samsung 970 Pro 512GB
RAM: Crucial Ballistix 32GB DDR4-2400
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum