Announcement

Collapse
No announcement yet.

Nvidia Proprietary Video Driver -- HOW TO

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Nvidia Proprietary Video Driver -- HOW TO

    The last 12 months have brought three new versions of *buntu and significant changes in the methods for installing the Nvidia proprietary video driver. So, here is what I hope will be a useful reference, especially for the less experienced folks. It is written for Kubuntu ver. 9.10 or later -- note that there are some command variations for prior versions, including the command to start and stop the X server.

    1. The Official Kubuntu Way:

    - Click your "K" menu launcher
    - Choose "Applications > System > Hardware Drivers" -- after it scans your hardware, it should pop up a window that looks like this (Kubuntu 9.10):

    [img width=323 height=400]http://img199.imageshack.us/img199/1299/hwdrivers910.png[/img]

    If you want the driver that it is offering, you click the "Activate" button and wait patiently -- it has to download the driver in the background and it may appear that nothing is happening for a short while.

    That's it -- you "OK" out of there and if you like the results you can be done.


    2. An unofficial *buntu way:

    New release Nvidia drivers are not added to released *buntu versions, but they go into the "x-swat" repository, so you can use that to get them.

    Code:
    sudo add-apt-repository ppa:ubuntu-x-swat/x-updates
    Code:
    sudo apt-get update
    Code:
    sudo apt-get install nvidia-common nvidia-settings
    This repository conatains the latest nvidia drivers. If you keep the repository enabled, version upgrades will be automatically installed.


    3. The (kinda complicated but always works) official Nvidia way:

    Possibly the official Kubuntu method did not find your Nvidia GPU, or for some other reason did not offer you a driver. Possibly you observed that it is offering a version that is not the most current released version for your GPU. Perhaps you are an adventurer who would like to install and test the latest Beta driver from Nvidia. For any of these reasons, you may want or need to download the Nvidia packaged driver/installer. Here is what you need to do.

    EDIT 5 March 2010: Kubuntu 10.04 "Lucid Lynx" comes with the nouveau driver installed by default. [POLITICS]I'm enthused about an open source driver for Nvidia hardware, and I really hope nouveau keeps improving -- it seems to work well for 2D graphics today, on my GTX260, and I've no doubt 3D will be supported one of these days. I'm looking forward to it.[/POLITICS].

    The nouveau driver must be removed and the system rebooted before the proprietary Nvidia driver can be installed. So, if you want the proprietary driver on Lucid, you must

    sudo apt-get remove --purge linux-backports-modules-nouveau-`uname -r`

    Code:
    sudo apt-get --purge remove xserver-xorg-video-nouveau
    and add the following to the end of /etc/modprobe.d/blacklist.conf:

    Code:
    blacklist nouveau
    blacklist nvidiafb
    don't forget to add a carriage return at the end. **

    Then reboot and proceed.

    NOTE: If you previously used "Restricted Driver Manager" or "nvidia-xxx-glx" then you're going to have to do these things before you can install the downloaded new driver - otherwise proceed directly to Step #1:

    - Open Adept or Synaptic, or use apt-get, and
    Code:
    sudo apt-get remove --purge linux-restricted-modules-`uname -r`
    - Remove any and all packages beginning with "nvidia-..." (see command line below) *

    - Use your editor in root mode to open the file /etc/default/linux-restricted-modules-common (if it exists on your system), and on the last line where it says

    DISABLED_MODULES=""

    insert "nv" between the quote marks, so it reads:

    DISABLED_MODULES="nv"

    and save it. Next, at the root "you@karmic:/$" prompt

    *
    Code:
    sudo find . -type f -name 'nvidia*' -exec zip -mT junk-nvidia-files.zip {} +
    (Note that an archive file named "junk-nvidia-files.zip" will be created and will hold all the removed files, just in case ...)


    Now proceed to Step #1 and begin.


    Step #1. Download the 32-bit or 64-bit driver, as appropriate, to your /home/user/Downloads folder from here:

    http://www.nvidia.com/Download/index.aspx?lang=en-us

    or here:

    http://www.nvnews.net/vbulletin/showthread.php?t=122606


    Get the ...pkg1.run for 32-bit, or ...pkg2.run for 64-bit. (applicable to driver versions before 256.35)




    Step #2. When it is done downloading, Ctrl-Alt-F1 out of the X server, and log in to the CLI. Stop the X server with the following command:

    Code:
    sudo service kdm stop

    Step #3. Change to the /tmp directory, for two reasons. First, it is bad practice to run "sudo" or root commands, including software installations, from your home directory -- if the .ICEauthority or .Xauthority hidden files are changed by root during your operation, you will be done logging in to KDE (until you figure out how to fix it). Secondly, any residual non-needed files that are left in /tmp will be dropped in the next reboot -- you can be lazy and not worry about cleaning up after yourself when the driver installation is finished.

    Code:
    cd /tmp
    Also, install the linux-headers and build-essential packages for your running kernel:

    Code:
    sudo apt-get update && sudo apt-get install linux-headers-`uname -r` build-essential

    Step #4. Copy your downloaded driver installer file to /tmp:

    Code:
    sudo cp /home/dibl/Download/NV{TAB to complete} .
    NOTICE: (a) you can use the Tab key to finish that awkward file name automatically, and (b) THE "."! The period tells bash to copy the file to the directory where you are working.


    Step #5. Run the installer:

    Code:
    sudo sh NV{TAB to complete}
    and press Enter.

    -- answer the questions as they come up:
    a. Accept the license
    b. Remove prior driver? = Y
    c. Download a kernel interface? = Y
    d. Compile a kernel interface? = OK
    e. Install Nvidia's 32-bit compatibility OpenGL libraries? = Y
    f. Run the nvidia-xconfig utility? = Y (or if you already have a proven good xorg.conf for this driver version, you can answer "N")


    Step #6. Restart the X server:

    Code:
    sudo service kdm start
    Log in and enjoy the view!



    ** EDIT 12 June 2010: Changes in the booting process for 10.04 may leave you with a call to the nouveau driver embedded in the init ramdisk. If you find you still have the nouveau driver, even after blacklisting it, then you will need to (after making the blacklist entry in /etc/modprobe.d/blacklist.conf), reboot into Recovery Console, and run

    Code:
    sudo update-initramfs -u
    and then proceed (still in Recovery Console) with your Nvidia driver installation as described above.

    http://ubuntuforums.org/showpost.php...14&postcount=5


    But, suppose you are not satisfied with the view -- the screen resolution is not pleasing, you insist on overclocking your $350 GPU, or something like that. With the proprietary driver comes the nvidia-settings utility. Use Alt-F2 to run it. Alt-F2 "nvidia-settings" (with no quote marks) brings up a panel that looks like this:

    [img width=400 height=249]http://img217.imageshack.us/img217/2599/nvidia19042settings.png[/img]


    The second menu item "X Server Display Configuration" opens a dialogue that lets you adjust the resolution and refresh rates. I always advise leaving the refresh rate set to "auto" -- let the X server control that dynamically, for best overall results. You'll see something like this:

    [IMG width=400 height=250]http://img684.imageshack.us/img684/3629/nvidiaxserver.png[/img]


    If you want to make a permanent change to the default screen resolution, then prefix the "nvidia-settings" command with "kdesudo" to run it in root mode. Click the "Detect Displays" button and if your monitor/LCD has an EDID capability it will be read and used by the driver. After you change the screen resolution, to make it the default click the "Save to X Configuration File" button in the lower right of the dialogue, and it will overwrite that section of the /etc/X11/xorg.conf file.

    If you want to accept the risk of overclocking your GPU, and void your warranty, then you add the "Coolbits" option line in your xorg.conf file. That enables the option in the nvidia-settings (see the third-to-last menu item on mine). There is an "Auto Detect" testing function that you can use, in the 3D mode settings, that will test your GPU and graphics memory and recommend maximum settings for you. Here's the dialogue where you can play with it:

    [IMG width=400 height=250]http://img130.imageshack.us/img130/1613/nvidiaxserver1.png[/img]


    Finally, I will post the /etc/X11/xorg.conf file that driver 190.42 wrote for my GTX260 (still working great with 195.36.24), and I'll highlight the Coolbits option so you can see what it needs to say.

    # nvidia-xconfig: X configuration file generated by nvidia-xconfig
    # nvidia-xconfig: version 1.0 (buildmeister@builder58) Tue Oct 20 21:25:04 PDT 2009

    Section "ServerLayout"
    Identifier "Layout0"
    Screen 0 "Screen0" 0 0
    InputDevice "Keyboard0" "CoreKeyboard"
    InputDevice "Mouse0" "CorePointer"
    EndSection

    Section "Files"
    EndSection

    Section "ServerFlags"
    Option "Xinerama" "0"
    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 "Samsung SyncMaster"
    HorizSync 30.0 - 130.0
    VertRefresh 50.0 - 160.0
    Option "DPMS"
    EndSection

    Section "Device"
    Identifier "Device0"
    Driver "nvidia"
    VendorName "NVIDIA Corporation"
    BoardName "GeForce GTX 260"
    EndSection

    Section "Screen"
    Identifier "Screen0"
    Device "Device0"
    Monitor "Monitor0"
    DefaultDepth 24
    Option "Coolbits" "1"
    Option "TwinView" "0"
    Option "TwinViewXineramaInfoOrder" "CRT-0"
    Option "metamodes" "1600x1200 +0+0"
    Option "AddARGBGLXVisuals" "True"
    SubSection "Display"
    Depth 24
    EndSubSection
    EndSection

    Section "Extensions"
    Option "Composite" "Enable"
    EndSection

    #2
    Re: Nvidia Proprietary Video Driver -- HOW TO

    The newest NVIDIA drivers provide another option for customizing -- and possibly destroying -- your NVIDIA card, so use this ONLY if you understand the risks.

    Setting the COOLBITS option to 5 will enable fan control in the nvidia-settings program.

    If you are running 2 cards in sli configuration, you will need to add a separate DEVICE entry for each card. To do this, run the lspci command as shown below:
    Code:
    doctordruidphd@wolfenstein:/etc/X11$ lspci | grep VGA
    01:00.0 VGA compatible controller: nVidia Corporation G92 [GeForce 9800 GT] (rev a2)
    02:00.0 VGA compatible controller: nVidia Corporation G92 [GeForce 9800 GT] (rev a2)
    The first numbers in the output are the ones you want. You will need to set up your xorg.conf file DEVICE entries for the cards, as follows, adding the Busid and Option lines:

    Code:
    Section "Device"
      Identifier   "Device0"
      Driver     "nvidia"
      VendorName   "NVIDIA Corporation"
      Busid     "PCI:01:00:00"
      Option     "sli" "auto"
    EndSection
    
    Section "Device"
      Identifier   "Device0"
      Driver     "nvidia"
      VendorName   "NVIDIA Corporation"
      Busid     "PCI:02:00:00"
      Option     "sli" "auto"
    EndSection
    substituting whatever numbers you got from your lspci command. Stop and restart kdm, and your nvidia-settings program should now give you entries for both cards. This will also enable the "Enable SLI heads up display" option under OpenGL Settings.


    We only have to look at ourselves to see how intelligent life might develop into something we wouldn't want to meet. -- Stephen Hawking

    Comment


      #3
      Re: Nvidia Proprietary Video Driver -- HOW TO

      Aha -- nice! Thanks for the added help, DD!

      Comment


        #4
        Re: Nvidia Proprietary Video Driver -- HOW TO

        Is there any particular reason to switch from the 185 driver to the 190? What could I gain by doing so (other than the comfort of knowing that my system is totally up to date, today)?

        Comment


          #5
          Re: Nvidia Proprietary Video Driver -- HOW TO

          Mods, please sticky this thread!

          I had already installed NVidia's driver on my Jaunty computer by following the instructions on their website (method 2 I think). It was very easy and worked like a charm.

          Does Kubuntu graphical driver installer (method 1) really work reliably? Do many people seem to have problems after trying to use it?

          Originally posted by dibl
          . . . it is bad practice to run "sudo" or root commands, including software installations, from your home directory -- if the .ICEauthority or .Xauthority hidden files are changed by root during your operation, you will be done logging in to KDE (until you figure out how to fix it).
          I'm surprised this has not bitten me yet. What does one have to do to cause problems (so I can remember to avoid it)?

          Excellent HowTo! Thanks so much, dibl
          Welcome newbies!
          Verify the ISO
          Kubuntu's documentation

          Comment


            #6
            Re: Nvidia Proprietary Video Driver -- HOW TO

            Installing the NVIDIA drivers on Karmic (and presumably later) releases just got much easier.

            You can install the NVIDIA ppa repository like this:

            Code:
            sudo add-apt-repository ppa:nvidia-vdpau/ppa
            sudo apt-get update
            This will now make the latest (as of this writing, 190.42) stable driver available.
            It appears that, at this moment, there is no meta-package to insure the latest driver will be updated automatically.

            Reference:
            http://www.webupd8.org/2009/08/how-t...rivers-in.html
            We only have to look at ourselves to see how intelligent life might develop into something we wouldn't want to meet. -- Stephen Hawking

            Comment


              #7
              Re: Nvidia Proprietary Video Driver -- HOW TO

              Thanks for that tip!!

              Just tried it - and it installed the new driver perfectly.

              Comment


                #8
                Re: Nvidia Proprietary Video Driver -- HOW TO

                Originally posted by askrieger
                Is there any particular reason to switch from the 185 driver to the 190? What could I gain by doing so (other than the comfort of knowing that my system is totally up to date, today)?
                Al, they do a pretty fair job of summarizing the improvements in each version release here:

                http://www.nvnews.net/vbulletin/show....php?p=2105790

                You'd have to study the bug fixes to determine whether any of them are applicable to your platform and normal activities. Being easily bored by release notes, I just go with the new version, on the chance that it might be better.

                Comment


                  #9
                  Re: Nvidia Proprietary Video Driver -- HOW TO

                  Today I booted my Jaunty computer after having it shut down for a few days. There were about 42 updates, including some kernel updates. I used apt-get to install the updates as below. (I never trusted KPackageKit since Intrepid.)

                  Code:
                  $ sudo apt-get update
                  $ sudo apt-get upgrade
                  $ sudo apt-get dist-upgrade
                  I then walked away from the computer and returned later. Apparently Kubuntu must have tried to restart the system because I found myself facing a text mode login prompt on TTY2. TTY7 just showed a black screen and blinking cursor with no prompt or text.

                  After logging in to TTY1, sudo shutdown now failed to shutdown the system, but sudo shutdown -h worked. When I powered on I was again dropped to TTY2 with a login prompt.

                  After pondering the circumstances for some time, and searching the forums, I concluded that the new kernel must be incompatible with the NVidia drivers which were compiled under the older kernel.

                  Following dibl's instructions for The official Nvidia way solved the problem. My Jaunty computer boots and works perfectly again
                  Welcome newbies!
                  Verify the ISO
                  Kubuntu's documentation

                  Comment


                    #10
                    Re: Nvidia Proprietary Video Driver -- HOW TO

                    Originally posted by Telengard

                    Code:
                    $ sudo apt-get update
                    $ sudo apt-get upgrade
                    $ sudo apt-get dist-upgrade
                    You can do that with one command. Saves a little time.

                    Code:
                    sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade

                    Comment


                      #11
                      Re: Nvidia Proprietary Video Driver -- HOW TO

                      Originally posted by Detonate
                      Code:
                      sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
                      Indeed, but I think it reads better when I separate the commands instead of building a chain.

                      I just wonder what I did wrong in my upgrade which caused the problem, or what I could have done to prevent it.
                      Welcome newbies!
                      Verify the ISO
                      Kubuntu's documentation

                      Comment


                        #12
                        Re: Nvidia Proprietary Video Driver -- HOW TO

                        Originally posted by Telengard

                        I just wonder what I did wrong in my upgrade which caused the problem, or what I could have done to prevent it.
                        You did not necessarily do anything wrong, nor could the breakage of the kernel module be prevented. Installation of a new version kernel will normally result in an incompatibility with the prior kernel's driver module. So the expected requirement is to re-install the proprietary driver on the new kernel, after an upgrade.

                        In other words, keep the downloaded driver/installer package handy -- you might need it again after a few weeks or a month.

                        Comment


                          #13
                          Re: Nvidia Proprietary Video Driver -- HOW TO

                          Originally posted by dibl
                          You did not necessarily do anything wrong, nor could the breakage of the kernel module be prevented.

                          So I can expect my system to break after every kernel update? That is not at all what I expected. Where can I read more on the topic?
                          Welcome newbies!
                          Verify the ISO
                          Kubuntu's documentation

                          Comment


                            #14
                            Re: Nvidia Proprietary Video Driver -- HOW TO

                            Originally posted by Telengard

                            So I can expect my system to break after every kernel update?
                            Yes.


                            That is not at all what I expected. Where can I read more on the topic?
                            Not exactly on "why new kernels require a new driver compile", but a good resource: http://www.nvnews.net/vbulletin/forumdisplay.php?f=14

                            One of the major benefits of the nvidia-glx packaged driver is that the new kernel will NOT be incompatible with the driver. You knew there was some reason, right?

                            Comment


                              #15
                              Re: Nvidia Proprietary Video Driver -- HOW TO

                              Originally posted by dibl
                              http://www.nvnews.net/vbulletin/forumdisplay.php?f=14
                              I'll try to keep that in mind, although it is only a forum. Not sure if you had a specific thread in mind.

                              One of the major benefits of the nvidia-glx packaged driver is that the new kernel will NOT be incompatible with the driver. You knew there was some reason, right?
                              No, I honestly did not know. I have not done all the research needed to fully understand all my options for NVidia drivers.

                              A quick web search on the terms nvidia-glx packaged driver yielded the NvidiaGraphicsDrivers article on the Debian wiki. This paragraph looks pretty informative:

                              Originally posted by Overview
                              The NVIDIA 3D drivers consist of two parts: a kernel module, and a collection of user-space libraries and a X video driver. The libraries and the X driver (sometimes called the "binary driver" or GLX libraries) are distributed in binary form by NVIDIA, and are packaged for Debian in the nvidia-glx packages. Since NVIDIA's 3D drivers are not open source, non-free APT sources are needed to install them. The kernel module (aka the "kernel interface to the binary driver") is distributed in source form (though with one binary component), and packaged for Debian in the nvidia-kernel-source packages. The version numbers of the kernel module and user-space libraries and X video driver must match. User libraries only need be installed once, but the kernel module must be recompiled every time the kernel is changed.
                              Now that's not a very nice way to do things, from a user perspective, but since the binary driver is closed source I don't know how it could be done better. (Damn you Nvidia!)
                              Welcome newbies!
                              Verify the ISO
                              Kubuntu's documentation

                              Comment

                              Working...
                              X