EDIT : post updated on April 2, 2010. I suppose that you upgraded -current following March 31 update.
Since Mon Mar 1 22:43:53 UTC 2010, slackware-current include following components:
- kernel 2.6.33 (upgraded to 2.6.33.1 since March 31)
- Xorg7.5, including xorg-server-1.7.5
- libdrm-2.4.18
Since then, several of us did encounter problems to use their nVidia gpu under X, for instance see
this thread
I hope this post can help them coping with this situation.
But bear in mind that these problems will probably disappear in a not so distant future following updates of -current.
Then this nano How-To will become useless; when I will be aware of that I will either delete it or at least let you know.
To use a nVidia gpu under X we need a kernel driver as well as a driver for X (big finding!), chosen among:
- "vesa" (open source, not nVidia specific)
- "nv" (open source, nVidia specific, provided by nVidia)
- "nvidia" (closed source, provided as binary by nVidia, also known as "blob")
- "nouveau" (open source, in active development, expected to replace nv)
Conclusions
This part has been updated on April 2nd, 2010 following March 31 update of -current which include a better "nv" driver for X
[EDIT April 3rd] Blacklisting nouveau is
not necessary if you set up a VGA (no VESA framebuffer) in lilo.conf and run lilo again: either comment "VGA=" option in lilo.conf or choose "VGA=normal" or "VGA=ext" instead of" VGA=nnn"
[EDIR April 6th]Temporary workaround if you get a blank screen at boot: use the nomdeset kernel parameter at boot time, see
this post for explanations.
1) To use the vesa driver (works but has limited features), issue following commands as root.
Code:
echo "blacklist nouveau" >> /etc/modprobe.conf/blacklist.conf # don't write ">" instead of ">>" otherwise the file will be overridden
echo -e 'Section "Device"\nIdentifier "n"\nDriver "vesa"\nEndSection' > /etc/X11/xorg.conf
2) To use the nv driver (better handling of high resolutions, XRandR work), issue following commands:
Code:
echo "blacklist nouveau" >> /etc/modprobe.conf/blacklist.conf # don't write ">" instead of ">>" otherwise the file will be overridden
echo -e 'Section "Device"\nIdentifier "n"\nDriver "nv"\nEndSection' > /etc/X11/xorg.conf
3) Of course you can try the blob (I didn't).
I can't give any advise there, but be aware that not all versions work and some only if patched, as of today.
4) My advise is to give "nouveau" a try.
Gamers won't get 3D hardware acceleration yet but some nice features are already provided:
- KMS (kernel modesetting)
- good dual head support
- support for xrandr (X Resize and Rotate) version 1.2
For that you will need some more steps explained at the end of this post.
Explanations
Here is the summary of what I did and got (I always boot at runlevel 3):
- Booting a fresh -current install I got a black screen, probably because the "nouveau" kernel driver, though automatically chosen, miss its firmware
- Then I added "blacklist nouveau" at the end of /etc/modprobe.conf/blacklist.conf
- Then no problem while booting but after "startx" (under Fluxbox) I saw only the mouse cursor on a black screen. I could move it... that's it.
- Then I did set up an /etc/X11/xorg.conf file with driver "nv". X started but display was unusable with very weird colors.
- Then I replaced the driver "nv" by "vesa" and all was fine.
- I also tried "nouveau" with success (details follow)
I didn't try the "blob" (closed source nVida driver) but several people did encounter problems with it.
How-To use Nouveau
Please note first that though "nouveau" be modularized (as it should) in both -huge and -generic 2.6.33.1 kernels this don't suffice to use it "out of the box" in -current for several reasons:
- the driver for X is not included in xorg7.5 release
- a firmware for "nouveau", which is necessary with 2.6.33. kernel, doesn't ship with it
- the code for "nouveau" included in 2.6.33.1 is not compatible with libdrm-2.4.18, included in -current.
As we will see now, it is nevertheless possible to use "nouveau" in "current" with some more installation steps
In short for the impatient among us:
Have slackware-current or slackware64-current installed, including kernel 2.6.33 (preferably -generic) and xorg-server-1.7.5 (I suppose you use HAL and have no xorg.conf file in /etc/X11, orherwise adapt step 13 below accordingly).
First, blacklist nouveau in /etc/modprobe.d/blacklist.conf
or set-up a VGA (no VESA framebuffer) mode in /etc/lilo.conf and run lilo, that is to say include the "VGA=normal" or "VGA=ext" option in /etc/lilo.conf
Then do what follows at runlevel 3:
Code:
1. mkdir -p ~/tmp && cd ~/tmp
2. wget http://people.freedesktop.org/~pq/nouveau-drm/master.tar.gz && tar xzf master.tar.gz
3. cd master/include && wget http://cgit.freedesktop.org/nouveau/linux-2.6/plain/nouveau/Makefile?h=master-compat
4. mv Makefile?h=master-compat Makefile && make
5. su && make install
6. cd /lib/modules/2.6.33.1/kernel/drivers/gpu && rm ttm/ttm.ko drm.ko nouveau/nouveau.ko && depmod -a && Ctrl + d
7. cd ~/tmp && git clone git://anongit.freedesktop.org/git/nouveau/xf86-video-nouveau/
8. cd xf86-video-nouveau && ./autogen.sh && make
9. su
10. For slackware-current : cp src/.libs/nouveau_drv.so /usr/lib/xorg/modules/drivers
10. For slackware64-current : cp src/.libs/nouveau_drv.so /usr/lib64/xorg/modules/drivers
11. grab the latest firmware package from http://people.freedesktop.org/~pq/nouveau-drm/
12. tar zxf nouveau-firmware-XXXXXXXX.tar.gz -C /lib/firmware # as of today replace XXXXXXXX by 20091212
13. echo -e 'Section "Device"\nIdentifier "n"\nDriver "nouveau"\nEndSection' > /etc/X11/xorg.conf
14. Ctrl + d # back to regular user
15. startx
For those wanting to know what they are doing (if any):
1. Feel free to use another directory if you prefer
2. We get what is necessary to build drm, ttm and nouveau modules compatible with libdrm 2.4.18. See
http://nouveau.freedesktop.org/wiki/InstallDRM. Be aware that you'll get a snapshot, so your mileage may vary
3. We go where the makefile should go (don't ask me why) and download it there
4. We name the makefile Makefile and make the modules
5. We install the modules as root. After that you'll find it there :
/lib/modules/2.6.33.1/extra/ttm/ttm.ko
/lib/modules/2.6.33.1/extra/drm.ko
/lib/modules/2.6.33.1/extra/nouveau/nouveau.ko
6. We erase the corresponding modules shipped with package kernel-modules-2.6.33.1 as otherwise they would conflict with the new ones, and make the system aware of the new ones
7. We grab the source of the nouveau driver for X
8. We make this driver, whose name is nouveau_drv.so
9. We become root again (did you guess ?)
10. We put nouveau_drv.so where it should go, which depends on the ARCH of your distribution
11. Be aware that you'll get a snapshot, so your mileage may vary
12. This will create a directory in /lib/firmware with the many firmware files needed for various GPU
13. Minimum /etc/X11/xorg.conf for nouveau to work under X. Tune it to your liking.
14. Does that need an explanation ?
15. If you are superstitious, cross your fingers first. Anyhow, the chances that this will trigger an earthquake and/or a tsunami can be considered low, according to experts.
Would you ever like to go back to a "stock" slackware-current, do this:
- rm -rf /lib/firmware/nouveau
- removepkg kernel-modules # don't reboot after that!
- rm -rf /lib/modules/2.6.33.1 # don't reboot after that!
- installpkg kernel-modules-2.6.33.1
- rm -f /usr/lib/xorg/modules/drivers/nouveau_drv.so or rm -f /usr/lib64/xorg/modules/drivers/nouveau_drv.so
As usual, "this don't work here", remarks, comments, proposed enhancements etc. are gratefully welcome.
But before you complain, look
here. In particular anything remaining from a previous blob (nVidia's closed source driver) installation can cause problems.
Credits go to the nouveau Wiki, mainly:
http://nouveau.freedesktop.org/wiki/
http://nouveau.freedesktop.org/wiki/InstallNouveau
http://nouveau.freedesktop.org/wiki/InstallDRM
http://nouveau.freedesktop.org/wiki/FAQ
http://nouveau.freedesktop.org/wiki/TroubleShooting