xf86-video-nouveau : The device-dependent part of X (DDX) for NVIDIA cards whose role is to provide 2D acceleration (EXA) and some simple video acceleration (XV);

Mesa : It provides 3D, GPGPU and video acceleration to open source drivers. For more information, please read MesaDrivers.

Kernel

The kernel modules required by Nouveau (drm.ko, drm_kms_helper.ko, ttm.ko and nouveau.ko) are built from a Linux kernel tree. You have several options on how to download the source code (subsections of Section 1) and how to compile it (subsections of Section 2). See also KernelModeSetting for important KMS notes. Please, read carefully.

The Nouveau kernel git repository is called nouveau/linux-2.6 and contains one recommended branch: master. The repository name contains "2.6" because we never bothered to rename it to "3": that would either break a lot of people's git configs or we would have two names for the same repository, for no benefit. It does contain the Linux 3.x versions.

You may not be able to compile the DRM modules against your current kernel, if it is too old (might need an -rc kernel or even Linus' git kernel). The possible errors include build failure and kernel modules that cannot be loaded. It is recommended to build your whole kernel from this branch (Section 2.1).

Since the DRM code is part of the kernel since 2.6.33, you can also use Linus' git kernel for Nouveau. However, the code in Linus' kernel will always be older than Nouveau's own git, and because there are no official Nouveau releases, you may encounter compatibility issues with user space parts (libdrm, DDX, Mesa).

Please make sure CONFIG_DRM_NOUVEAU=m, otherwise Nouveau won't be compiled in the kernel.

Out-of-the-tree compilation

The out-of-the-tree builds are mostly used by developers or testers who recompile their kernel often with some custom patches. The out-of-the-tree build will only recompile the DRM part of the kernel which should be orders of magnitude faster than a full kernel recompilation.

In order to use the out-of-the-tree compilation, please go to the directory containing the Nouveau tree or a snapshot of it. Please then run the following commands:

Then, you should insmod all the drm modules that got compiled. It is also possible to install them but this isn't recommended.

WARNING: To use this technique, you will be required to be running at least the same major version of the kernel as one you want to compile out of the tree. If the kernel hasn't been released yet, please compile, install and reboot a kernel compiled from the full Nouveau tree before attempting again.

Run-time configuration

Userspace

The following tutorial will help you compile and install Nouveau in a user directory. This will lower your chances of messing up your whole system. Each package's instructions assume that you have the proper header files installed. If you're on a Debian-based distro (including Ubuntu), you can run apt-get build-dep mesa to make sure that this happens.

However, if you need to recompile xf86-video-nouveau and your distribution-provided libdrm isn't sufficient, you will need to set NVD to /usr and install libdrm, mesa and xf86-video-nouveau.

If you are not in this case, please source the following script (nouveau-env.sh) in every console where you need to do Nouveau development:

DEV_HOME=$HOME/nouveau/ # change this to another location if you prefer
NVD=$HOME/install # change this to another location if you prefer
LD_LIBRARY_PATH=$NVD/lib
PKG_CONFIG_PATH=$NVD/lib/pkgconfig/:$NVD/share/pkgconfig/
ACLOCAL="aclocal -I $NVD/share/aclocal"
export DEV_HOME NVD LD_LIBRARY_PATH PKG_CONFIG_PATH ACLOCAL

LibVDPAU (optional, only useful for video decoding)

The libvdpau will look for libvdpau_nouveau.so in the same prefix as it was installed (regardless of LD_LIBRARY_PATH). We thus need to recompile libvdpau and install it to the same prefix as mesa in order for it to use the right libvdpau_nouveau.so.

Configuring the X server

When using Nouveau, the X-Server doesn't need configuration, the Nouveau driver should be loaded automatically. If it wasn't the case, you may want to try to force the X-server to load the Nouveau driver. To do so, please create the file /etc/X11/xorg.conf.d/20-nouveau.conf and write the following: