Wednesday, July 28

How to install nvidia driver in fedora

 

 

 

Graphics Driver Options

In newer versions of Fedora there are 3 options for video drivers that support or allow usage of Nvidia hardware in some form. They are:
  • nouveau - hardware accelerated open source driver. This driver is included with newer versions of Fedora. This is a work in progress however provides 3D for some hardware as well as multiple monitor support.
    No additional steps are required to install this driver.
  • nvidia - hardware accelerated closed source proprietary driver. This driver is provided only from Nvidia and provides the best high performance video and 3D functionality. However there are many versions that Nvidia produces which may not be compatible with Fedora.
  • vesa - very basic open source video driver. This driver just provides limited support for video. It is only for use where neither of the above work.

-------------------------------------------------------------------------------------------

Determining PCI ID

Which driver depends on the specific hardware. The name of the product is typically useful (e.g. GeForce FX5900, Quaddro NV140M), however hardware is best identified using PCI ID's.

To find the PCI ID of a particular device use the lspci command. depending on the version and usage of the lspci command various output is shown. In Fedora, use the following to identify the PCI ID (Note: the grep is added to filter the output):

Code:
[mirandam@charon ~]$ /sbin/lspci -nn | grep 'VGA\|NV'
01:00.0 VGA compatible controller [0300]: nVidia Corporation NV34 [GeForce FX 5200] [10de:0322] (rev a1)
Use the PCI ID and look it up under Nvidia's Supported Product List OR using Appendix A. Supported NVIDIA GPU Products in any newer Nvidia driver documentation.
In this example the PCI ID is 0322. According to Appendix A, this ID corresponds to the Legacy version (173.xx series) driver.

Note: It is very important to know which driver your hardware requires. Typically many users will have newer hardware and NOT have to worry about this issue. However users with older hardware who install a newer driver may have non functional X-servers.

--------------------------------------------------------------------------------------------------------

Driver Packaging

There are 2 common ways of installing a driver for Nvidia hardware. Both methods will work and install the driver, however each has advantages and disadvantages.

Nvidia.com Binary Installer

Using the installer from Nvidia will try to compile a driver for your setup and install it. It will also modify any configuration files required to load. The only requirements for the installer are the necessary kernel files (usually kernel headers and the gcc compiler). This installer is only available through the Nvidia website and has the filename in the form of: NVIDIA-Linux-x86-XYZ.AB.pkg1.run.
The advantage of this method is that it can be run in almost any version of linux and can be installed for custom kernels. It is usually immediately available.
The disadvantage of this method is that the installer is the only application that tracks the modification of the system. If you are using a distribution that uses packag management (i.e. RPM's for Fedora) then the installer may interfere with your package manager and cause problems when you add/remove other software. The most critical problem with this method is that since each install depends on a specific kernel version, if you update and boot into a new kernel the driver will not load. You must manually re-install the driver from the command line since the X-server will not load.

3rd Party Repository

The Nvidia Installer can be extracted and reconfigured into an installable package which is specific to the distribution (RPM, DEB, etc.). Since Fedora uses RPM the driver would be an RPM package(s). The recommended 3rd Party Repository for the Nvidia driver with Fedora is RPMFusion.
The advantage of this method is that it can be installed faster and easier (often a smaller download) using the package manager e.g. YUM in Fedora. The packages can be automatically updated with new kernels and easily added or removed. The most beneficial advantage with this method is that if a newer kernel, X-server or driver is incompatible the package will automatically switch to an alternate driver. This way the X-server access is never lost.
The disadvantage of this method is that depends entirely on the 3rd Party Repository to ensure that updates are available on their servers and properly built to match current kernel releases. Typically in the past many problems relating to repositories, mirror syncing and build issues have reduced the advantages of this method of installation.

NOTE: It is recommended by most distribution developers to use the installation method that most closely aligns with the distribution's package management. Fedora users are strongly recommended to use the RPMFusion repository.

 -------------------------------------------------------------------------------------------------------

Installation Using RPMFusion

To install the nvidia driver using RPMFusion and YUM.
  1. Install the repository configuration files for YUM. Run the following commands (enter 'root' password when prompted):
    # rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
    # rpm -ivh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
     

  2. Due to the inclusion of nouveau in Fedora 11 and newer, it must first be disabled. After this step, a reboot is recommended.


    • Fedora 12 and Fedora 13
      Edit (as root): /boot/grub/grub.conf To the end of the default kernel (usually the first), edit the kernel line.
      Add the following: rdblacklist=nouveau
      to the end of the kernel line.
      -OR- Modify the initramfs:

      [mirandam@charon ~]$ su -
      Password: 
      # mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r)-nouveau.img
      # dracut /boot/initramfs-$(uname -r).img $(uname -r)
      
      # exit

    • Fedora 11

      [mirandam@charon ~]$ su -
      Password:
      [root@charon ~]# mv /boot/initrd-$(uname -r).img /boot/initrd-$(uname -r)-nouveau.img
      [root@charon ~]# mkinitrd /boot/initrd-$(uname -r).img $(uname -r)
      [root@charon ~]# exit
    A reboot is recommended.

  3. Select the proper KMOD (Fedora Kernel Module) which matches the driver you need.
    This MUST match the specific driver for the PCI ID you determined earlier.
    The following lists what is SUPPORTED BY NVIDIA/RPMFUSION. If you cannot find your driver/hardware combination, then most likely it is not supported.

    KMOD's for Fedora 13 (Currently only newest Nvidia hardware):
    Latest Version
    kmod-nvidia



    KMOD's for Fedora 11 and Fedora 12:
    Latest VersionLegacy 173.xxLegacy version 96.xx
    kmod-nvidiakmod-nvidia-173xxkmod-nvidia-96xx
    NOTE: (32-bit Users) Users with 'PAE' kernels should use that kmod. This for 32-bit users with 4GB of memory, or users running 32-bit Fedora on 64-bit hardware. Run: uname -rm if you are unsure. Proper names:

    • kmod-nvidia-PAE
    • kmod-nvidia-173xx-PAE
    • kmod-nvidia-96xx-PAE
  4. Install the proper KMOD Using the yum command (enter 'root' password when prompted):
    [mirandam@charon ~]$ su -c 'yum install kmod-nvidia'

    NOTE: YUM will automatically determine any extra packages needed for the installation. If a new kernel is needed, then a reboot is required before the Nvidia driver will load.

No comments:

Post a Comment