Home > Linux, Slackware > Configuring NVidia Cards on Slackware

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:

  1. 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.
  2. 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.
  3. I started with the NVidia installer many moons ago and never found enough reason to change my habits.
  4. 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:

$ wget http://uk.download.nvidia.com/XFree86/Linux-x86/195.36.15/NVIDIA-Linux-x86-195.36.15-pkg1.run

Then head to tty6 (Ctrl-Alt-F6), login as root, drop to runlevel 3, make the installer executable and then run it:

# init 3
# 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):

Section "ServerLayout"
    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:

Section "ServerLayout"
    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:

 Section "Device"
    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:

$ nvidia-settings

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!

Be Sociable, Share!
  1. slava_dp
    April 9th, 2010 at 15:10 | #1

    Hey Zordrak,

    usually having an xorg.conf with this content:

    Section “Device”
    Identifier “Device0″
    Driver “nvidia”
    EndSection

    is enough (for me) :-)

  2. May 4th, 2010 at 09:57 | #2

    even if you are on slackware64-13.0 without multilib, you still want to say yes to the 32bit open gl compatability stuff, otherwise 3d acceleration doesn’t work properly.
    why pure 64bit requires 32bit opengl stuff is a mystery, but it does seem to be the case.

  3. May 4th, 2010 at 10:15 | #3

    @tim
    Noted.

  4. garry
    August 21st, 2010 at 04:31 | #4

    @tim
    slackware64 13.1 + nvidia + xfce, 3d acceleration works fine without 32bit opengl.

  5. August 21st, 2010 at 17:21 | #5

    @garry
    Of course it will. But if you have installed the multilib libraries for Slack64, then you should also install the 32bit OpenGL libraries in case you have any 32-bit apps that want to use them.

  6. August 21st, 2010 at 17:21 | #6

    Zordrak :

    @garry
    Of course it will. But if you have installed the multilib libraries for Slack64, then you should also install the 32bit OpenGL libraries in case you have any 32-bit apps that want to use them.

    Sorry, complete fail on my part.. didn’t realise you were responding to Tim. Way too hot and humid here :)

  1. April 27th, 2010 at 23:32 | #1
  2. April 28th, 2010 at 10:11 | #2
  3. April 29th, 2010 at 16:42 | #3
  4. April 29th, 2010 at 16:48 | #4
  5. May 16th, 2010 at 22:28 | #5
  6. May 28th, 2010 at 10:31 | #6
  7. August 13th, 2010 at 19:42 | #7
  8. December 8th, 2010 at 02:56 | #8
  9. April 12th, 2011 at 19:31 | #9
  10. April 30th, 2011 at 11:18 | #10
  11. May 3rd, 2011 at 21:51 | #11
  12. June 13th, 2011 at 14:37 | #12
  13. August 6th, 2011 at 19:39 | #13
  14. August 14th, 2012 at 17:14 | #14
  15. January 14th, 2013 at 20:39 | #15
  16. February 23rd, 2013 at 20:19 | #16

Note: Commenter is allowed to use '@User+blank' to automatically notify your reply to other commenter. e.g, if ABC is one of commenter of this post, then write '@ABC '(exclude ') will automatically send your comment to ABC. Using '@all ' to notify all previous commenters. Be sure that the value of User should exactly match with commenter's name (case sensitive).