Configuring NVidia Cards on Slackware
Basic, but not obvious if you haven’t done it before.
Firstly, there are two options, the open source driver and the proprietary driver. Many people use the open source driver, I prefer to not. NVidia made the GPU, why not use their driver as it’s most likely to be the best performing option (and allows for VDPAU too). So that’s what these instructions are for.
Now that you’ve picked the proprietary driver, there are two more options; you can either use the installer provided by NVidia, or use the nvidia-driver and nvidia-kernel SlackBuilds provided by Heinz Wiesinger. Personally I use the NVidia-provided installer for a few reasons:
- The latest driver is always available (if not necessarily stable) whereas the SlackBuild can be behind due to workload or because it’s been held back intentionally for stability/compatibility.
- As with kernels, I never find the need to uninstall NVidia drivers, except with the installer when upgrading to a new one, so the usefulness of having a package is lessened.
- I started with the NVidia installer many moons ago and never found enough reason to change my habits.
- I’m too lazy to keep a copy of the xorg.conf handy and the NVidia installer creates one for me.
That said I have the utmost respect for Heinz’s SlackBuild and recommend you consider it as an option depending on your needs, especially if you are playing with different setups rather than just doing a one-time install on a box for which you know exactly what you need.
So, off we go..
Firstly, read my post about the nouveau kernel module: slackware-current and nvidia
Option 1: NVidia Installer
Then go to http://www.nvidia.co.uk/Download/index.aspx and get the latest driver for your architecture. Right now, for me, this would be:
Then head to tty6 (Ctrl-Alt-F6), login as root, drop to runlevel 3, make the installer executable and then run it:
# chmod a+x NVIDIA*.run
# ./!$
Go through the installer with all defaults. If you are on Slackware64 with multilb (as so many are) say yes when it asks if you want the 32bit compatibility bits.
Once it’s done, you should find yourself with a new xorg config in /etc/X11/xorg.conf; but don’t start X back up just yet, you need to strip some lines out of the xorg.conf so as not to confuse X. In Slackware 13.0+, xorg takes its information about your input devices from HAL (see Slackware 13.0 – Xorg + Hal). NVidia doesn’t acknowledge this and adds default entries in the xorg.conf it creates for a mouse and a keyboard.
Here is a default xorg.conf created by the NVidia installer (this is an example, don’t just copy and paste.. do what I tell you to with YOUR copy):
Identifier "Layout0"
Screen 0 "Screen0"
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
EndSection
Section "Files"
FontPath "/usr/lib/X11/fonts/misc/:unscaled"
FontPath "/usr/lib/X11/fonts/100dpi/:unscaled"
FontPath "/usr/lib/X11/fonts/75dpi/:unscaled"
FontPath "/usr/lib/X11/fonts/misc/"
FontPath "/usr/lib/X11/fonts/Type1/"
FontPath "/usr/lib/X11/fonts/Speedo/"
FontPath "/usr/lib/X11/fonts/100dpi/"
FontPath "/usr/lib/X11/fonts/75dpi/"
FontPath "/usr/lib/X11/fonts/cyrillic/"
FontPath "/usr/lib/X11/fonts/TTF/"
EndSection
Section "InputDevice"
# generated from default
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection
Section "InputDevice"
# generated from default
Identifier "Keyboard0"
Driver "kbd"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Unknown"
HorizSync 28.0 - 33.0
VertRefresh 43.0 - 72.0
Option "DPMS"
EndSection
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
EndSubSection
EndSection
And here’s what you need to make it look like by stripping out the input parts:
Identifier "Layout0"
Screen 0 "Screen0"
EndSection
Section "Files"
FontPath "/usr/lib/X11/fonts/misc/:unscaled"
FontPath "/usr/lib/X11/fonts/100dpi/:unscaled"
FontPath "/usr/lib/X11/fonts/75dpi/:unscaled"
FontPath "/usr/lib/X11/fonts/misc/"
FontPath "/usr/lib/X11/fonts/Type1/"
FontPath "/usr/lib/X11/fonts/Speedo/"
FontPath "/usr/lib/X11/fonts/100dpi/"
FontPath "/usr/lib/X11/fonts/75dpi/"
FontPath "/usr/lib/X11/fonts/cyrillic/"
FontPath "/usr/lib/X11/fonts/TTF/"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Unknown"
HorizSync 28.0 - 33.0
VertRefresh 43.0 - 72.0
Option "DPMS"
EndSection
Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Depth 24
EndSubSection
EndSection
Of all of that the absolute minimum you need is:
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
EndSection
But I recommend keeping the other bits that NVidia provide because if you use nvidia-settings later to specifically adjust your config, there may be a number of options it sets and the xorg.conf it will generate will include these anyway. So just take what NVidia give you and strip out the input devices as above.
Option 2: SlackBuilds
Install nvidia-driver and nvidia-kernel. I recommend doing so with sbopkg.
Then create yourself a valid xorg.conf. If you’re not sure how, then you won’t go far wrong with using the default NVidia-created xorg.conf from above.
Finally…
Once you’re done, you can start X back up, either by issuing “startx” at the command line, or re-entering runlevel 4 with “init 4″.
Now that you are back in X you should have fully functional DRI and compositing.
If you have a non-standard setup such as multiple-monitors or you need to boost the gamma on a bad monitor or something like that, then you need to configure the driver to do what you want. This is done very simply with the NVidia configuration tool:
Play with the settings however you need, but remember that this is not Windows. Clicking “Apply” will apply the settings for this session only. If you want the changes to be permanent you must save the settings to a new xorg.conf. Since you’re not running X as root because you’re not an idiot, you will likely not have permissions to overwrite the xorg.conf. There are ways around this, but the simple way is to just save the new xorg.conf in your home directory and move it to /etc/X11 manually (remembering to back up your working copy first).
And that’s it. Go enjoy your new graphics driver and, if your GPU supports VPDAU, go get the VDPAU-enabled MPlayer too.
Have fun!
Recent Comments