View RSS Feed

James' openSUSE Bash Scripting (and other things) Blog - Your Comments are Welcome!

S.A.N.D.I. - SuSE Automated NVIDIA Driver Installer - Version 1.50

Rate this Entry


I am happy to present my bash script S.A.N.D.I., SuSE Automated NVIDIA Driver Installer which is written to work with DKMS - Dynamic Kernel Module Support to allow the automatic installation of the nVIDIA proprietary Video Driver each time you upgrade your Kernel version. What DKMS does is to recompile and install any DKMS loaded driver against the running kernel each time a new kernel version is loaded. DKMS only works with the nVIDIA driver if you have compiled your own kernel version and not with the default openSUSE kernel, even if you have installed the kernel sources. Please have a look at the following blog on compiling your own kernel:

openSUSE and Installing New Linux Kernel Versions - Blogs - openSUSE Forums

S.A.N.D.I. works with openSUSE 11.4, 12.1 and with our latest version, 12.2. The normal procedure would be to use S.A.N.D.I. to do a full installation of any new nVIDIA video driver in Runlevel 3 as normal and then run S.A.N.D.I. again to load the same driver into DKMS from Runlevel 3 or from Runlevel 5 in your desktop. This second step (loading the driver into DKMS) can be made with or without your selected desktop being loaded. When you run S.A.N.D.I. in Runlevel 3, the Full video driver installation choice will be available and when selected will work just like LNVHW does.

For more info on getting into Run Level 3, have a look at my blog on the subject: How to Start openSUSE 12.3 with Grub 2 into Run Level 3 - Blogs - openSUSE Forums



Here is a picture (shown above) of the new colored Full nVIDIA driver installation menu. You MUST install DKMS from the Packman repository to use this bash script!

You can find the latest nVIDIA driver on my blog here: Installing the nVIDIA Video Driver the Hard Way - Blogs - openSUSE Forums



If you are running openSUSE 12.1 and systemd is detected as being installed, a DKMS systemd service file will be created and installed for you to get DKMS working. Further, the old Runlevel stuff is removed, the dkms_autoinstaller is moved and there are many other fixes to get S.A.N.D.I. to work with openSUSE 12.1. I was able to get DKMS to work in openSUSE 12.1 AND it will also install your VirtualBox drivers just fine.

I have written the S.A.N.D.I. bash script to reside in the /usr/local/bin folder. Copy and past the following text into the file sandi (as in /usr/local/bin/sandi). You MUST be a root user to complete this task.

S.A.N.D.I. - SuSE Automated NVIDIA Driver Installer - Version 1.50

It is possible to directly download the script from SUSE Paste using the following commands (You must delete the old version of sandi first). Just open up a terminal session and copy the text from any code block show here and past it after the terminal prompt and then press enter:

Code:
sudo rm /usr/local/bin/sandi
Code:
sudo wget -nc http://paste.opensuse.org/view/download/88011425 -O /usr/local/bin/sandi
Next, you need to mark the file sandi as executable with the following command:

Code:
sudo chmod +x /usr/local/bin/sandi
You can add all three commands above and run it as one. Just copy and paste the following command into a terminal session:

Code:
sudo rm /usr/local/bin/sandi ; sudo wget -nc http://paste.opensuse.org/view/download/88011425 -O /usr/local/bin/sandi ; sudo chmod +x /usr/local/bin/sandi
To use S.A.N.D.I., download the most recent nVIDIA driver to your downloads folder from World Leader in Visual Computing Technologies | NVIDIA, restart your PC into runlevel 3, log in as root and run the terminal command:

Code:
sandi
You can also run S.A.N.D.I. from within your selected desktop as in the picture above. Just open up a terminal session and run the same sandi command as stated before. You can not do a full installation of the nVIDIA driver, but you can load the selected nVIDIA driver into DKMS. If you have already done a full installation of the nVIDIA driver and have the driver already loaded, S.A.N.D.I. will not replace that already loaded video driver and so an error message will be seen after the driver is built. That is normal and is not a problem.

You MUST edit the S.A.N.D.I. bash script file and enter where you have downloaded the nvidia driver files. If you fail to edit the bash script, you will see this error upon startup.

********** > Folder /home/username/Downloads does not exist < **********

Since sandi is being placed into a system folder, you must enter the root user password in order to change/edit the following line(s):

Code:
#
# Where do you keep your nVidia driver downloads?
# Please Make Sure this name is correct - Do not include a "/" at the end...
#
nVidia_folder=/home/yourname/Downloads
Look at these lines and modify if you wish:

Code:
#
# How do you want to restart your PC when done loading the driver?
# The default is REBOOT="reboot" but can also be set for another program
# like REBOOT="fastboot" or REBOOT="pbs" are two example bash scripts.
#
REBOOT="reboot"
To edit the sandi bash script after it is installed, run one of the following commands:

For KDE or GNOME do Alt-F2 and then enter:

Code:
For KDE: kdesu kwrite /usr/local/bin/sandi
OR

Code:
For GNOME: gnomesu gedit /usr/local/bin/sandi
For more information on installing the nVIDIA driver the hard way, please consult the following web link: Installing the nVIDIA Video Driver the Hard Way - Blogs - openSUSE Forums

Be aware that with the latest kernel 3.3, a glitch exists with the nVIDIA driver looking for some Kernel source files in the wrong place. I am running the following command right after compiling and installing the new Linux kernel 3.3 version:

Code:
cd /lib/modules/<kernel name>/source/arch/x86/include ; sudo cp generated/asm/*.h ./asm
My /usr/local/bin/userfix bash script file I am running in order to install the present nVIDIA driver into kernel-3.3-rcx is as follows:

Code:
#!/bin/bash

#: Title       : /usr/local/bin/userfix
#: Date Created: Tue Feb 28 20:09:40 CST 2012
#: Last Edit   : Tue Feb 28 20:09:40 CST 2012
#: Author      : James D. McDaniel
#: Version     : 1.00
#: Description : Run User Pre-dkms Compile Commands
#: Options     : None

echo
echo "User Fix File was Executed ..." 
echo

version=$(uname -r | cut -c -3)
folder="/lib/modules/$(uname -r)/source/arch/x86/include"
if [ "$version" == "3.3" ] ; then
  if [ -d "$folder" ] ; then
    cd $folder 
    cp generated/asm/*.h ./asm
    echo
    echo "Kernel Fix for nVIDIA driver was executed!"
    echo
  fi
fi

exit 0

# End Of Script
As always, I would like to hear about any suggestions or comments you might have about using S.A.N.D.I. - SuSE Automated NVIDIA Driver Installer!

Thank You,

Submit "S.A.N.D.I. - SuSE Automated NVIDIA Driver Installer - Version 1.50" to Digg Submit "S.A.N.D.I. - SuSE Automated NVIDIA Driver Installer - Version 1.50" to del.icio.us Submit "S.A.N.D.I. - SuSE Automated NVIDIA Driver Installer - Version 1.50" to StumbleUpon Submit "S.A.N.D.I. - SuSE Automated NVIDIA Driver Installer - Version 1.50" to Google Submit "S.A.N.D.I. - SuSE Automated NVIDIA Driver Installer - Version 1.50" to Facebook Submit "S.A.N.D.I. - SuSE Automated NVIDIA Driver Installer - Version 1.50" to Twitter

Updated 06-Jan-2014 at 09:58 by kgroneman

Categories
Uncategorized

Comments

Page 1 of 2 12 LastLast
  1. jdmcdaniel3's Avatar
    Version 1.10 of S.A.N.D.I. has been updated to completely remove any existing older nVIDIA driver versions you have been using from your dkms configuration when you select a different nVIDIA driver version for usage.

    Thank You,
  2. jdmcdaniel3's Avatar
    Version 1.15 of S.A.N.D.I. has been updated fix a logic bug in the removal of an unwanted nvidia driver version.

    Thank You,
  3. luvsuse's Avatar
    Hello jdmcdaniel3,

    After installing S.A.N.D.I, when i run it through level 3 as root it give me error DKMS not installed, install it through yast but when i search in yast for installation it gives no result, so how can i install DKMS?

    Thanks n regards
  4. jdmcdaniel3's Avatar
    [QUOTE=luvsuse;bt387]Hello jdmcdaniel3,

    After installing S.A.N.D.I, when i run it through level 3 as root it give me error DKMS not installed, install it through yast but when i search in yast for installation it gives no result, so how can i install DKMS?

    Thanks n regards[/QUOTE]

    DKMS comes from the Packman repository and so you must add that to be able to install the [B]dkms[/B] package (all lower case) as it is called. Here are the Packman repository URL's:

    [CODE]for 12.1: "[B]http://packman.inode.at/suse/openSUSE_12.1/[/B]"[/CODE]

    [CODE]for 11.4: "[B]http://packman.inode.at/suse/openSUSE_11.4/[/B]"[/CODE]

    Using KDE you must go into [B]YaST[/B] (enter the root user password the first time) / [B]Software[/B] / [B]Software Repositories[/B] / [B]Add[/B] /[B] URL[/B] and enter one of the two URL's [B]excluding[/B] the quotes (""). Then, once its there, go into [B]YaST[/B] / [B]Software[/B] / [B]Software Management[/B] and search on [B]dkms[/B] and once found, place a check mark by its name and press the accept button on the bottom right to allow it to be installed.

    That is it and all you need to do.

    Thank You,
  5. luvsuse's Avatar
    Thanks jdmcdaniel3,

    I installed the DKMS, and run the S.A.N.D.I it shows that it installed but , when i logged in and checked the system information, its shows me nouveau driver, some think has gone wrong may be i don't know how to enter in level 3, on boot up i enter nomodeset3 i got x-window login then i press ctrl+alt+f2 , i think its wrong method , that's why i didn't got nvidia driver, so how to enter runlevel-3, please guide.

    Thanks n regards
  6. luvsuse's Avatar
    Thanks jdmcdaniel3,

    Found how to enter level-3 and installed the Nvidia driver, thanks for the nice script.

    Thanks n regards
  7. jdmcdaniel3's Avatar
    [B]S.A.N.D.I. - SuSE Automated NVIDIA Driver Installer - Version 1.32[/B] now includes a new color display engine that works in Runlevel 3 as well as Runlevel 5 using escape codes and not the tput command. The Full nVIDIA driver installation menu is now shown in full color. In Runlevel 5, when you exit SANDI, you get an option to view the nVIDIA driver HTML help document. You must start SANDI as a normal user and enter the root password into SANDI and you must have installed a nVIDIA driver in Runlevel 5 since you updated to version 1.32. The userfix bash script was being added to the boot.local file incorrectly when in openSUSE 12.1 and that has now been fixed. You may wish to edit this file as root and remove the three lines that call userfix to run. Other fixes are included as well.

    Thank You,
    Updated 02-Mar-2012 at 18:51 by jdmcdaniel3
  8. jdmcdaniel3's Avatar
    Version 1.40 of S.A.N.D.I. now allows the Full nVIDIA driver install without the installing of DKMS, which might occur when you first install openSUSE. If DKMS is not installed and the Runlevel is at 3, then the nVIDIA full install menu is presented to you. This allows SANDI to be a full nVIDIA driver solution, not requiring LNVHW on a new installation. Other minor fixes are also included.

    Thank You,
  9. houseclearance's Avatar
    Thank you for posting the latest NVIDIA Video I've been searching that for months to install it on my other computer.
  10. jdmcdaniel3's Avatar
    [QUOTE=houseclearance;bt423]Thank you for posting the latest NVIDIA Video I've been searching that for months to install it on my other computer.[/QUOTE]

    I was happy to be of service to you houseclearance and thanks for you kind comments.

    Thank You,
  11. jdmcdaniel3's Avatar
    I ran into an issue in trying to install these patches into a custom setup nVIDIA driver. That is, you can extract the archive and install the patch, but what it you want to keep the nVIDIA archive intact? Basically, I got some help over at the nVIDIA forum to patch the patch files so that they could be applied to the nVIDIA driver, while leaving or at least getting a new, all in one archive that includes the patch. First, the patch files need to be modified to work. Only a small change to the top was required:

    For the NVIDIA-295.33 Patch (save as NVIDIA-295.33.patch) :

    [CODE]Index: NVIDIA-Linux-x86-295.33/kernel/conftest.sh
    ===================================================================
    --- kernel.orig/conftest.sh
    +++ kernel/conftest.sh
    @@ -95,7 +95,7 @@ build_cflags() {
    fi
    fi

    - CFLAGS="$CFLAGS $OUTPUT_CFLAGS -I$HEADERS $AUTOCONF_CFLAGS"
    + CFLAGS="$CFLAGS $OUTPUT_CFLAGS -I$HEADERS -I$OUTPUT/arch/x86/include/generated $AUTOCONF_CFLAGS"

    test_xen

    @@ -126,7 +126,7 @@ build_cflags() {
    CFLAGS="$BASE_CFLAGS $MACH_CFLAGS $OUTPUT_CFLAGS -I$HEADERS $AUTOCONF_CFLAGS"

    if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then
    - CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include -I$SOURCES/arch/x86/include/generated"
    + CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include -I$OUTPUT/arch/x86/include/generated"
    elif [ "$ARCH" = "ARMv7" ]; then
    CFLAGS="$CFLAGS -I$SOURCES/arch/arm/include -I$SOURCES/arch/arm/include/generated"
    fi
    @@ -965,11 +965,12 @@ compile_test() {
    #
    echo "$CONFTEST_PREAMBLE
    #include <linux/acpi.h>
    + #include <acpi/acpixf.h>
    void conftest_acpi_walk_namespace(void) {
    acpi_walk_namespace();
    }" > conftest$$.c

    - $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
    + #CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
    rm -f conftest$$.c

    if [ -f conftest$$.o ]; then
    @@ -980,6 +981,7 @@ compile_test() {

    echo "$CONFTEST_PREAMBLE
    #include <linux/acpi.h>
    + #include <acpi/acpixf.h>
    void conftest_acpi_walk_namespace(void) {
    acpi_walk_namespace(0, NULL, 0, NULL, NULL, NULL, NULL);
    }" > conftest$$.c
    @@ -996,6 +998,7 @@ compile_test() {

    echo "$CONFTEST_PREAMBLE
    #include <linux/acpi.h>
    + #include <acpi/acpixf.h>
    void conftest_acpi_walk_namespace(void) {
    acpi_walk_namespace(0, NULL, 0, NULL, NULL, NULL);
    }" > conftest$$.c
    @@ -1604,6 +1607,9 @@ case "$6" in
    fi
    fi

    + RET=0
    + SELECTED_MAKEFILE=Makefile.kbuild
    +
    if [ "$RET" = "0" ]; then
    ln -s $SELECTED_MAKEFILE Makefile
    exit 0[/CODE]

    For the NVIDIA-295.20 Patch (save as NVIDIA-295.20.patch) :

    [CODE]Index: NVIDIA-Linux-x86-295.20/kernel/conftest.sh
    ===================================================================
    --- kernel.orig/conftest.sh
    +++ kernel/conftest.sh
    @@ -95,7 +95,7 @@ build_cflags() {
    fi
    fi

    - CFLAGS="$CFLAGS $OUTPUT_CFLAGS -I$HEADERS $AUTOCONF_CFLAGS"
    + CFLAGS="$CFLAGS $OUTPUT_CFLAGS -I$HEADERS -I$OUTOUT/arch/x86/include/generated $AUTOCONF_CFLAGS"

    test_xen

    @@ -126,7 +126,7 @@ build_cflags() {
    CFLAGS="$BASE_CFLAGS $MACH_CFLAGS $OUTPUT_CFLAGS -I$HEADERS $AUTOCONF_CFLAGS"

    if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then
    - CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include"
    + CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include -I$OUTPUT/arch/x86/include/generated"
    elif [ "$ARCH" = "ARMv7" ]; then
    CFLAGS="$CFLAGS -I$SOURCES/arch/arm/include"
    fi
    @@ -980,6 +980,7 @@ compile_test() {

    echo "$CONFTEST_PREAMBLE
    #include <linux/acpi.h>
    + #include <acpi/acpixf.h>
    void conftest_acpi_walk_namespace(void) {
    acpi_walk_namespace(0, NULL, 0, NULL, NULL, NULL, NULL);
    }" > conftest$$.c
    @@ -1560,7 +1561,7 @@ case "$6" in
    #endif
    #if defined(TEST_2_6_OR_3) && (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0))
    #error \"!KERNEL_2_6_OR_3\"
    - #endif" > conftest$$.c
    + #endif " > conftest$$.c

    $CC $CFLAGS -DTEST_2_6_OR_3 -c conftest$$.c > /dev/null 2>&1

    @@ -1604,6 +1605,9 @@ case "$6" in
    fi
    fi

    + RET=0
    + SELECTED_MAKEFILE=Makefile.kbuild
    +
    if [ "$RET" = "0" ]; then
    ln -s $SELECTED_MAKEFILE Makefile
    exit 0
    [/CODE]

    Then, with the patch and NVIDIA driver in the same folder, you can use the commands:

    [CODE]sh ./NVIDIA-Linux-x86_64-295.33.run --apply-patch NVIDIA-295.33.patch

    which creates a [B]NVIDIA-Linux-x86_64-295.33-custom.run[/B] file[/CODE]

    OR

    [CODE]sh ./NVIDIA-Linux-x64-295.33.run --apply-patch NVIDIA-295.33.patch

    which creates a [B]NVIDIA-Linux-x64-295.33-custom.run[/B] file[/CODE]

    OR

    [CODE]sh ./NVIDIA-Linux-x86_64-295.20.run --apply-patch NVIDIA-295.20.patch

    which creates a [B]NVIDIA-Linux-x86_64-295.20-custom.run[/B] file[/CODE]

    OR

    [CODE]sh ./NVIDIA-Linux-x64-295.20.run --apply-patch NVIDIA-295.20.patch

    which creates a [B]NVIDIA-Linux-x64-295.20-custom.run[/B] file [/CODE]

    You then use the resulting custom patch nvidia driver with any kerne-3.3 version.

    Thank You,
  12. jdmcdaniel3's Avatar
    The following patch file can be applied to the NVIDIA-Linux-x86_64-295.33.run or NVIDIA-Linux-x64-295.33.run driver to allow it to install into the latest kernel-3.3-rcx. Copy the text from the code block below and pasted into your favorite text editor and then save it as the text file called NVIDIA-295.33.patch:

    [CODE]Index: NVIDIA-Linux-x86-295.33/kernel/conftest.sh
    ===================================================================
    --- kernel.orig/conftest.sh
    +++ kernel/conftest.sh
    @@ -95,7 +95,7 @@ build_cflags() {
    fi
    fi

    - CFLAGS="$CFLAGS $OUTPUT_CFLAGS -I$HEADERS $AUTOCONF_CFLAGS"
    + CFLAGS="$CFLAGS $OUTPUT_CFLAGS -I$HEADERS -I$OUTPUT/arch/x86/include/generated $AUTOCONF_CFLAGS"

    test_xen

    @@ -126,7 +126,7 @@ build_cflags() {
    CFLAGS="$BASE_CFLAGS $MACH_CFLAGS $OUTPUT_CFLAGS -I$HEADERS $AUTOCONF_CFLAGS"

    if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then
    - CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include -I$SOURCES/arch/x86/include/generated"
    + CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include -I$OUTPUT/arch/x86/include/generated"
    elif [ "$ARCH" = "ARMv7" ]; then
    CFLAGS="$CFLAGS -I$SOURCES/arch/arm/include -I$SOURCES/arch/arm/include/generated"
    fi
    @@ -512,7 +512,7 @@
    # and if it as an 'event' member.
    #
    echo "$CONFTEST_PREAMBLE
    - #include <asm/system.h>
    + #include <asm/switch_to.h>
    #include <linux/pm.h>
    void conftest_pm_message_t(pm_message_t state) {
    pm_message_t *p = &state;
    @@ -965,11 +965,12 @@ compile_test() {
    #
    echo "$CONFTEST_PREAMBLE
    #include <linux/acpi.h>
    + #include <acpi/acpixf.h>
    void conftest_acpi_walk_namespace(void) {
    acpi_walk_namespace();
    }" > conftest$$.c

    - $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
    + #CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
    rm -f conftest$$.c

    if [ -f conftest$$.o ]; then
    @@ -980,6 +981,7 @@ compile_test() {

    echo "$CONFTEST_PREAMBLE
    #include <linux/acpi.h>
    + #include <acpi/acpixf.h>
    void conftest_acpi_walk_namespace(void) {
    acpi_walk_namespace(0, NULL, 0, NULL, NULL, NULL, NULL);
    }" > conftest$$.c
    @@ -996,6 +998,7 @@ compile_test() {

    echo "$CONFTEST_PREAMBLE
    #include <linux/acpi.h>
    + #include <acpi/acpixf.h>
    void conftest_acpi_walk_namespace(void) {
    acpi_walk_namespace(0, NULL, 0, NULL, NULL, NULL);
    }" > conftest$$.c
    @@ -1604,6 +1607,9 @@ case "$6" in
    fi
    fi

    + RET=0
    + SELECTED_MAKEFILE=Makefile.kbuild
    +
    if [ "$RET" = "0" ]; then
    ln -s $SELECTED_MAKEFILE Makefile
    exit 0
    Index: NVIDIA-Linux-x86-295.33/kernel/nv-linux.h
    ===================================================================
    --- kernel.orig/nv-linux.h
    +++ kernel/nv-linux.h
    @@ -111,7 +111,7 @@
    #include <linux/timer.h>

    #include <asm/div64.h> /* do_div() */
    -#include <asm/system.h> /* cli, sli, save_flags */
    +#include <asm/switch_to.h> /* cli, sli, save_flags */
    #include <asm/io.h> /* ioremap, virt_to_phys */
    #include <asm/uaccess.h> /* access_ok */
    #include <asm/page.h> /* PAGE_OFFSET */
    [/CODE]

    To then apply the patch you can use SANDI version 1.45 or manuallly with the following command:

    [CODE]sh ./NVIDIA-Linux-x86_64-295.33.run --apply-patch NVIDIA-295.33.patch

    which creates the file NVIDIA-Linux-x86_64-295.33-custom.run[/CODE]

    OR

    [CODE]sh ./NVIDIA-Linux-x64-295.33.run --apply-patch NVIDIA-295.33.patch

    which creates the file NVIDIA-Linux-x64-295.33-custom.run[/CODE]

    Thank You,
  13. jdmcdaniel3's Avatar
    Here is a nVIDIA driver patch text file I call NVIDIA-295.33+.patch

    [CODE]Index: kernel/conftest.sh
    ===================================================================
    --- kernel/conftest.sh.orig
    +++ kernel/conftest.sh
    @@ -95,7 +95,7 @@ build_cflags() {
    fi
    fi

    - CFLAGS="$CFLAGS $OUTPUT_CFLAGS -I$HEADERS $AUTOCONF_CFLAGS"
    + CFLAGS="$CFLAGS $OUTPUT_CFLAGS -I$HEADERS -I$OUTPUT/arch/x86/include/generated $AUTOCONF_CFLAGS"

    test_xen

    @@ -126,7 +126,7 @@ build_cflags() {
    CFLAGS="$BASE_CFLAGS $MACH_CFLAGS $OUTPUT_CFLAGS -I$HEADERS $AUTOCONF_CFLAGS"

    if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then
    - CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include -I$SOURCES/arch/x86/include/generated"
    + CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include -I$OUTPUT/arch/x86/include/generated"
    elif [ "$ARCH" = "ARMv7" ]; then
    CFLAGS="$CFLAGS -I$SOURCES/arch/arm/include -I$SOURCES/arch/arm/include/generated"
    fi
    @@ -512,7 +512,12 @@ compile_test() {
    # and if it as an 'event' member.
    #
    echo "$CONFTEST_PREAMBLE
    - #include <asm/system.h>
    + #include <linux/version.h>
    + #if LINUX_VERSION_CODE > KERNEL_VERSION(3, 3, 0)
    + #include <asm/switch_to.h>
    + #else
    + #include <asm/system.h>
    + #endif
    #include <linux/pm.h>
    void conftest_pm_message_t(pm_message_t state) {
    pm_message_t *p = &state;
    @@ -965,11 +970,12 @@ compile_test() {
    #
    echo "$CONFTEST_PREAMBLE
    #include <linux/acpi.h>
    + #include <acpi/acpixf.h>
    void conftest_acpi_walk_namespace(void) {
    acpi_walk_namespace();
    }" > conftest$$.c

    - $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
    + #CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
    rm -f conftest$$.c

    if [ -f conftest$$.o ]; then
    @@ -980,6 +986,7 @@ compile_test() {

    echo "$CONFTEST_PREAMBLE
    #include <linux/acpi.h>
    + #include <acpi/acpixf.h>
    void conftest_acpi_walk_namespace(void) {
    acpi_walk_namespace(0, NULL, 0, NULL, NULL, NULL, NULL);
    }" > conftest$$.c
    @@ -996,6 +1003,7 @@ compile_test() {

    echo "$CONFTEST_PREAMBLE
    #include <linux/acpi.h>
    + #include <acpi/acpixf.h>
    void conftest_acpi_walk_namespace(void) {
    acpi_walk_namespace(0, NULL, 0, NULL, NULL, NULL);
    }" > conftest$$.c
    @@ -1604,6 +1612,9 @@ case "$6" in
    fi
    fi

    + RET=0
    + SELECTED_MAKEFILE=Makefile.kbuild
    +
    if [ "$RET" = "0" ]; then
    ln -s $SELECTED_MAKEFILE Makefile
    exit 0
    Index: kernel/nv-linux.h
    ===================================================================
    --- kernel/nv-linux.h.orig
    +++ kernel/nv-linux.h
    @@ -111,7 +111,11 @@
    #include <linux/timer.h>

    #include <asm/div64.h> /* do_div() */
    +#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 3, 0)
    +#include <asm/switch_to.h>
    +#else
    #include <asm/system.h> /* cli, sli, save_flags */
    +#endif
    #include <asm/io.h> /* ioremap, virt_to_phys */
    #include <asm/uaccess.h> /* access_ok */
    #include <asm/page.h> /* PAGE_OFFSET */

    [/CODE]

    Copy the text above into a text file and save as NVIDIA-295.33+.patch in your ~/Downloads folder and you will be able to use it to patch kernels 3.3 and 3.4 for the nVIDIA driver 295.33 in 32 or 64 bit systems and installable by the SANDI bash script.

    Thank You,
  14. jdmcdaniel3's Avatar
    The following Patch file (I called NVIDIA-295.40.patch) and generously supplied by Larry Finger (a well known kernel developer) can be used to patch the latest nVIDIA driver 295.40 for use with the kernel version 3.4.

    [CODE]Index: kernel/conftest.sh
    ===================================================================
    --- kernel/conftest.sh.orig
    +++ kernel/conftest.sh
    @@ -512,13 +512,18 @@ compile_test() {
    # and if it as an 'event' member.
    #
    echo "$CONFTEST_PREAMBLE
    - #include <asm/system.h>
    + #include <linux/version.h>
    +#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 3, 0)
    + #include <asm/switch_to.h>
    +#else
    + #include <asm/system.h>
    +#endif
    #include <linux/pm.h>
    void conftest_pm_message_t(pm_message_t state) {
    pm_message_t *p = &state;
    }" > conftest$$.c

    - $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
    + $CC $CFLAGS -c conftest$$.c #> /dev/null 2>&1
    rm -f conftest$$.c

    if [ -f conftest$$.o ]; then
    @@ -965,6 +970,7 @@ compile_test() {
    #
    echo "$CONFTEST_PREAMBLE
    #include <linux/acpi.h>
    + #include <acpi/acpixf.h>
    void conftest_acpi_walk_namespace(void) {
    acpi_walk_namespace();
    }" > conftest$$.c
    @@ -980,6 +986,7 @@ compile_test() {

    echo "$CONFTEST_PREAMBLE
    #include <linux/acpi.h>
    + #include <acpi/acpixf.h>
    void conftest_acpi_walk_namespace(void) {
    acpi_walk_namespace(0, NULL, 0, NULL, NULL, NULL, NULL);
    }" > conftest$$.c
    @@ -996,6 +1003,7 @@ compile_test() {

    echo "$CONFTEST_PREAMBLE
    #include <linux/acpi.h>
    + #include <acpi/acpixf.h>
    void conftest_acpi_walk_namespace(void) {
    acpi_walk_namespace(0, NULL, 0, NULL, NULL, NULL);
    }" > conftest$$.c
    Index: kernel/nv-linux.h
    ===================================================================
    --- kernel/nv-linux.h.orig
    +++ kernel/nv-linux.h
    @@ -111,7 +111,11 @@
    #include <linux/timer.h>

    #include <asm/div64.h> /* do_div() */
    +#if LINUX_VERSION_CODE > KERNEL_VERSION(3, 3, 0)
    +#include <asm/switch_to.h>
    +#else
    #include <asm/system.h> /* cli, sli, save_flags */
    +#endif
    #include <asm/io.h> /* ioremap, virt_to_phys */
    #include <asm/uaccess.h> /* access_ok */
    #include <asm/page.h> /* PAGE_OFFSET */

    [/CODE]

    This patch, when save with the suggested file name (NVIDIA-295.40.patch), can be used to patch the nVIDIA driver 295.40 and loaded using SANDI shown above.

    Thank You,
  15. kujirasan's Avatar
    This version of SANDI needs a patch to be used by
    NVIDIA-Linux-x86_64-295.40.run?
    when using SANDI , xserver must be shut down or not? using init 3 command,?
    Run Leve 3! Does it mean a terminal?
  16. jdmcdaniel3's Avatar
    [QUOTE=kujirasan;bt458]This version of SANDI needs a patch to be used by
    NVIDIA-Linux-x86_64-295.40.run?
    when using SANDI , xserver must be shut down or not? using init 3 command,?
    Run Leve 3! Does it mean a terminal?[/QUOTE]

    The patch is required if you are using the released version of kernel 3.3 (which openSUSE 12.2 will use) or if you are trying out the beta kernel 3.4. If you use kernel 3.2 or lower, no patch is required. The patch is specific to the kernel being used and the version of the nVIDIA driver being loaded. Basically the kernel source file has changed, first with 3.3 and further with kernel 3.4 all the while the nVIDIA driver has changed as well, now up to version 295.40 and nVIDIA so far has NOT kept up with the kernel source file changes, all the while they keep changing their code as well. With the generous help of others such as Larry Finger, a kernel developer, we are trying to provide a way to match the latest kernel versions with the latest nVIDIA drivers, but it is not been easy to keep these two together. Right now, there is no single solution that gets kernels 3.2, 3.3 and 3.4 to work with the latest nVIDIA driver version and on top of that, nVIDIA driver 295.40 is said to have problems with older nVIDIA GPU versions. In the end, its is up to nVIDIA to provide a single solution, but they have failed to do this so far.

    Thank You,
    Updated 28-Apr-2012 at 06:41 by jdmcdaniel3
  17. jdmcdaniel3's Avatar
    Copy the text in the code block below into a text editor and save the text as the file: NVIDIA-295.49-302.07.patch

    [CODE]--- kernel/conftest.sh 2012-05-01 10:46:38.000000000 +0400
    +++ kernel/conftest.sh 2012-05-04 22:19:39.463000001 +0400
    @@ -512,7 +512,6 @@
    # and if it as an 'event' member.
    #
    echo "$CONFTEST_PREAMBLE
    - #include <asm/system.h>
    #include <linux/pm.h>
    void conftest_pm_message_t(pm_message_t state) {
    pm_message_t *p = &state;
    --- kernel/nv-linux.h 2012-05-01 10:46:38.000000000 +0400
    +++ kernel/nv-linux.h 2012-05-04 23:35:26.315000020 +0400
    @@ -111,7 +111,6 @@
    #include <linux/timer.h>
    #include <asm/div64.h> /* do_div() */
    -#include <asm/system.h> /* cli, sli, save_flags */
    #include <asm/io.h> /* ioremap, virt_to_phys */
    #include <asm/uaccess.h> /* access_ok */
    #include <asm/page.h> /* PAGE_OFFSET */
    @@ -994,9 +993,19 @@
    # define NV_IS_SUSER() capable(CAP_SYS_ADMIN)
    # define NV_PCI_DEVICE_NAME(dev) ((dev)->pretty_name)
    # define NV_NUM_CPUS() num_online_cpus()
    +
    +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)
    +# include <asm/system.h>
    # define NV_CLI() local_irq_disable()
    # define NV_SAVE_FLAGS(eflags) local_save_flags(eflags)
    # define NV_RESTORE_FLAGS(eflags) local_irq_restore(eflags)
    +#else
    +# include <asm/irqflags.h>
    +# define NV_CLI() arch_local_irq_disable()
    +# define NV_SAVE_FLAGS() arch_local_save_flags()
    +# define NV_RESTORE_FLAGS(eflags) arch_local_irq_restore(eflags)
    +#endif
    +
    # define NV_MAY_SLEEP() (!irqs_disabled() && !in_interrupt() && !NV_IN_ATOMIC())
    # define NV_MODULE_PARAMETER(x) module_param(x, int, 0)
    # define NV_MODULE_STRING_PARAMETER(x) module_param(x, charp, 0)
    --- kernel/nv-pat.c 2012-04-27 22:50:12.000000000 +0400
    +++ kernel/nv-pat.c 2012-05-04 23:48:45.842000011 +0400
    @@ -109,7 +109,11 @@
    return;
    #endif

    +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)
    NV_SAVE_FLAGS(eflags);
    +#else
    + NV_SAVE_FLAGS();
    +#endif
    NV_CLI();
    nv_disable_caches(&cr4);

    @@ -135,7 +139,11 @@
    return;
    #endif

    +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0)
    NV_SAVE_FLAGS(eflags);
    +#else
    + NV_SAVE_FLAGS();
    +#endif
    NV_CLI();
    nv_disable_caches(&cr4);
    [/CODE]

    For users of the new Kernel 3.4, this patch can be loaded into SANDI to create a usable custom copy of the nVIDIA driver 295.49 or the beta 302.07 version of the nVIDIA proprietary video driver.

    Links to these driver versions are here: [URL="http://forums.opensuse.org/blogs/jdmcdaniel3/installing-nvidia-video-driver-hard-way-29/"]Installing the nVIDIA Video Driver the Hard Way - Blogs - openSUSE Forums[/URL]

    Thank You,
    Updated 05-May-2012 at 08:47 by jdmcdaniel3
  18. jdmcdaniel3's Avatar
    NVIDIA Driver 295.59 has been released which is easy to use with SANDI. I suggest that you take the following steps:

    1. Download the latest nVIDIA driver to your ~/Downloads folder.
    2. Close all apps and restart your PC.
    3. Enter the kernel load option 3, taking you to runlevel 3, not loading your desktop
    4. Once your kernel is loaded, log into terminal as a root user
    5. Start sandi at the terminal prompt
    6. Select the nVIDIA driver version to load
    7. Select D for DKMS and allow all previous nVIDIA drivers loaded to be removed
    8. Once SANDI is complete, do not restart and run sandi again
    9. Again, select the same nVIDIA driver version, but this time, select F for a Full nVIDIA driver installation
    10. Once the full install is complete, you may now reboot your computer

    Please let me know if you have any questions.

    Thank You,
  19. lovetoflyguy's Avatar
    Hi James,

    First of all, thank you for sharing your scripts and expertise!

    I have a few questions for you.

    1. Does the 304.64 driver require a patch to work with SANDI and the current (oS 12.2) 3.4.x kernel?

    2. Which is the 'best' or preferred method to install the Nvidia driver (with as little pain as possible!) - LNVHW or SANDI?

    3. In the event that I completely bork the driver install and want to start from scratch again, how do I restore the default nouveau driver?

    Thanks!
  20. jdmcdaniel3's Avatar
    [QUOTE=lovetoflyguy;bt614]Hi James,

    First of all, thank you for sharing your scripts and expertise!

    I have a few questions for you.

    1. Does the 304.64 driver require a patch to work with SANDI and the current (oS 12.2) 3.4.x kernel?

    2. Which is the 'best' or preferred method to install the Nvidia driver (with as little pain as possible!) - LNVHW or SANDI?

    3. In the event that I completely bork the driver install and want to start from scratch again, how do I restore the default nouveau driver?

    Thanks![/QUOTE]

    You are very welcome and happy you are finding my bash scripts useful. Now the nVIDIA driver is up to 310.19 so I would want to know why you want to use 304.64? As for SANDI and LNVHW, they have the same install options for the nVIDIA driver, but SANDI works only if you compile your own kernels, such as can be done with my SAKC script and you have installed dkms to auto load the nVIDIA driver when you update your kernel. If this last sentence makes you ask WHAT? Then stick with LNVHW as it works with all kernel versions as long as you have installed the suggested kernel source files. You just have to reinstall the nVIDIA driver on each kernel version update. As luck would have it, you don't get those all that often normally. Going back to using the nouveau driver can be tricky. You must do the following.

    1. Remove the nomodeset kernel load option from your Grub2/grub menu files.
    2. You must make sure the sysconfig value of NO_KMS_INITRD=NO
    3. Must remove any nouveau blacklist commands.
    4. Must uninstall the nVIDIA driver, perhaps you do this first.
    5. Must make all changes in Runlevel 3 with no UI loaded.
    6. Make sure console tools are loaded perhaps and make sure you can use the terminal program mc (Midnight Commander).
    7. Might want to delete the xorg.cong file if it exists with any nvidia stuff wrote to it. This file is not required.

    So I can admit to just reinstalling openSUSE before to switch to nouveau, particularly if any other issues might exist. I always do a custom partition, reuse all existing ones, I format root /, only mount /home and keep all personnel settings and must reload all applications and redo system settings. This sounds like a lot, but in just two nights I can have my system up and running just as before. I keep a copy of such files as the fstab file, make a screen capture of the partitioner so I know what I called each partition and my samba.conf file and of course, I write scripts to automate as many things as I can like setting up SAMBA. In the end, it can even be fun, but for some it sounds like torture.

    What I can say is that the open source nVIDIA driver nouveau works better than I have ever seen before in kernel 3.6 and I would give it a try before I switched to the nVIDIA proprietary driver. Once I loaded the nVIDIA driver, I would likely stick with it unless something blew up and not downgrade back to the nouveau driver. Keep good backups of system files and try to never reformat your /home area and of course backup any irreplaceable files.

    Thank You,
    Updated 07-Dec-2012 at 19:15 by jdmcdaniel3
Page 1 of 2 12 LastLast