Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HOW-TO: from nvidia to nouveau+kms
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
hujuice
Apprentice
Apprentice


Joined: 16 Oct 2007
Posts: 199
Location: Rome, Italy

PostPosted: Sat Apr 16, 2011 6:34 pm    Post subject: HOW-TO: from nvidia to nouveau+kms Reply with quote

Stepping from nvidia to nouveau + kms is explained in details in many documents.
However, I didn't find a complete how-to, specially for Gentoo Linux.

I'll try here to recapitulate how to enable nouveau + KMS + framebuffer/fbsplash in an unique recipe.
If you find something wrong or debatable, leave a response to keep this post shared and updated.

Here is the documentation that you may need for a more detailed explanation.
Official: http://www.gentoo.org/doc/en/xorg-config.xml
Wiki: http://en.gentoo-wiki.com/wiki/KMS
Wiki: http://en.gentoo-wiki.com/wiki/Nouveau

Note: this HOW-TO has been written during the installation on a 2.6.36-gentoo-r8 (x86) kernel. The 2.6.37-gentoo-r4 (x86_64) steps are exactly identical.

1. Configure your new kernel.
edit 2013 21 02: The Nouveau kernel drivers are now in the "Direct Rendering Manager" sections and no longer in "staging driver".
Kernel configuration:
Device Drivers  --->
    Graphics support  --->
        <*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)  --->
        (all disabled here)
        <*> Support for frame buffer devices  --->
            [*]   Enable firmware EDID
            [*]   Enable Video Mode Handling Helpers
            *** disable all drivers ***
        Console display driver support  --->
            <*> Framebuffer Console support
            [*]   Support for the Framebuffer Console Decorations
    [*] Staging drivers  --->
        [ ]   Exclude Staging drivers from being built
        <*>     Nouveau (nVidia) cards
            [*]       Support for backlight control

(You need the very last one only if you have a laptop.)
Refs:
The X Server Configuration HOWTO - Installing Xorg
Kernel Mode Setting
nouveau

2. Compile the kernel and edit your /boot/grub/grub.conf.
(Tweak the examples depending on your needs)
Simple /boot/grub/grub.conf:
title=Gentoo Linux - 2.6.36-gentoo-r8-s1-kms
root (hd0,0)
kernel /kernel-kms root=/dev/sda6 nouveau.modeset=1

Don't forget the last kernel option, nouveau.modeset=1.
If you have/want fbsplash, you can enable it as follow.
/boot/grub/grub.conf with splash:
title=Gentoo Linux - 2.6.36-gentoo-r8-s1-kms
root (hd0,0)
kernel /kernel-kms root=/dev/sda6 splash=verbose,fadein,fadeout,theme:natural_gentoo console=tty1 nouveau.modeset=1
initrd /fbsplash-natural_gentoo-1024x768

(You need the appropriate initrd here. Read the wiki about fbsplash to learn more)
DO NOT REBOOT, take your time to complete the task.
Ref:
Kernel Mode Setting

2a. Recompile kernel depending packages, if upgrading.
If you come from a different kernel version, as usually, you'll need to recompile the kernel depending packages. nvidia-drivers is a weel known one.
Recompile them if you want. It is not relevant for our task.
Recompile kernel depending packages:
# module-rebuild rebuild

(emerge sys-kernel/module-rebuild if you need it.)

3. Teach your system about the new organization and update it.
(Tweak the example using your needs)
/etc/make.conf:
VIDEO_CARDS="nouveau fbdev v4l vesa vga"

Then, obviously, update the system.
If your system was already updated, you should have the following "news" (your use flags may differ).
New packages or rebuild needs:
# emerge -uNDav world

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] x11-base/xorg-drivers-1.9  INPUT_DEVICES="evdev keyboard mouse wacom -acecad -aiptek -elographics -fpit -joystick -penmount -synaptics -tslib -virtualbox -vmmouse -void" VIDEO_CARDS="fbdev nouveau* nvidia v4l vesa -apm -ark -ast -chips -cirrus -dummy -epson -fglrx -geode -glint -i128 -i740 (-impact) -intel -mach64 -mga -neomagic (-newport) -nv (-omapfb) -r128 -radeon -rendition -s3 -s3virge -savage -siliconmotion -sis -sisusb (-sunbw2) (-suncg14) (-suncg3) (-suncg6) (-sunffb) (-sunleo) (-suntcx) -tdfx -tga -trident -tseng -via -virtualbox -vmware (-voodoo)" 0 kB                                                                                                                                   
[ebuild   R   ] x11-libs/libdrm-2.4.23  USE="libkms -static-libs" VIDEO_CARDS="nouveau* -intel -radeon -vmware" 0 kB
[ebuild  N    ] x11-drivers/xf86-video-nouveau-0.0.16_pre20101130  0 kB
[ebuild   R   ] media-libs/mesa-7.10.1  USE="classic gallium nptl -debug -gles -hardened -llvm -motif -pic (-selinux)" VIDEO_CARDS="nouveau* -intel -mach64 -mga -r128 -radeon -savage -sis -tdfx -via -vmware" 0 kB                                                                         

Total: 4 packages (1 new, 3 reinstalls), Size of downloads: 0 kB

Would you like to merge these packages? [Yes/No]

Build (Don't detach. It will be quick, just the time to prepare a coffee).

5. Delete (or heavily reduce) your xorg.conf
As nvidia users, you probably still have a xorg.conf file.
If you have an english (us) keyboard you don't need it anymore.
Remove the xorg.conf:
# mv /etc/X11/Xorg.conf /etc/X11/Xorg.conf.backup

But if you have a non english keyboard, you still need a piece of configuration.
The new xorg spirit is to split the configuration in many files. So, for example, for my italian keyboard, I wrote the following simple configuration.
/etc/X11/xorg.conf.d/30-keyboard.conf for non us keyboards:
Section "InputClass"
        Identifier      "keyboard-all"
        Option          "XkbLayout" "it"

        MatchIsKeyboard "on"
EndSection

Ref:
The X Server Configuration HOWTO - Tweaking X settings

6. Switch to the new opengl.
Select the xorg opengl:
# eselect opengl set xorg-x11

(I prefer to stop X before. What will happen if you do it while X is running?)

7. Reboot.

8. Enjoy.
Try to switch now between consoles with ALT+CTRL+Fn and enjoy the difference.

The main disadvantage could be a reduced FPS rate, specially if you are a gamer (I'm not, I cannot give any feeling).
The main advantage is the appropriate hardware management, by the kernel. The console switch is a very clear example of this improvement.
And then, your are using open drivers! 8)

To learn more about the nouveau implemented/unimplemented features for your card, see the Feature matrix page in the Xorg wiki.

Thumbs up!
HUjuice

Edit: keep the proprietary drivers could create conflicts
_________________
Who haven't a spine, should have a method.
Chi non ha carattere, deve pur avere un metodo.


Last edited by hujuice on Thu Feb 21, 2013 10:14 am; edited 4 times in total
Back to top
View user's profile Send private message
jordanwb
l33t
l33t


Joined: 10 Jul 2008
Posts: 642
Location: Ottawa, Canada

PostPosted: Sat Apr 16, 2011 8:53 pm    Post subject: Reply with quote

thanks hujuice. Just an additional note, the last time I checked, 3D won't work with the GT200 series and newer cards due to some new chip being added. You can use software compositing like xcompmgr and metacity's built-in compositor. 3D works fine with the 9800 series and older cards.
Back to top
View user's profile Send private message
hujuice
Apprentice
Apprentice


Joined: 16 Oct 2007
Posts: 199
Location: Rome, Italy

PostPosted: Sun Apr 17, 2011 2:16 am    Post subject: Reply with quote

jordanwb wrote:
...the last time I checked, 3D won't work with the GT200 series and newer cards...


According to the X.Org Feature Matrix, the GT200 should be in the same NV50 class of my GTS 250. Composition and 3D work fine for me.
I cannot know anything more, I don't have a cellar full of cards :)

Anyway, I've installed nouveau on 5 different cards and everything went very fine, except for a GTS 250 fan management issue.
Generally speaking, the power management is another known limit of nouveau.

Here is a very interesting article about benchmark comparison between the two drivers.
Nvidia is still better, but the gap is going to decrease. In that test, the GT9800 card is where the gap is most noticeable .

Anyway, for non gamers, the KMS advantage is a very good counterpart of the 3D gap.
It depends on your behaviours. For my feeling, the better integration is perceptible.
I'm very happy for the ALT+CTRL+Fn switch (that I use often) and not so sad for the FPS decrease.

Our richness is the opportunity to choice.

Regards,
HUjuice
_________________
Who haven't a spine, should have a method.
Chi non ha carattere, deve pur avere un metodo.
Back to top
View user's profile Send private message
jordanwb
l33t
l33t


Joined: 10 Jul 2008
Posts: 642
Location: Ottawa, Canada

PostPosted: Sun Apr 17, 2011 2:05 pm    Post subject: Reply with quote

hujuice wrote:
According to the X.Org Feature Matrix, the GT200 should be in the same NV50 class of my GTS 250. Composition and 3D work fine for me.
I cannot know anything more, I don't have a cellar full of cards :)


The last time I tried nouveau was ~6 months ago, the issue was that the driver would lock up the entire system after an unknown amount of time if compiz was running. It may have been fixed. Anyways.

Here's the bug report: https://bugs.freedesktop.org/show_bug.cgi?id=26980
Back to top
View user's profile Send private message
lkraav
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2004
Posts: 121
Location: Estonia

PostPosted: Thu Apr 21, 2011 7:59 am    Post subject: Reply with quote

thanks for starting the thread. i'm looking to get plymouth going and am thinking about switching over to nouveau. is anyone here using it with xbmc? is the 3D performance sufficient for it (HD video)? i'm on GT210.
Back to top
View user's profile Send private message
barul
Guru
Guru


Joined: 28 May 2010
Posts: 429
Location: France

PostPosted: Thu Apr 21, 2011 8:41 am    Post subject: Reply with quote

On my laptop, with a nvidia G310m, nouveau make my X segfault :(
_________________
Save the penguins, burn the flags!
Back to top
View user's profile Send private message
lkraav
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2004
Posts: 121
Location: Estonia

PostPosted: Thu Apr 21, 2011 8:50 am    Post subject: Reply with quote

Cr0k wrote:
On my laptop, with a nvidia G310m, nouveau make my X segfault :(


state your versions also.
Back to top
View user's profile Send private message
barul
Guru
Guru


Joined: 28 May 2010
Posts: 429
Location: France

PostPosted: Thu Apr 21, 2011 9:08 am    Post subject: Reply with quote

I don't know if I remember well, but xf86-video-nouveau & libdrm& mesa in ~amd64 with the USEs gallium& llvm for mesa, with these options in the kernel :
Code:
CONFIG_AGP=y
CONFIG_AGP_INTEL=y
CONFIG_DRM=y
CONFIG_DRM_KMS_HELPER=y
CONFIG_DRM_TTM=y
CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
CONFIG_STAGING=y
CONFIG_DRM_NOUVEAU=y
CONFIG_FB_BACKLIGHT=y


And those desactivated :
Code:
CONFIG_FB_BOOT_VESA_SUPPORT
CONFIG_FB_VESA

_________________
Save the penguins, burn the flags!
Back to top
View user's profile Send private message
lkraav
Tux's lil' helper
Tux's lil' helper


Joined: 13 Oct 2004
Posts: 121
Location: Estonia

PostPosted: Thu Apr 21, 2011 9:17 am    Post subject: Reply with quote

Cr0k wrote:
I don't know if I remember well, but xf86-video-nouveau & libdrm& mesa in ~amd64 with the USEs gallium& llvm for mesa, with these options in the kernel :


Code:
qlist -Iv nouveau xorg-server drm mesa
Back to top
View user's profile Send private message
hujuice
Apprentice
Apprentice


Joined: 16 Oct 2007
Posts: 199
Location: Rome, Italy

PostPosted: Thu Apr 21, 2011 12:14 pm    Post subject: Reply with quote

Since I manage 5 desktop (nvidia card with kde + composition for all them), I can report my experience.

Everything goes fine and smoothly on:
  • nVidia Corporation G98 [GeForce 9200M GS] (rev a1) (laptop)
  • nVidia Corporation G86 [GeForce 8500 GT] (rev a1)
  • nVidia Corporation G96 [GeForce 9500 GT] (rev a1)

The behaviour is fine and smooth, but the pm lack produce a very noisy 100% spinning fan on:
  • nVidia Corporation G92 [GeForce GTS 250] (rev a2)

The composition is NOT smooth on:
  • nVidia Corporation G72 [GeForce 7300 SE/7200 GS] (rev a1) (weird log messages: is it a mistake by me?)


HUjuice
_________________
Who haven't a spine, should have a method.
Chi non ha carattere, deve pur avere un metodo.
Back to top
View user's profile Send private message
barul
Guru
Guru


Joined: 28 May 2010
Posts: 429
Location: France

PostPosted: Thu Apr 21, 2011 1:47 pm    Post subject: Reply with quote

lkraav: Yes I know, but actually I'm not sure of the versions number, the last time I tested nouveau was maybe 1 or 2 monthes ago. I think it was the day of the release of the "~0.0.16_pre20110323" version of nouveau.
_________________
Save the penguins, burn the flags!
Back to top
View user's profile Send private message
Otamay
n00b
n00b


Joined: 04 Apr 2011
Posts: 18

PostPosted: Thu Apr 21, 2011 7:34 pm    Post subject: Reply with quote

A dirty hack:

I have nvidia and nouveau in the same gentoo system with two kernels sharing the same modules.

The first kernel, vmlinuz-2.6.39-rc3-nouveau has nouveau included in the kernel. The second one, vmlinuz-2.6.39-rc3-nvidia have nouveau and DRI disabled, and uvesafb enabled by default.

With a custom initrd I have a silent splash which works with both kernels.

There are two xorg.conf configurations, for nouveau and nvidia, called xorg.conf.nouveau and xorg.conf.nvidia .

Reaching xdm init script, it searches for which kernel has been loaded, and changes the X.org configuration to load the X. Below is the function inside xdm that do the trick.

Code:

check_nvidia() {
        cd /etc/X11/
        if grep -q nouveau /proc/cmdline
                then einfo "Nouveau  kernel detected."
                if !(eselect opengl list | grep xorg | grep -q \*)
                        then
                                einfo "Changing to X11 OpenGL..."
                                eselect opengl set xorg-x11
                fi
                ln -sf xorg.conf.nouveau xorg.conf
        else
                einfo "Kernel without nouveau."
                if !(eselect opengl list | grep nvidia | grep -q \*)
                        then
                                einfo "Changing to nvidia OpenGL..."
                                eselect opengl set nvidia
                fi
                ln -sf xorg.conf.nvidia xorg.conf
        fi
}


and check_nvidia is called in the start function, just before startDM.sh line.
---
Nice guide, useful to be in a wiki.
Back to top
View user's profile Send private message
hujuice
Apprentice
Apprentice


Joined: 16 Oct 2007
Posts: 199
Location: Rome, Italy

PostPosted: Fri Apr 22, 2011 9:11 pm    Post subject: Reply with quote

Otamay wrote:
A dirty hack:
...


I like the idea. It is clear and manageable with etc-update or dispatch-conf.

Can we have a nouveau+kms kernel and the nvidia opengl?

8O

HUjuice
_________________
Who haven't a spine, should have a method.
Chi non ha carattere, deve pur avere un metodo.
Back to top
View user's profile Send private message
salahx
Guru
Guru


Joined: 12 Mar 2005
Posts: 420

PostPosted: Sat Apr 23, 2011 8:53 pm    Post subject: Reply with quote

nouveau locks up my keyboard and display (mouse works and Magic sysrq works). To get it not to lock up I added nouveau.noaccel=1 to the command line
Back to top
View user's profile Send private message
PinguinoLoco
n00b
n00b


Joined: 04 Feb 2009
Posts: 21

PostPosted: Sat Apr 23, 2011 11:44 pm    Post subject: Reply with quote

Nice howto. Got it working fine with a 8600GT except two issues:

- Nouveau doesn't respect vsync setting in KDE Desktop Effects. Is there a way to configure nouveau to respect vsync application setting?

- The two power settings of my GPU are detected, but it looks like nouveau always uses the highest one, resulting in a raise of 15 degrees celsius in GPU core temperature (the card is passively cooled)
Back to top
View user's profile Send private message
kurisu
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jan 2011
Posts: 105
Location: Munich, Germany

PostPosted: Sun Apr 24, 2011 3:25 am    Post subject: Reply with quote

Thank you for the guide.

I have just switched from nvidia to nouveau on a 7050 onboard card. Works flawlessly now, however, I had to upgrade to 2.6.38. Otherwise, I would have seen nothing but a mess once Xorg has started. EXA definitely requires 2.6.38 on this card.
Back to top
View user's profile Send private message
Helena
Veteran
Veteran


Joined: 02 Apr 2003
Posts: 1030
Location: De Meern, The Netherlands

PostPosted: Sun Apr 24, 2011 7:14 am    Post subject: Reply with quote

Wish that my GTX460 card (NVC0 type) were supported better by nouveau...

Well you can't have everything as I explained elsewhere http://forums.gentoo.org/viewtopic-p-6662065.html
Back to top
View user's profile Send private message
wswartzendruber
Veteran
Veteran


Joined: 23 Mar 2004
Posts: 1227
Location: Jefferson, USA

PostPosted: Wed Apr 27, 2011 3:49 am    Post subject: Reply with quote

Does anyone have HDMI audio working?
Back to top
View user's profile Send private message
shaman200
n00b
n00b


Joined: 29 Dec 2005
Posts: 30

PostPosted: Tue Oct 04, 2011 11:05 am    Post subject: Reply with quote

Thanks Hujuice for this very clear how-to, i'm switching between consoles all the time and I enjoy the difference :)

As of nouveau support, it works flawlessly on my GTX560.

Regarding 3D performance, I switched to gnome 3 and it's working perfectly (on kernel 3.1.5).
_________________
War is Peace, Freedom is Slavery, Ignorance is Strength.
Back to top
View user's profile Send private message
fbcyborg
Advocate
Advocate


Joined: 16 Oct 2005
Posts: 3021
Location: ROMA

PostPosted: Fri Mar 02, 2012 11:34 am    Post subject: Reply with quote

Thank you so much for the howto.
It saved me a lot of time and worked perfectly.
_________________
[HOWTO] Come criptare la /home usando cryptsetup e luks
[HOWTO] Abilitare il supporto al dom0 XEN su kernel 3.X
Help answer the unanswered
Back to top
View user's profile Send private message
fbcyborg
Advocate
Advocate


Joined: 16 Oct 2005
Posts: 3021
Location: ROMA

PostPosted: Fri Mar 02, 2012 12:45 pm    Post subject: Reply with quote

By the way, I've encountered two problems after switching to nouveau+kms:

1) the audio via HDMI doesn't work anymore
2) Sometimes the screen freezes repeatedly every ~20 seconds, sometimes not.

This is what I have seen in the dmesg:
Code:
nvidia: module license 'NVIDIA' taints kernel.


Could it be that the package x11-drivers/xf86-video-nouveau conflicts with the nouveau kernel module?
_________________
[HOWTO] Come criptare la /home usando cryptsetup e luks
[HOWTO] Abilitare il supporto al dom0 XEN su kernel 3.X
Help answer the unanswered
Back to top
View user's profile Send private message
s4e8
Apprentice
Apprentice


Joined: 29 Jul 2006
Posts: 215

PostPosted: Fri Mar 02, 2012 1:57 pm    Post subject: Reply with quote

Nouveau always give me GPU lockup, with 8600 and GT240. So I throw these cards, and bought and AMD 6850, and it work except HDMI audio.
Back to top
View user's profile Send private message
Hu
Watchman
Watchman


Joined: 06 Mar 2007
Posts: 9168

PostPosted: Sat Mar 03, 2012 12:20 am    Post subject: Reply with quote

Recent releases of the kernel disable HDMI audio on (some?) Radeon chipsets because some Radeon cards mishandle video when the audio is probed. If your card is not affected, you can pass radeon.audio=1 to the kernel to enable HDMI audio.

fbcyborg: that line from dmesg indicates that you did not fully remove the proprietary nVidia driver from your system. Running both nVidia and Nouveau at the same time is unlikely to work well, if at all.
Back to top
View user's profile Send private message
depontius
Advocate
Advocate


Joined: 05 May 2004
Posts: 2689

PostPosted: Sat Mar 03, 2012 3:04 am    Post subject: Reply with quote

I've managed to build a system that can run either nVidia or nouveau drivers, chosen when X starts. Simply blacklist all of the kernel drivers, so that none of them load at boot. Then whenever you start X, the necessary kernel modules will get demand-loaded. Personally I wouldn't switch drivers without rebooting, simply because I don't trust the nVidia kernel module to completely and safely unload.

Unfortunately none of this works for me. I have an old system that uses Rambus memory, and is horribly touchy on the video side. I'm stuck at the 173-series drivers, even though the video card is still supported by the current driver series. Anything newer, and it crashes in less than an hour. Unfortunately, Nouveau also crashes within an hour. The only reliable operation I get is with nvidia-drivers-173.x.
_________________
.sigs waste space and bandwidth
Back to top
View user's profile Send private message
fbcyborg
Advocate
Advocate


Joined: 16 Oct 2005
Posts: 3021
Location: ROMA

PostPosted: Sat Mar 03, 2012 7:19 am    Post subject: Reply with quote

Hu wrote:
fbcyborg: that line from dmesg indicates that you did not fully remove the proprietary nVidia driver from your system. Running both nVidia and Nouveau at the same time is unlikely to work well, if at all.


Thanks a lot, you are right. That was the problem.
_________________
[HOWTO] Come criptare la /home usando cryptsetup e luks
[HOWTO] Abilitare il supporto al dom0 XEN su kernel 3.X
Help answer the unanswered
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
Goto page 1, 2  Next
Page 1 of 2

 
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