# How to load nvidia and not nouveau? (SOLVED)

## Helena

Months ago I installed another copy of Gentoo to my new system. This, by the way, is a sixcore SSD system with an nvidia GeForce GTX 460 card.

This installation is an unstable tree, so it's got openRC and baselayout-2.

At first I used the nouveau driver, which worked out of the box, both in console mode and in X.Org mode. After a while it became clear that the driver is too slow for KDE's desktop effects; since it also doesn't provide 3D-acceleration I want to switch to nvidia's closed-source driver. However it is not clear how I should do that. Let me show what happened.

First I changed

```
VIDEO_CARDS="nouveau"
```

in /etc/make.conf to

```
VIDEO_CARDS="nouveau nvidia"
```

and added "nvidia" to my USE flags. After updating my system using the well-known sequence

```
emerge ---sync

emerge -uND world

emerge --depclean

revdep-rebuild
```

and switching to nvidia's openGL layer using

```
eselect opengl set nvidia
```

I still could not start X. This was no real surprise since I already knew that nouveau and nvidia cannot coexist on one system and nouveau had already been loaded as my console framebuffer driver. So I tried to reboot but that did not help because udev matched my video card during sysinit with teh noveau driver. And, having the nouveau driver loaded for your console you cannot load nvidia anymore.

So my next step was to entirely remove nouveau from my system. So I again changed /etc/make.conf to contain

```
VIDEO_CARDS="nvidia"
```

again updating my system after that and rebooting.

But, surprise, nouveau was still loaded by udev! Apparently it still exists on my system in binary form, probably in /usr/lib64 somewehere. However that's an area of my system that I haven't touched before and am reluctant to do. I'm looking for a little advice here! Mentioning nvidia in /etc/conf.d/modules doesn't help since that comes later than udev.Last edited by Helena on Tue Apr 12, 2011 4:55 am; edited 2 times in total

----------

## cach0rr0

 *Helena wrote:*   

> 
> 
> But, surprise, nouveau was still loaded by udev! Apparently it still exists on my system in binary form, probably in /usr/lib64 somewehere. However that's an area of my system that I haven't touched before and am reluctant to do. I'm looking for a little advice here! Mentioning nvidia in /etc/conf.d/modules doesn't help since that comes later than udev.

 

it's in your kernel still. rebuild the kernel without nouveau support, and you should be good to go (also, dont use nvidia in conjunction with any framebuffer drivers, or youll hit the same problem IIRC)

Suppose you could also write a udev rule for this if you dont want to reconfigure your kernel, but i wouldnt know where to begin

----------

## AaronPPC

If nouveau is compiled as a module you should be able to add it to /etc/modprobe.d/blacklist.conf.  However the best way is to take it out of the kernel.

----------

## vincent-

Don't forget to configure Xorg to load nvidia driver.

/etc/X11/xorg.conf.d/40-nvidia.conf

```

Section "Device"

    Identifier     "Device0"

    Driver         "nvidia"

EndSection

```

You didn't need to do that with nouveau because nouveau driver is part of xorg driver set, and xorg checks your video card and loads a good xorg driver for it. But nvidia driver is external to xorg, and you need to tell xorg "psss, l want to use this driver, please".

----------

## Helena

Thanks everyone. I should have realized this myself, had just forgotten it was in the kernel. I considered using blacklisting but decided not to.

----------

## Jon Wilder

Not meaning to thread jack, but I'm having a similar issue with my nVidia 7800GS card. I originally compiled in the Nouveau in kernel driver. I understand that to use the proprietary nVidia drivers that I have to completely take the Nouveau driver out of the kernel. So far I have -

Removed the Nouveau driver from the kernel

Recompiled the kernel

Changed the VIDEO_CARDS="nouveau" to VIDEO_CARDS="nvidia" in the make.conf file

Rebuilt xorg-drivers

However, a couple of questions -

1) Once the Nouveau driver has been removed from the kernel, the kernel recompiled and I've booted into the new kernel, is it absolutely necessary to perform an emerge -uND world/emerge --depclean/revdep-rebuild?

2) Do I absolutely need to rebuild nvidia-drivers?

3) Does the nVidia proprietary driver adjust the screen resolution to the proper resolution for my monitor when in CLI mode? Or does it only do it in X and KDE?

----------

## cach0rr0

 *Jon Wilder wrote:*   

> 
> 
> 1) Once the Nouveau driver has been removed from the kernel, the kernel recompiled and I've booted into the new kernel, is it absolutely necessary to perform an emerge -uND world/emerge --depclean/revdep-rebuild?
> 
> 

 

heavens no. like swatting a fly with a nuclear weapon! You might, however, qlist -CI x11-driver |xargs emerge (which, should rebuild nvidia-drivers)

 *Jon Wilder wrote:*   

> 
> 
> 2) Do I absolutely need to rebuild nvidia-drivers?
> 
> 

 

they will need to be rebuilt against the current kernel, I believe

 *Jon Wilder wrote:*   

> 
> 
> 3) Does the nVidia proprietary driver adjust the screen resolution to the proper resolution for my monitor when in CLI mode? Or does it only do it in X and KDE?

 

on its own it only does it in X or KDE

if you want it on CLI, best look at enabling the vesa framebuffer driver - do not enable any of the others (e.g. riva or uvesa), then to get a "pretty" CLI you'd need to append a video statement to your grub.conf line (or is it vga? or does it matter? I haven't used fb in ages)

----------

## Gusar

uvesafb works fine with nvidia. What you need to append in grub is vga= for vesafb, or video= for uvesafb. Refer to their documentation how exactly these need to be set.

----------

## Helena

 *Gusar wrote:*   

> uvesafb works fine with nvidia. What you need to append in grub is vga= for vesafb, or video= for uvesafb. Refer to their documentation how exactly these need to be set.

 I don't agree. I couldn't get it working with my GTX 460 (using a 1920*1080 monitor) because it thinks it's a GF104 card and limits the console resolution to 160*64; nouveau doesn't support that either (I mean all the fancy acceleration features, desktop effects,...).

So I have two options, both not completely satisfactory:

have an ugly console mode and a wonderful X-modehave a wonderful console mode and only a moderate X-modeI'm not happy.

----------

## Gusar

What I meant with "uvesafb works fine with nvidia" is that those two drivers don't interfere with each other. But both vesafb and uvesafb are limited to resolutions that are in the card's vbios, and nvidia cards may or may not have widescreen resolutions in there, that's always been the case.

----------

## Helena

Well that's something nouveau doesn't worry about. It happily computes its own resolutions...

----------

