# Black Screen with nvidia drivers

## Faraclas

Hey guys.  I'm pretty new to Gentoo these days [I ran a few Gentoo systems about a decade ago in school, now I am trying to get back in] and I am having a beast of a time with the nvidia drivers.  Here is a bit of background... I tried a Gentoo install from scratch [nvidia, systemd, gnome 3.8] and nothing worked.  It was too ambitious. So to verify the hardware compatibility with linux drivers, I installed Linux Mint 17 on the system including the nvidia drivers (wireless, sound, etc.)  Since everything was working, I wrote down what modules were being used for the hardware and decided to try Gentoo again.

So I had a nice working system (OpenRC, Xfce, network manager, sound, etc) using the nouveau driver.  I figured since everything else was working, that is would be easy to do the switch to the nvidia drivers.

I followed the wiki http://wiki.gentoo.org/wiki/NVidia/nvidia-drivers and rebooted and now have a blank screen.  I cant get into another console (ALT+F<anything>) to see what is going on.  I have checked the following:

Made sure kernel configuration is as specified: no framebuffers, no nouveau, no DRI

I am using the right version of the nvidia drivers (the latest 340 drivers which I verified in Linux Mint)

Use flags and others as specified in the Wiki

/etc/init.d/modules has "nvidia" called out (along with sky2 [ehternet], ath9k [wireless], and agpgart [per wiki])

dbus is set to run on the default level

I have searched the forums and found similar issues but nothing I thought could help me so far.  [/list]

Can someone please help me troubleshoot this?  I was getting so excited to have a Gentoo system again, and my wife is almost onboard to try and use it!!!  Thanks in advance.

----------

## Faraclas

Ok I am making progress...

```
/etc/X11/xorg.conf.d/20-nvidia.conf

Section "Device"

        Identifier "Nvidia Card"

        Driver "nvidia"

        VendorName "NVIDIA Corporation"

EndSection
```

Now I do get into slim and can log into Xfce after seeing the nvidia logo.  The problem now is that my screen is being detected as 3480x1080, when it is really only 1920x1080.

I looked in /etc/X11 and there is no xorg.conf that exists.  Inside /etc/X11/xorg.conf.d there is just the file I already created above.  Using NVIDIA X Server Settings (the gtk GUI) I do not see any means of specifying the size.

Thanks!

----------

## Jaglover

You can create more conf files, they all will be read by Xorg. For instance 30-screen.conf.

See what options nvidia driver accepts in /usr/share/doc/nvidia-drivers-<version>

----------

## Faraclas

Thanks! I ran the gtk GUI for configuring the card and was able to select the right configuration for a single monitor with the right resolution.  Then I went to save the configuration, and it showed me a preview of the file.  I instead took your advice and created several more files in /etc/X11/xorg.conf.d.  Rebooted and the display is very nice!

However, not I have another problem... I can't see anything except for X.  When the system boots, I choose the option from Grub and see initializing the RAM fs and then it goes black for about 15s until the nvidia logo flashes, then it goes black until the slim login.  Then, when shutting down, it goes black for the whole process.

So how do I get visualization back?  The wiki instructed me to disable all frame buffers, so I did.

Thanks for the help guys!

----------

## Faraclas

I made a little progress using the uvesafb (http://wiki.gentoo.org/wiki/Uvesafb)

Now when it boots I can see the text up until the Wiat for uevents to process line.  After this, the screen goes black for about 15s until the nvidia splash screen flashes and then I am into slim.  Then, when shutting down the system, the screen goes crazy after x shuts down until the computer is off.  So something is still not right with this setup and the nvidia drivers.

I am using the following in /etc/default/grub

```
GRUB_CMDLINE_LINUX="rootfstype=ext4 video=uvesafb:1600x1200-32,mtrr:3,ywrap"
```

----------

## Faraclas

Hey Guys, any additional help on this one?  I'm kind of stuck...

----------

## aweal

 *Faraclas wrote:*   

> Hey Guys, any additional help on this one?  I'm kind of stuck...

 

maybe its nvidia and 3.18 kernel, as for me 

 *Quote:*   

>  * Gentoo supports kernels which are supported by NVIDIA
> 
>  * which are limited to the following kernels:
> 
>  * <sys-kernel/gentoo-sources-3.18
> ...

 

cat /var/log/Xorg.0.log | grep EE

 *Quote:*   

> [   991.288] (EE) NVIDIA: Failed to initialize the NVIDIA kernel module. Please see the
> 
> [   991.288] (EE) NVIDIA:     system's kernel log for additional error messages and
> 
> [   991.288] (EE) NVIDIA:     consult the NVIDIA README for details.
> ...

 

----------

## Faraclas

So just to reiterate, my nvidia drivers are working GREAT now!!! The problem is that once the nvidia moduule loads, I cannot see anything on the terminals.  So I cant see the boot action or the shutdown.  Worse, if I make a mistake on something and goof stuff up, I cant ALT+CTRL+F# to stop X or do anything...

----------

## Faraclas

Hey guys, these nvidia drivers are really kicking my butt here.

I upgraded to version 340.65 and they don't work properly anymore.

It says it is using 1920x1080, but EVERYTHING is too big.  So it must be actually running in some other resolution.

  * NVIDIA Xserver Settings reports 1920x1080

```
elias@EpicLinux ~ $ xdpyinfo | grep dimensions

  dimensions:    1920x1080 pixels (361x200 millimeters)
```

  BUT my terminals now take up half the screen, conky is not fitting on the screen anymore, etc, etc. If is definately NOT 1920x1080

I would like to roll back to version 340.58, but I can't seem to get portage to find the ebuild.  It seems portage can only find the 340.65 version

Can anyone please please help fix this?

a) How do I rollback to nvidia-drivers-340.58

b) Is there another way to make my screen actually display 1920x1080

I was supposed to take my computer to show a friend how awesome my gentoo system was tonight. (I know, dont ever do any updates before you need to do something important). Now I'm bumming cause I cant show him this...

----------

## Ant P.

 *Faraclas wrote:*   

> So just to reiterate, my nvidia drivers are working GREAT now!!! The problem is that once the nvidia moduule loads, I cannot see anything on the terminals.  So I cant see the boot action or the shutdown.  Worse, if I make a mistake on something and goof stuff up, I cant ALT+CTRL+F# to stop X or do anything...

 

This has always been the case, for over 10 years. There is no workaround. It's the sacrifice you make for using nvidia drivers/cards.

----------

## NeddySeagoon

Ant P.,

vesafb used to work with the binary blob and may still do so.  The latest drivers do not support my 5 year old GeForce 9800 GT, so I can't test.

You will get dire warnings when the nvidia kernel module loads about you configuration is unsupported.

If vesafb fails, the plain old vga text console will still work but then you won't get any tux logos on starup and can't play videos on the console.

----------

## jburns

I use the UVESA frame buffer driver with a builtin initramfs of INITRAMFS_SOURCE="/usr/share/v86d/initramfs" in the past I have used the VESA  frame buffer driver.  They seem to compatible with the nvidia-drivers.

----------

## Faraclas

Thanks for the replies.  I went back in to check my config and I did not have 

```
INITRAMFS_SOURCE="/usr/share/v86d/initramfs" 
```

set.  I added in into the config via

```
genkernel --menuconfig all

emerge @module-rebuild
```

but still no framebuffer output appearing.

Also, any ideas what is going on with the nvidia-driver-340-65?  The nvidia-driver-340-5x was working great!

Thanks again

----------

## NeddySeagoon

Faraclas,

```
INITRAMFS_SOURCE="/usr/share/v86d/initramfs" 
```

provides support for the uvesa framebuffer.

You need to select it in the kernel too.

----------

## comprookie2000

In your first post you quoted the wiki;

"Made sure kernel configuration is as specified: no framebuffers, no nouveau, no DRI "

I have found this as true, I don't use any framebuffer myself.

/etc/default/grub for grub 2 

```

# Copyright 1999-2013 Gentoo Foundation

# Distributed under the terms of the GNU General Public License v2

# $Header: /var/cvsroot/gentoo-x86/sys-boot/grub/files/grub.default-2,v 1.4 2013/09/21 18:10:55 floppym Exp $

#

# To populate all changes in this file you need to regenerate your

# grub configuration file afterwards:

#     'grub2-mkconfig -o /boot/grub/grub.cfg'

#

# See the grub info page for documentation on possible variables and

# their associated values. 

GRUB_DISTRIBUTOR="Gentoo"

GRUB_DEFAULT=0

GRUB_HIDDEN_TIMEOUT=0

GRUB_HIDDEN_TIMEOUT_QUIET=false

GRUB_TIMEOUT=10

# Append parameters to the linux kernel command line

GRUB_CMDLINE_LINUX="init=/usr/lib/systemd/systemd"

# Append parameters to the linux kernel command line for non-recovery entries

#GRUB_CMDLINE_LINUX_DEFAULT=""

# Uncomment to disable graphical terminal (grub-pc only)

GRUB_TERMINAL=console

# The resolution used on graphical terminal.

# Note that you can use only modes which your graphic card supports via VBE.

# You can see them in real GRUB with the command `vbeinfo'.

#GRUB_GFXMODE=640x480

# Path to theme spec txt file.

# The starfield is by default provided with use truetype.

# NOTE: when enabling custom theme, ensure you have required font/etc.

#GRUB_THEME="/boot/grub/themes/starfield/theme.txt"

# Background image used on graphical terminal.

# Can be in various bitmap formats.

#GRUB_BACKGROUND="/boot/grub/mybackground.png"

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to kernel

#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries

#GRUB_DISABLE_RECOVERY=true

```

I use dual monitors but here is my /etc/X11/xorg.conf Like it was said you can use a folder also if you want, I just put it all in one file.

```

# nvidia-xconfig: X configuration file generated by nvidia-xconfig

# nvidia-xconfig:  version 331.20  (buildmeister@swio-display-x86-rhel47-05)  Wed Oct 30 18:20:53 PDT 2013

Section "ServerLayout"

    Identifier     "Layout0"

    Screen      0  "Screen0"

    Option         "Xinerama" "0"

EndSection

Section "Files"

EndSection

Section "ServerFlags"

   Option         "Xinerama" "0"

EndSection

Section "Monitor"

    Identifier     "Monitor0"

    VendorName     "Unknown"

    ModelName      "Unknown"

    HorizSync       28.0 - 33.0

    VertRefresh     43.0 - 72.0

    Option         "DPMS"

EndSection

Section "Device"

    Identifier     "Device0"

    Driver         "nvidia"

    VendorName     "NVIDIA Corporation"

EndSection

Section "Screen"

    Identifier     "Screen0"

    Device         "Device0"

    Monitor        "Monitor0"

    DefaultDepth    24

    SubSection     "Display"

        Depth       24

    EndSubSection

EndSection

Section "Extensions"

   Option         "Composite" "true"

EndSection

```

----------

## Faraclas

For the INITRAMFS_SOURCE I only put that in the kereel config. Do I need to put it into grub as well? How?

----------

## jburns

If your going to use UVESA see http://wiki.gentoo.org/wiki/Uvesafb

----------

## Faraclas

 *jburns wrote:*   

> If your going to use UVESA see http://wiki.gentoo.org/wiki/Uvesafb

 

Yeah, I followed this guide (a few times now) and have not been able to get it working.  I'm open to other options.  Really anything that can allow me to a) watch it boot and b) [more importantly] kill X to get to a console would be awesome.

----------

## NeddySeagoon

Faraclas,

Put your kernel .config on a pastebin site.

wgetpaste is your friend.

----------

## Faraclas

Edit - deleted this cause it was me not reading properly...

----------

## Faraclas

Well guys, I redid the uvesafb wiki and....

it works!!!!!!  Thanks for all of your help!

----------

## Maffblaster

Good hear hear that someone was able to get Nvidia Drivers working in Gentoo. I tried a few months ago on a newer notebook, but wasn't able to successfully get anything working.

Maybe I'll try again...it would be nice to connect more than just the default monitor to the notebook.

----------

## NeddySeagoon

Maffblaster,

nVidia ... notebook ...

Do you have an Optimus graphics system?

That works but its a different problem to the one discussud in this thread.

----------

## Maffblaster

Hi Neddy,

It is Optimus. Do you have a solution to get it properly setup and working? Do you have it Optimus as well?

Thanks!

----------

## NeddySeagoon

Maffblaster,

I don't have any hardware that new.  There are several threads nere ending in success.

Its also documented in the nvidia README file which gets installed with nvidia-drivers.

From memory, its around chapter 33.

Be sure to use up to date information. There is a lot of development going on aruond hybrid graphics systems.

As a result, there is more that one solution.  Be sure not to try to mix different solutions.

----------

