• Nvidia with openSUSE Tumbleweed (AKA Install Nvidia the Hard Way)

    Introduction: Tumbleweed users can't use RPMs from the official openSUSE repositories for Nvidia kernel module drivers because the RPMs are matched to the static kernel in the underlying static distro. The kernels in Tumbleweed are constantly changing, so drivers for Nvidia have to be reinstalled every time the kernel changes.

    BTW, you don't have to be a Tumbleweed user to use this method; it works in standard openSUSE too.

    This article is for openSUSE 11.4 and higher, and for users who are a bit confused by the cryptic nature of the wiki edition. Advanced users will find it quicker to use the wiki edition provided they skirt the steps that are wrong for openSUSE versions 11.4+.

    Get Ready Step 1: Gather some background information about your video card and your current drivers.

    Have a look at your current status with this command:
    /usr/sbin/hwinfo --gfxcard
    Typically you'll get a listing like this if you are using the nouveau drivers:
    john@opensuse114:~> /usr/sbin/hwinfo --gfxcard
    27: PCI 100.0: 0300 VGA compatible controller (VGA)             
      [Created at pci.318]
      Unique ID: VCu0.VDLXvujblSC
      Parent ID: vSkL.p_D9a9Gh3ZD
      SysFS ID: /devices/pci0000:00/0000:00:01.0/0000:01:00.0
      SysFS BusID: 0000:01:00.0
      Hardware Class: graphics card
      Model: "nVidia G98 [GeForce 8400 GS]"
      Vendor: pci 0x10de "nVidia Corporation"
      Device: pci 0x06e4 "G98 [GeForce 8400 GS]"
      SubVendor: pci 0x19da "ZOTAC International (MCO) Ltd."
      SubDevice: pci 0x9044 
      Revision: 0xa1
      Driver: "nouveau"
      Driver Modules: "drm"
      Memory Range: 0xfd000000-0xfdffffff (rw,non-prefetchable)
      Memory Range: 0xd0000000-0xdfffffff (ro,non-prefetchable)
      Memory Range: 0xfa000000-0xfbffffff (rw,non-prefetchable)
      I/O Ports: 0xdc80-0xdcff (rw)
      Memory Range: 0xfea00000-0xfea1ffff (ro,non-prefetchable,disabled)
      IRQ: 16 (13 events)
      I/O Ports: 0x3c0-0x3df (rw)
      Module Alias: "pci:v000010DEd000006E4sv000019DAsd00009044bc03sc00i00"
      Driver Info #0:
        Driver Status: nvidiafb is not active
        Driver Activation Cmd: "modprobe nvidiafb"
      Driver Info #1:
        Driver Status: nouveau is active
        Driver Activation Cmd: "modprobe nouveau"
      Config Status: cfg=no, avail=yes, need=no, active=unknown
      Attached to: #9 (PCI bridge)
    I've highlighted the card type (e.g. GeForce 8400GS) and the active driver (nouveau). If you have the Nvidia community repositories for openSUSE installed, then you'll have the nvidia drivers active instead of the nouveau drivers and your listing will reflect that the active driver is "nvidia" as demonstrated on this link.

    If you want to see whether you have the Static RPMs for Nvidia drivers installed, run this command: rpm -qa | grep nvidia, and if they're installed you'll see a response like this:
    john@opensuse114:~> rpm -qa | grep nvidia
    {NB FYI when you do install these RPMs in openSUSE 11.4+, a file called nvidia.conf is created in directory /etc/modprobe.d/ and it contains the line blacklist nouveau. This blocks the nouveau driver. So if you added something to 50-blacklist.conf, take it out, it's a mistake.}

    Get Ready Step 2: Get rid of the RPM-based Nvidia driver installation

    You're going to stop using your base distro's Nvidia drivers (via RPMs) so if you have RPMs installed, remove them in Yast --> Software --> Software management -> search term: nvidia. Remove the three RPMs listed above in the code box. Be careful not to uninstall the nouveau driver. Switch to Yast --> Software --> Repositories and remove the Community repo for Nvidia. Then reboot and you will regress to the nouveau drivers.

    {NB FYI: when you uninstall these three Nvidia RPMs in Yast, the process automatically takes out the nouveau blacklist file (/etc/modprobe.d/nvidia.conf) so that "nouveau" returns. If you can't get nouveau when you reboot, check that the file nvidia.conf is gone from directory modprobe.d and also that you haven't blacklisted nouveau at the bottom of the file "50-blacklist.conf" (by mistake lol).}

    Get Ready Step 3: Install prerequisite RPMs Install these RPMs ==> gcc, make, kernel-source

    Get Ready Step 4: Download the new driver. You'll need the information you got when you ran the command /usr/sbin/hwinfo --gfxcard so you can pick the correct driver from the Nvidia site http://www.nvidia.com/Download/index.aspx?lang=en-us. The driver package will be named similar to this: NVIDIA-Linux-x86_64-295.33.run. You'll be installing it as root after booting to a console subsequent to every kernel upgrade, so you should place it in the directory /root. Use a superuser file browser to do that (or the commands mkdir and mv).

    Get Ready Step 5: Blacklist the nouveau driver. You should switch out nouveau by blacklisting it before you install the new Nvidia drivers from the "run" file.

    Look in the directory /etc/modprobe.d/ for a file named variously: "nvidia.conf" or "nvidia-installer-disable-nouveau.conf" or similar. It must contain these two lines:
    blacklist nouveau
    options nouveau modeset=0
    If it exists but contains only the first line, fix it, add the second line. If an appropriately named file doesn't exist, make a file called "nvidia.conf" and put the two lines in it.

    After you do that, the GUI will continue to run with nouveau until you install the Nvidia "run" file. Once that's in place, the blacklisting becomes effective.

    Now Install the Driver from the "run" File

    Reboot and select to boot to runlevel 3, do this: boot to the grub menu, press the numeral key 3, then Enter and you'll boot to runlevel 3

    At the console login prompt, log in as root.

    Open the "run" file as follows: if you put the run file in directory /root as I advised, then type this in the console:
    sh /root/NVIDIA
    and then press the Tab key. The "sh" function will locate the file and complete the command, changing it to look like this:
    sh /root/NVIDIA-Linux-x86_64-295.33.run
    Then you press the Enter key and the script will run.

    Here's the normal progress:
    • licence dialogue is displayed => accept
    • simply observe and wait through dialogue for building scripts and modules
    • if asked whether to install 32-bit compatibility OpenGL libs ==> select yes
    • simply observe and wait through searches for conflicting files
    • simply observe and wait through installation of driver dialogue
    • when asked if you want to install and let run the nvidia-xconfig utility, 99% of people should ==> select no
    • when told that installation is complete ==> select OK

    You will return to the console prompt. Simply enter init 5 to complete the process and log in to your user account in GUI mode.

    That's all folks

    Note: if you need to adjust the display (e.g twin screens, e.g. resolution) run this command after you log in: nvidia-settings

    swerdna 19 June 2011; last update 5 May 2012

    P.S. What about uninstalling the driver:
    sh /root/NVIDIA-Linux-x86_64-295.33.run --uninstall
    Comments 21 Comments
    1. gerrygavigan's Avatar
      gerrygavigan -
      A very helpful article which got me started today.

      For systemd after creating nvidia.conf you then have to run mkinitrd to get it "into" the system.

      As you test getting nvidia up and running, or in the case where you are making things worse, you can return to how things were with nouveau by deleting or renaming nvidia.conf and re-running mkinitird