Article: LNVHW - Load NVIDIA (driver the) Hard Way from runlevel 3 - Version 1.46

Version 1.46 of LNVHW works with openSUSE 12.1 and will validate the existence of the NVIDIA drivers and for user input. LNVHW is a bash script designed to install the nVIDIA proprietary video driver the Hard Way, which is not hard. LNVHW now supports full color with a new color engine that works in RunLevel 3. In Version 1.46, I have added the ability to run the driver install with the following options shown below and now include the ability to install nVIDIA driver patch files. After installing a Patch, please rerun LNVHW to install the newly patched driver filer.

LNVHW will blacklist the nouveau driver for you on a successful nVIDIA driver installation. If the nVIDIA driver install exits with a error code higher than 0, it will be displayed for you. To get the nVIDIA driver to want to load you must have used the kernel load command called** nomodeset** when you started openSUSE or you set the kernel option No KMS in Initrd (from YaST Sysconfig) and restarted openSUSE. Then finally, you used the kernel load option 3, to switch to run level 3 or you used the init 3 terminal command as root to unload the desktop and switch to run level 3.

I have determined that you can keep the lnvhw file in the /usr/local/bin folder. Copy and past the following text into the file lnvhw (as in /usr/local/bin/lnvhw). You MUST be a root user to complete this task. The lnvhw bash script is too large to be posted here and is in SUSE Paste at the following location below:

LNVHW - Load NVIDIA (driver the) Hard Way from runlevel 3 - Version 1.46

It is possible to directly download the script from SUSE Paste using the following commands (You must delete the old version of lnvhw 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:

sudo rm /usr/local/bin/lnvhw
sudo wget -nc -O /usr/local/bin/lnvhw

Next, you need to mark the file lnvhw as executable with the following command:

sudo chmod +x /usr/local/bin/lnvhw

You can add all three commands above and run it as one. Just copy and paste the following command into a terminal session:

sudo rm /usr/local/bin/lnvhw ; sudo wget -nc -O /usr/local/bin/lnvhw   ; sudo chmod +x /usr/local/bin/lnvhw 

To use lnvhw, download the most recent nVIDIA driver to your downloads folder from Welcome to NVIDIA - World Leader in Visual Computing Technologies, restart your PC into runlevel 3, log in as root and run the terminal command:


You MUST edit the LNVHW bash script file and enter where you have downloaded the nvidia driver files. Since lnvhw is being placed into a system folder, you must enter the root user password in order to change/edit the following line(s):

# Where do you keep your nVidia driver downloads?
# Please Make Sure this name is correct - Do not include a "/" at the end...

Look at these lines and modify if you wish:

# 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.

To edit the LNVHW bash script after it is installed, run one of the following commands:

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

For KDE:** kdesu kwrite /usr/local/bin/lnvhw**


For GNOME: **gnomesu gedit /usr/local/bin/lnvhw**

For more information on installing the nVIDIA driver the hard way, please consult the following web link:
SDB:NVIDIA the hard way - openSUSE

In order to install the nVIDIA proprietary video driver, you need to already have the driver you want down loaded in your Downloads folder and you need to be in run level mode 3. With the advent of systemd in openSUSE 12.1, run levels don’t mean the same that they used to, but the command still works as required and the lnvhw bash scripts still is able to confirm you are in the correct mode. Normally, I am reloading the nVIDIA driver because I just updated or replaced my Linux kernel, but you can just update the driver without having a kernel version change.

If you are running in a desktop and want to install the latest nVIDIA driver you have downloaded and you have not changed or updated your kernel version, then do the following:

For KDE you can use:

Alt F2: **kdesu /sbin/init 3**

For GNOME you can use:

Alt F2: **gnomesu /sbin/init 3**

In openSUSE 12.1, you may need to press enter once to get a login prompt. At the login prompt then:

login: root
<nVIDIA driver loads>
login: username
sudo /sbin/init 5

If you have changed or upgraded your kernel, then you need to restart your PC so that the new kernel will be loaded and you stop at runlevel 3, not loading your desktop. A great way to do this is to use my FastBoot and asroot bash scripts (see links at the bottom of this page). Open up a terminal session and run the commands:

asroot fastboot 

The bash script asroot enters the root user password for you and fastboot brings up a menu of all of your openSUSE kernel load commands (minus any Windows entries). Enter the number**#** for the kernel you wish to use and press enter. Then enter the command A to add a kernel load option and then enter the number 3. A 3 will be added to your other existing kernel load options and then press a Y to restart your PC. Your PC will restart, but you will not load your desktop and you will end up at the terminal prompt. With openSUSE 12.1, its possible at the end you just need to press the enter key to get a login prompt. Then, follow these commands:

login: root
<nVIDIA driver loads>

If you have replaced the reboot command in lnvhw with fastboot, then just answer a Y for yes to reboot at the end of the bash script operation. Else, answer N for no to doing a reboot and enter the terminal command fastboot.

For anyone interested in using DKMS to automatically install the nVIDIA driver, have a look at this blog on the subject: S.A.N.D.I. - SuSE Automated NVIDIA Driver Installer

Please enjoy using LNVHW and I want to hear all comments that you might have on the bash scripting file.

Thank You,

Blogs: C.F.U. : fewrup : F.S.M. : H.I. : nVIDIA : MMCHECK : N.S.F. : P.B.S. : S.A.K.C. : S.W.A.T. : S.A.S.I. : S.C.L.U. : S.G.T.B. : S.K.I.M. : S.L.A.V.E. : S.L.R.C. : S.T.A.R.T. : S.U.F.F. : SYSEdit : systemd

If one want to use this script just after a fresh install, all packages update and patches update must be done before. Unless doing this, the nvidia driver could not install.

After a fresh install of openSUSE and after you have downloaded the proprietary video driver from nVIDIA, you need to get the kernel source files which can be done from YaST as follows:

Open YaST / Software / Software Management - Select the View Button on the top left and pick Patterns. Now, you will see several Patterns listed and you want to select:


[X] Base Development
[X] Linux Kernel Development
[X] C/C++ Development

Then Press the Accept button on the bottom right and allow these applications to install.

You need to edit the lnvhw script to inform it as to where you keep your nVIDIA drivers. The suggested default is in your /home/username/Downloads folder. You must edit the script to enter this as you will be running the script later as root. Once complete you are ready to load the nVIDIA driver. Just reboot your PC and in the Grub OS selection menu, enter the number 3 and press the enter key. Once at the terminal prompt, login as root and run lnvhw. You must reload the driver on each kernel update. To do this automatically, you can look at my SANDI bash script. Each article explains the procedures.

Thank You,

I was trying to run lnvhw but kept getting the message that I was running an X server.
Hmmm, I was for sure at level 3.
Ran top - Doh!, I had xvnc starting at boot.
Had to kill it.

Perhaps the script could help remind us?

LNVHW will not run unless it thinks we are at runlevel 3, but with the advent of openSUSE 12.1 and systemd, R-3 is not what it seems I guess. If you have a specific value(s) to look at or for, I am sure I could add it to the script. However, doing a restart of openSUSE and entering a 3 as a kernel load option does work properly most of the time. In any event, thanks for your comments as I will look into xvnc detection.

Thank You,

Missing dependency on 12.3 MS-3.
Could you look at my bug report :