Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

 
Thread Tools Display Modes
Old January 21st, 2009   #1
Hakimio
Just Give Me the Beans!
 
Hakimio's Avatar
 
Join Date: Nov 2006
Location: Lithuania
Beans: 58
Ubuntu 8.10 Intrepid Ibex
Lightbulb HOWTO: Nouveau - Open source 3d drivers for nvidia graphic cards

HOWTO: Nouveau - Open source 3d drivers for nvidia graphic cards

Intro

Nouveau is a project which aims at producing Open Source 3D drivers for nVidia cards. In this tutorial I would like to explain how to install latest version of nouveau drivers from git repository.
Here is a list of links with some useful info about the project:
  1. Nouveau Companion 42
  2. Discussions about nouveau at phoronix

This guide is meant for those who are using nv drivers and want more speed, people who don't like to use proprietary software, people who like testing new things, software junkies (like me) and developers.
It's NOT meant for average users, hardcore gamers or compiz/beryl users(neither of them currently works with these drivers, but compiz++ should work whith xrender backend which still needs to be written).
Currently driver developers only support 2D driver (just as stable as nv driver, but faster). 3D driver is NOT officially supported and bug reports are NOT accepted, as there is still much to implement and memory management still has to be ironed out (playing 3d games with high resolutions for extended periods is not recommended...).
The good news is that the driver supports composite, damage, render and many other extensions, so you can use metacity (gnome window manager) or xfwm4 (XFCE4 wm) built-in compositing managers to get all those neat effects. Also it's reported that Open Arena runs pretty well and I have tried to run Fallout2 under wine - runs pretty well for me.

Part A: Removing nvidia drivers
  1. Uninstall it
    • If you installed the drivers using ubuntu official repository:
      Code:
      sudo apt-get --purge remove nvidia-glx-* nvidia-settings
    • If you used nvidia installer from nvidia website(replace VERSION with nvidia driver version!):
      Code:
      sudo sh NVIDIA-Linux-x86-VERSION-pkg1.run --uninstall
  2. Open xorg.conf:
    Code:
    sudo gedit /etc/X11/xorg.conf
  3. Find Driver "nvidia" line in Device section, replace it with Driver "nv" and save the file
  4. Restart X server using Ctrl+Alt+Backspace.

Part B: 2D driver installation
  1. Dependency installation
    Code:
    sudo apt-get install git-core libpthread-stubs0-dev autoconf libtool
  2. Acquire drm sources
    Code:
    git clone git://anongit.freedesktop.org/git/mesa/drm/
  3. Enter the directory
    Code:
    cd drm
  4. Run autogeneration and configuration scripts
    Code:
    ./autogen.sh
  5. Compile the sources
    Code:
    make
  6. Install it
    Code:
    sudo make install
  7. Enter linux-core directory and compile kernel modules
    Code:
    cd linux-core ; make nouveau.o
  8. Make sure neither DRM, nor nvidia kernel modules are loaded - commands specified below should NOT return anything:
    Code:
    lsmod | grep nvidia
    lsmod | grep drm
  9. If they did return sth (otherwise skip to next step), remove the modules
    Code:
    sudo rmmod nvidia 
    sudo rmmod drm
  10. Insert new modules
    Code:
    sudo insmod drm.ko
    sudo insmod nouveau.ko
  11. Ok, now let's edit xorg.conf (if you are using KDE replace gedit with kate and XFCE users should use mousepad)
    Code:
    sudo gedit /etc/X11/xorg.conf
  12. Find device section and replace the current driver line (most probably it's Driver "nv") with
    Code:
    Driver "nouveau"
  13. Add two new sections to the end of the file and save it:
    Code:
    Section "ServerFlags"
        Option  "AIGLX" "off"
    EndSection
    Section "DRI"
        mode 0666
    EndSection
  14. Back to terminal. This time we'll go back to the directory where we downloaded drm source and download Xorg nouveau driver:
    Code:
    cd ../..; git clone git://anongit.freedesktop.org/git/nouveau/xf86-video-nouveau/
  15. Even more dependencies this time:
    Code:
    sudo apt-get install xorg-dev mesa-common-dev
  16. Let's enter xf86-video-nouveau directory
    Code:
    cd xf86-video-nouveau
  17. Run autogeneration and configuration scripts:
    Code:
    ./autogen.sh
  18. Compile the driver
    Code:
    make
  19. Copy the driver to /usr/lib/xorg/modules/drivers directory
    Code:
    sudo cp src/.libs/nouveau_drv.so /usr/lib/xorg/modules/drivers
  20. To prevent nvidia module from loading again, we need to blacklist it. To do that open /etc/modprobe.d/blacklist
    Code:
    sudo gedit /etc/modprobe.d/blacklist
  21. Add to the end of the file:
    Code:
    blacklist nvidia
  22. Close all your applications and restart the server with Ctrl+Alt+Backspace
  23. Congratulations - you should be running 2d nouveau driver now. To check if it's loaded try:
    Code:
    lsmod | grep nouveau
    and you should see some output. Also Xorg.0.log should state:
    Code:
    (II) Loading /usr/lib/xorg/modules/drivers//nouveau_drv.so
    (II) Module nouveau: vendor="X.Org Foundation"
    to check it run the following:
    Code:
    gedit /var/log/Xorg.0.log

Part C: 3D driver installation
Warning: Currently nouveau's developers do NOT support 3D driver and any bug reports are NOT accepted.
Please SEE NOTES SECTION BEFORE proceeding, to see if you should be able to do anything more than just test/help debug current 3d drivers with your VGA!
  1. Even more dependencies:
    Code:
    sudo apt-get install xutils-dev build-essential
  2. Also this time we'll need another dependency which is not provided by ubuntu. Let's acquire it:
    Code:
    git clone git://anongit.freedesktop.org/xorg/proto/dri2proto
  3. Enter the directory and run autogeneration and configuration scripts:
    Code:
    cd dri2proto; ./autogen.sh
  4. Install it:
    Code:
    sudo make install
  5. Let's get back to the directory we were before
    Code:
    cd ..
  6. Download nouveau's mesa sources:
    Code:
    git clone git://anongit.freedesktop.org/git/mesa/mesa
  7. Enter mesa directory and switch to the gallium-0.2 branch (if anyone here knows how to clone specific branch only, please correct me)
    Code:
    cd mesa; git checkout origin/gallium-0.2
  8. Now depending whether you need 32bit or 64bit versions run(if you don't know which one you need, choose 32bit):
    • ever (32bit)
      Code:
      make DRI_DIRS=nouveau linux-dri-x86
    • or (64bit)
      Code:
      make DRI_DIRS=nouveau linux-dri-x86-64
  9. Let's copy the required file to /usr/lib and make a link in /usr/lib/dri:
    Code:
    sudo cp lib/nouveau_dri.so /usr/lib
    sudo ln -s /usr/lib/nouveau_dri.so /usr/lib/dri/nouveau_dri.so
  10. Let's tell to the system about new libraries:
    Code:
    sudo ldconfig
  11. Ok, time to check it - restart x server with CTRL+ALT+BACKSPACE.
  12. To check if it's loaded try:
    Code:
    glxinfo | grep Nouveau
    which should return something like the line below:
    Code:
    OpenGL renderer string: Gallium 0.2, NV43 on Nouveau/DRI
    Also you might want to test your graphic card's speed with glxgears:
    Code:
    glxgears

Appendix: Issues and workarounds
No direct rendering
  1. To check if you have direct rendering run the following:
    Code:
    glxinfo | grep direct
  2. In case you get no, most probably nvidia driver messed up your mesa installation and you'll have to reinstall it. I won't cover its installation here, but you might find some useful info about that in this guide.

Notes
As mentioned above 3D driver is work in progress and some nvidia graphic cards might have some SERIOUS problems. Currently ONLY experienced testers and developers should try installing 3D driver for cards which codenames are: less than NV30 (includes NV28, NV25 and so on) or equal/higher than NV50 (includes NV50 and higher). You can look up the codename here or by running glxinfo. Also please take a look at nouveau's feature matrix.

Resources
Install Nouveau
Gallium3D How to
Nouveau FAQ

Last edited by Hakimio; February 11th, 2009 at 07:44 AM.. Reason: Grammar
Hakimio is offline   Reply With Quote
Old March 13th, 2009   #2
TSJason
Just Give Me the Beans!
 
TSJason's Avatar
 
Join Date: Jul 2005
Location: Lafayette, IN
Beans: 53
Kubuntu 9.10 Karmic Koala
Send a message via ICQ to TSJason Send a message via AIM to TSJason
Smile Re: HOWTO: Nouveau - Open source 3d drivers for nvidia graphic cards

Thanks for compiling this. It's fun playing with new code. I actually have it working half decent on jaunty.
__________________
-Jason
TSJason is offline   Reply With Quote
Old March 14th, 2009   #3
floogy
A Carafe of Ubuntu
 
Join Date: Apr 2005
Location: Koblenz, Germany
Beans: 103
Re: HOWTO: Nouveau - Open source 3d drivers for nvidia graphic cards

When these drivers will be stable, would this then enable future Xen Dom0 to use more then 800x600 px resolution when using nvidia cards?
floogy is offline   Reply With Quote
Old March 14th, 2009   #4
Hakimio
Just Give Me the Beans!
 
Hakimio's Avatar
 
Join Date: Nov 2006
Location: Lithuania
Beans: 58
Ubuntu 8.10 Intrepid Ibex
Re: HOWTO: Nouveau - Open source 3d drivers for nvidia graphic cards

Quote:
Originally Posted by TSJason View Post
Thanks for compiling this. It's fun playing with new code. I actually have it working half decent on jaunty.
Nice to see that it was helpful to you
Just curious: did you try the 3d driver or just the 2d. If 3d, what VGA you have and how was the overall experience? Did you try running some 3d apps?
Quote:
Originally Posted by floogy View Post
When these drivers will be stable, would this then enable future Xen Dom0 to use more then 800x600 px resolution when using nvidia cards?
Quote:
Originally Posted by Nouveau FAQ
It really is not easy to predict any dates, as showstoppers may appear anytime. Very few, usually none, of the developers are paid to work on Nouveau, so all progress depends on their free time and interests.
Don't know anything about Xen issues though.
Hakimio is offline   Reply With Quote
Old March 14th, 2009   #5
floogy
A Carafe of Ubuntu
 
Join Date: Apr 2005
Location: Koblenz, Germany
Beans: 103
Re: HOWTO: Nouveau - Open source 3d drivers for nvidia graphic cards

I asked that, because Xen-Kernels and nvidia-modules have to be patched to work together. But I read that these patches are using workarounds like IGNORE_XEN_PRESENCE=1. Therefor these so called solutions are very unstable or unuseable. Some people reported system halt and crashes all 3 or 5 hours.
http://www.nvnews.net/vbulletin/showthread.php?t=122900
http://www.meinews.net/nvidia-t266401.html (sorry, german)

I'm not able to get useful resolutions with the nv driver at all.

I got a GeForce 6600 GT, and tested yesterday the ppa nouveau packages from launchpad for hardy, but that didn't work either.
Code:
01:00.0 VGA compatible controller: nVidia Corporation NV43 [GeForce 6600 GT] (rev a2) (prog-if 00 [VGA controller])
Also I wasn't able to set up the nouveau driver to get X running. Started by startx I got a blank black screen and couldn't go back to any tty so I must reset the computer and reboot. With gdm it failed too, but offered the failsafe vesa configuration tool (failsafeDexconf).

http://nouveau.freedesktop.org/wiki/UbuntuPackages
https://launchpad.net/~raof/+archive/ppa

xorg.conf nv and nouveau:
http://paste.pocoo.org/show/107880/

Xorg.0.log nouveau:
http://paste.pocoo.org/show/107881/
There was no backtrace: output. That's the EOF.
Code:
# egrep '(\(EE|\(WW|\(!!)' /var/log/Xorg.0.log.nouveau_1	(++) from command line, (!!) notice, (II) informational,
	(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
(WW) NOUVEAU(0): Bad V_BIOS checksum
(EE) NOUVEAU(0): wrong DRM version
(EE) NOUVEAU(0): DRI pre-initialisation failed.  Setting NoAccel
(!!) NOUVEAU(0): ... BIOS signature not found
(!!) NOUVEAU(0): Raw DCB entry 0: 01000300 00000028
(!!) NOUVEAU(0): Raw DCB entry 1: 04010312 00000000
(!!) NOUVEAU(0): Raw DCB entry 2: 04010310 00000028
(!!) NOUVEAU(0): Raw DCB entry 3: 02020321 0000c080
(WW) NOUVEAU(0): Failed to set up write-combining range (0xc000001a,0x1)
(WW) NOUVEAU(0): Failed to set up write-combining range (0xc0000018,0x3)
(WW) NOUVEAU(0): Failed to set up write-combining range (0xc0000010,0xb)
(WW) NOUVEAU(0): Failed to set up write-combining range (0xc0000000,0x1b)
(WW) Configured Mouse: No Device specified, looking for one...
I guess the problem is the wrong drm version in the ppa repo:
(EE) NOUVEAU(0): wrong DRM version

Code:
libdrm2:
  Installed: 2.4.1+git20090212-0~ppa1~hardy
  Candidate: 2.4.1+git20090212-0~ppa1~hardy
  Version table:
 *** 2.4.1+git20090212-0~ppa1~hardy 0
        500 http://ppa.launchpad.net hardy/main Packages
        100 /var/lib/dpkg/status
     2.3.0-4ubuntu1 0
        500 http://de.archive.ubuntu.com hardy/main Packages
        500 http://archive.ubuntu.com hardy/main Packages
Unfortunatly I got svere problems with my package sytem yesterday when removing nouveau packages and downgrading libdrm2 to hardy back again I wasn't no more able to reinstall the removed nvidia-glx-new because of dpkg-diversion conflicts with the old traces of nvidia-glx.

The diversion problem was somewhat complex:
http://paste.pocoo.org/show/107883/

Now I got the propritary binary driver running again.

Last edited by floogy; March 14th, 2009 at 08:01 AM..
floogy is offline   Reply With Quote
Old March 14th, 2009   #6
Hakimio
Just Give Me the Beans!
 
Hakimio's Avatar
 
Join Date: Nov 2006
Location: Lithuania
Beans: 58
Ubuntu 8.10 Intrepid Ibex
Re: HOWTO: Nouveau - Open source 3d drivers for nvidia graphic cards

Quote:
Originally Posted by floogy View Post
I guess the problem is the wrong drm version in the ppa repo:
(EE) NOUVEAU(0): wrong DRM version
Instead of using precompiled packages, try installing the latest 2d driver using my guide.
Hakimio is offline   Reply With Quote
Old April 14th, 2009   #7
tonyturbo23
First Cup of Ubuntu
 
Join Date: Apr 2009
Beans: 2
Re: HOWTO: Nouveau - Open source 3d drivers for nvidia graphic cards

Great Guide.

I got to step 17. Then I get this msg.

checking for LIBDRM_NOUVEAU... configure: error: Package requirements (libdrm_nouveau) were not met:

No package 'libdrm_nouveau' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables LIBDRM_NOUVEAU_CFLAGS
and LIBDRM_NOUVEAU_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

I'm a complete noob so any help would be greatly appreciated.

Cheers,
tonyturbo23 is offline   Reply With Quote
Old April 15th, 2009   #8
Hakimio
Just Give Me the Beans!
 
Hakimio's Avatar
 
Join Date: Nov 2006
Location: Lithuania
Beans: 58
Ubuntu 8.10 Intrepid Ibex
Re: HOWTO: Nouveau - Open source 3d drivers for nvidia graphic cards

Quote:
Originally Posted by tonyturbo23 View Post
Great Guide.

I got to step 17. Then I get this msg.

checking for LIBDRM_NOUVEAU... configure: error: Package requirements (libdrm_nouveau) were not met:

No package 'libdrm_nouveau' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables LIBDRM_NOUVEAU_CFLAGS
and LIBDRM_NOUVEAU_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

I'm a complete noob so any help would be greatly appreciated.

Cheers,
Please try to CAREFULLY follow steps 1-6 in part B. It seems that you ever skipped some step or drm compilation/installation was unseccessful. If that doesn't help, please report and I'll check if the guide needs to be updated.
Hakimio is offline   Reply With Quote
Old April 15th, 2009   #9
ashmew2
Extra Foam Sugar Free Ubuntu
 
ashmew2's Avatar
 
Join Date: Oct 2006
Location: India
Beans: 800
Ubuntu 9.10 Karmic Koala
Send a message via Yahoo to ashmew2 Send a message via Skype™ to ashmew2
Re: HOWTO: Nouveau - Open source 3d drivers for nvidia graphic cards

Seeing Nouveau in action will be a delight to the eyes once its final version is released..
__________________
Optimists say the Glass is Half Full.
Pessimists say the Glass is Half Empty.

Programmers say WHY THE !@#$ Is the glass twice as Large ?
ashmew2 is offline   Reply With Quote
Old April 15th, 2009   #10
tonyturbo23
First Cup of Ubuntu
 
Join Date: Apr 2009
Beans: 2
Re: HOWTO: Nouveau - Open source 3d drivers for nvidia graphic cards

After step 4, I got this error

libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
autoreconf: running: /usr/bin/autoconf
autoreconf: running: /usr/bin/autoheader
autoreconf: running: automake --add-missing --copy --no-force
configure.ac:24: installing `./missing'
tests/Makefile.am: installing `./depcomp'
configure.ac:130: required file `libdrm/intel/Makefile.in' not found
configure.ac:130: required file `libdrm/nouveau/Makefile.in' not found
configure.ac:130: required file `libdrm/nouveau/libdrm_nouveau.pc.in' not found
autoreconf: automake failed with exit status: 1[/I]

I might just downgrade to 8.04 and hope that my nvidia card works with that.
tonyturbo23 is offline   Reply With Quote

Bookmarks

Tags
3d drivers, graphic cards, nouveau, nvidia, open source drivers

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:01 PM.


vBulletin ©2000 - 2010, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry