Go Back   nV News Forums > Linux Support Forums > NVIDIA Linux

Newegg Daily Deals

Reply
 
Thread Tools
Old 04-26-09, 03:51 AM   #1
AwesomeTux
Registered User
 
Join Date: Dec 2008
Posts: 55
Post Easy nVidia driver update and installation

I call it "nDrivia" it is a _very_ simple shell/bash/terminal script.

Code:
# sudo chvt 1 #

echo 'NOTE: BY RUNNING THIS SHELL/BASH/TERMINAL SCRIPT, YOU AGREE THAT WE ARE NOT RESPONSIBLE FOR ANY DAMAGES, YOU AGREE THAT YOU ARE RUNNING THIS AT YOUR OWN RISK! This shell/bash/terminal script only runs the necessary commands, in their necessary order, to install nVidia Linux video card drivers, then restart GDM and the GUI (Graphical User Interface.)';
echo
sleep 8

sudo /etc/init.d/gdm stop
/etc/init.d/gdm stop 
clear

cd ~/Desktop/
sudo ./NVIDIA-Linux-*-*-pkg*.run
clear

echo "Hope that did the trick for you! Let's see...";
echo
echo Restarting the Graphical User Interface!
sleep 4

/etc/init.d/gdm start
sudo /etc/init.d/gdm start
exit
Take that code, and save it as a .sh file on your Desktop, Documents, filesystem, or as I would do it in /usr/bin, so all I have to do is type in the "command" "sudo ndrivia"

Here's what'll happen. If you place it in /usr/bin. You have to have/download only ONE nVidia driver .run files on/to your Desktop. You have to press Ctrl+Alt+F1, it'll ask for your password, then type "sudo ndrivia" It'll ask for your password. Then It'll display this for 8 seconds...

Quote:
NOTE: BY RUNNING THIS SHELL/BASH/TERMINAL SCRIPT, YOU AGREE THAT WE ARE NOT RESPONSIBLE FOR ANY DAMAGES, YOU AGREE THAT YOU ARE RUNNING THIS AT YOUR OWN RISK! This shell/bash/terminal script only runs the necessary commands, in their necessary order, to install nVidia Linux video card drivers, then restart GDM and the GUI (Graphical User Interface.)
It'll then stop GDM, and run the nVidia installer. When the nVidia installer is finished, it'll display this for 4 seconds...

Quote:
Hope that did the trick for you! Let's see...

Restarting the Graphical User Interface!
It'll start GDM. And if you picked the right nVidia driver for your card(obviously) all should work.

NOTE: You might have to modify the code slightly, for example, to stop KDM, or for other KDE or Fedora/etc. things. This script is designed for GNU/Linux. And you should only have ONE nVidia driver .run file on your Desktop when running this script.
AwesomeTux is offline   Reply With Quote
Old 04-28-09, 06:26 AM   #2
NvFuchs
Registered Fox
 
NvFuchs's Avatar
 
Join Date: Oct 2007
Location: Confoederatio Helvetica
Posts: 530
Default Re: Easy nVidia driver update and installation

Sorry, but this is a rather bad idea from so many different point of views ...

(List is not complete, but these are probably the worst issues)

First of all, the script is not dynamic at all.
As you say by yourself, it is only for gdm, plus for distributions that have a /etc/init.d/gdm

Then: You are using sudo in the file, even though

a) sudo is not available on all distributions
b) sudo probably prompts for a password for most of the actions

You say that you run this script already with sudo, so all the sudos used are nonsense anyway.

It is a security risk, as you assume that the right binaries are the first ones taken from $PATH, and you are using too much wildcards in my opinion.

You have no shebang line, so you have to tell the script which interpreter it has to use.

There are errors in the script, you start gdm twice in the worst case. (Which, depending on gdm, will even work, but create something the user doesn't want)

And, most of all: Installing the driver that way fails on the most popular distributions. Even worse, it will break up the system at least on *Ubuntu, SuSE and Fedora, as there are additional steps are necessary.

Fuchs

Last edited by NvFuchs; 04-29-09 at 02:40 PM.
NvFuchs is offline   Reply With Quote
Old 04-28-09, 01:26 PM   #3
artem
Registered User
 
Join Date: Jun 2006
Posts: 705
Default Re: Easy nVidia driver update and installation

1) Stopping GDM doesn't mean that your X session will be terminated automatically.
2) There's no need for 'exit' at the end of the script.
3) You'd better add #! /bin/bash to the beginning, as ****s said.
4) I don't really understand why you stop and start gdm twice. Normal users are not allowed to stop/start system services, as such "/etc/init.d/gdm stop|start" will not work and are unnecessary.
5) I won't recommend using this script to anyone who uses already mentioned distros (or better say any distros which have an ability of automatic updates and packet managers), because Xorg-server or/and Mesa updates will render system unstable/unusable. NVIDIA drivers do mess up with some system libraries (and there's a reason for that).
artem is offline   Reply With Quote
Old 04-29-09, 01:36 AM   #4
AwesomeTux
Registered User
 
Join Date: Dec 2008
Posts: 55
Default Re: Easy nVidia driver update and installation

Well... FIX IT, IMPROVE IT. So we can all have a really easy way to install the latest nVidia drivers. I'm a free software advocate. Maybe the final script will be incorporated into the drivers themselves.

I'll also point out "If you can't say anything nice, don't say anything at all."
AwesomeTux is offline   Reply With Quote
Old 04-29-09, 03:14 AM   #5
NvFuchs
Registered Fox
 
NvFuchs's Avatar
 
Join Date: Oct 2007
Location: Confoederatio Helvetica
Posts: 530
Default Re: Easy nVidia driver update and installation

Quote:
Originally Posted by AwesomeTux View Post
Well... FIX IT, IMPROVE IT.
The idea behind it is broken, not only the script. And this is something we can't fix.

Quote:
So we can all have a really easy way to install the latest nVidia drivers.
We do have a really easy way to install the drivers: Using the packages provided by the distributions. This is, in my humble opinion, the only correct way of doing it.

If a distribution package manager does not think that the latest driver is ready for being included in the standard distribution, then he is probably right. Normal users, who would be the targeted audience for such a script, should never install it then.

If you want to help, then create packages of the latest driver. This is the correct way of handling such things.

It is almost impossible to write a bash script for that. There are hundreds of distributions out there, which handle init scripts, configurations, modules, xdm|gdm|kdm, X, ... completely different. You would have to write a one for all script, which will be almost impossible to maintain.

That's why there are packages, they take care of distribution specific stuff.


Quote:
I'm a free software advocate. Maybe the final script will be incorporated into the drivers themselves.
I don't think so. The driver installer does now include the possibility of adding distribution specific hooks, and we have package management solutions for linux.

As said, the bash script would be unmaintainable, huge and still a bad idea.

Quote:
I'll also point out "If you can't say anything nice, don't say anything at all."
Bad idea. Because that way nobody would criticize bad ideas, and all those bad ideas would be implemented (This can be applied not only to software, but also business, clubs, politics, ...). We told you _why_ it is bad, this is the important difference. This is what we call "productive criticism" here. It helps to improve things. As a free software advocate you should be aware that this kind of criticism is wide spread, just read the Kernel Mailing List as a good example.

Fuchs
NvFuchs is offline   Reply With Quote
Old 04-29-09, 04:51 AM   #6
AwesomeTux
Registered User
 
Join Date: Dec 2008
Posts: 55
Default Re: Easy nVidia driver update and installation

Quote:
Originally Posted by NvFuchs View Post
The idea behind it is broken, not only the script. And this is something we can't fix.



We do have a really easy way to install the drivers: Using the packages provided by the distributions. This is, in my humble opinion, the only correct way of doing it.

If a distribution package manager does not think that the latest driver is ready for being included in the standard distribution, then he is probably right. Normal users, who would be the targeted audience for such a script, should never install it then.

If you want to help, then create packages of the latest driver. This is the correct way of handling such things.

It is almost impossible to write a bash script for that. There are hundreds of distributions out there, which handle init scripts, configurations, modules, xdm|gdm|kdm, X, ... completely different. You would have to write a one for all script, which will be almost impossible to maintain.

That's why there are packages, they take care of distribution specific stuff.




I don't think so. The driver installer does now include the possibility of adding distribution specific hooks, and we have package management solutions for linux.

As said, the bash script would be unmaintainable, huge and still a bad idea.



Bad idea. Because that way nobody would criticize bad ideas, and all those bad ideas would be implemented (This can be applied not only to software, but also business, clubs, politics, ...). We told you _why_ it is bad, this is the important difference. This is what we call "productive criticism" here. It helps to improve things. As a free software advocate you should be aware that this kind of criticism is wide spread, just read the Kernel Mailing List as a good example.

Fuchs
One: It is something easily fixed. It works 100% for me as is.

Two: With the video card I have now, if I wanted to play games and/or run Compiz on Ubuntu, CentOS, Damn Small Linux, Debian, Elive, FaunOS, Fedora, Foresight, Gentoo, GoblinX, gOS, Knoppix, Linspire, Freespire, Linpus, Mint, Mandriva, openSUSE, Openwall, Paldo, Pardus, Parsix, PC/OS, PCLinuxOS, Puppy, Red Hat, Sabayon, Sidux, SimplyMEPIS, Slackware, Slax, Yoper, Zenwalk, etc., etc., I couldn't because the latest stable nVidia drivers aren't in the repositories. And having the user do without drivers ISN'T an option.

Three: The terminology behind "If you can't say anything nice, don't say anything at all" is "Only products that receive positive review are worthy of existence" so, not enough positive opinions or attention at all, the product or in this case feature isn't included.
AwesomeTux is offline   Reply With Quote
Old 04-29-09, 05:27 AM   #7
NvFuchs
Registered Fox
 
NvFuchs's Avatar
 
Join Date: Oct 2007
Location: Confoederatio Helvetica
Posts: 530
Default Re: Easy nVidia driver update and installation

Quote:
Originally Posted by AwesomeTux View Post
One: It is something easily fixed. It works 100% for me as is.
On your system, your distribution, yes.

I can give you at least 3 popular distributions where it won't work, plus mine (which is Gentoo, I don't count it as too popular)

Let's see what has to be adapted only for gentoo: sudo is not part of a "normal" gentoo installation (if such a thing even exists). Neither /etc/init.d/gdm nor /etc/init.d/kdm exist.

The manual installation might screw up the libraries, as usually with gentoo you have them in a special place, and by using eselect you can choose which ones to use.

Now just multiply those changes (because the amount of work needed is probably +/- the same) by distributions available, and you see the problem.

Quote:
Two: With the video card I have now, if I wanted to play games and/or run Compiz on Ubuntu, CentOS, Damn Small Linux, Debian, Elive, FaunOS, Fedora, Foresight, Gentoo, GoblinX, gOS, Knoppix, Linspire, Freespire, Linpus, Mint, Mandriva, openSUSE, Openwall, Paldo, Pardus, Parsix, PC/OS, PCLinuxOS, Puppy, Red Hat, Sabayon, Sidux, SimplyMEPIS, Slackware, Slax, Yoper, Zenwalk, etc., etc., I couldn't because the latest stable nVidia drivers aren't in the repositories. And having the user do without drivers ISN'T an option.
For gentoo: they are (and it is easy to write a ebuild for the short time where they are not). For the others: create packages for them. You can't have a one-for-all script, so the best option is packages.

If you have too much time at hand, just install half of the distributions you just mentioned in virtual machines and look at the adaptions needed for your script. Then you might see the problem.

Quote:
Three: The terminology behind "If you can't say anything nice, don't say anything at all" is "Only products that receive positive review are worthy of existence" so, not enough positive opinions or attention at all, the product or in this case feature isn't included.
So you prefer to shut people up instead of hearing productive criticism, noted. You will forget about your script if you don't receive (enough) positive feedback here: noted.

Fuchs
NvFuchs is offline   Reply With Quote
Old 04-29-09, 06:10 AM   #8
AwesomeTux
Registered User
 
Join Date: Dec 2008
Posts: 55
Default Re: Easy nVidia driver update and installation

Quote:
Originally Posted by NvFuchs View Post
On your system, your distribution, yes.

I can give you at least 3 popular distributions where it won't work, plus mine (which is Gentoo, I don't count it as too popular)

Let's see what has to be adapted only for gentoo: sudo is not part of a "normal" gentoo installation (if such a thing even exists). Neither /etc/init.d/gdm nor /etc/init.d/kdm exist.

The manual installation might screw up the libraries, as usually with gentoo you have them in a special place, and by using eselect you can choose which ones to use.

Now just multiply those changes (because the amount of work needed is probably +/- the same) by distributions available, and you see the problem.



For gentoo: they are (and it is easy to write a ebuild for the short time where they are not). For the others: create packages for them. You can't have a one-for-all script, so the best option is packages.

If you have too much time at hand, just install half of the distributions you just mentioned in virtual machines and look at the adaptions needed for your script. Then you might see the problem.
All that yammer is bull****. It is a _very_ easy thing to accomplish. It'll just take so much longer if I have to do it alone.

Quote:
So you prefer to shut people up instead of hearing productive criticism, noted. You will forget about your script if you don't receive (enough) positive feedback here: noted.
And I will continue to use this script, but I won't post it again or recommend it to someone if people (elsewhere not just here) don't think it's a good start to a good idea. There seems to be an abundance of people like you here. Who are just as corrupt as nVidia is.
AwesomeTux is offline   Reply With Quote

Old 04-29-09, 07:15 AM   #9
DeiF
Registered User
 
Join Date: Oct 2008
Posts: 114
Default Re: Easy nVidia driver update and installation

This script won't work for me (using openSuSE).

"/etc/init.d/gdm" doesn't exist. Would work probably with "/etc/init.d/xdm", but then it would kick the user from the graphical interface, which is bad.

"~/Desktop" is not where my desktop is, it's in "~/Escritorio". I rename every English directory in my "/home" to Spanish to match the rest of my desktop language. Then I change the default location in KDE4 SystemSettings.

Also, I don't put my downloaded files in the desktop, as I find more convenient to put them in "~/Documents/Downloads" (translated to Spanish, of course).

And I'm not sure if this line would install one or all the downloaded NVIDIA drivers in the directory. I usually have plenty of them to compare between versions.
"sudo ./NVIDIA-Linux-*-*-pkg*.run"


The ideal example of installation would be this:
  • User downloads the driver from NVIDIA's site. The user knows where the file is (desktop, download folder, etc)
  • User clicks on the file.
  • A nice installation dialog appears. The user is prompted with the root password. The installation begins.
  • The dialog prompts the user to reboot the graphical interface: "Pess here to reboot GUI"
  • The desktop flashes for a bit and then the user logs in again with all working.

Anything more complicated than this (for the users) is not worth the effort, as distros usually have an easy way to install the NVIDIA driver.

The drivers listed in the forum are all beta drivers anyway (even the "stable" ones).
DeiF is offline   Reply With Quote
Old 04-29-09, 12:59 PM   #10
AaronP
NVIDIA Corporation
 
AaronP's Avatar
 
Join Date: Mar 2005
Posts: 2,487
Default Re: Easy nVidia driver update and installation

Quote:
Originally Posted by DeiF View Post
The ideal example of installation would be this:
  • User downloads the driver from NVIDIA's site. The user knows where the file is (desktop, download folder, etc)
  • User clicks on the file.
  • A nice installation dialog appears. The user is prompted with the root password. The installation begins.
  • The dialog prompts the user to reboot the graphical interface: "Pess here to reboot GUI"
  • The desktop flashes for a bit and then the user logs in again with all working.
This is, unfortunately, not possible for nvidia-installer to do. For the same reasons mentioned here, there is no reliable way of shutting down the X server, performing some installation steps, and then starting it up again from a script (or program like nvidia-installer) that will work on all Linux distributions. This is one of the reasons that nvidia-installer insists on the X server being stopped first.

That said, I'm considering relaxing that restriction and allowing nvidia-installer to run while X is running if it can successfully unload the nvidia.ko kernel module, for example, if you're using the nv or vesa drivers and there are no OpenGL or CUDA applications running. If you'd like to give that a try, you can pass the --no-x-check option to the installer. Please note that it will fail if it can't unload the kernel module, so if the driver is still in use, that's expected. Distribution-provided packages have an advantage here because they know that their kernel modules will work with the installed kernel. nvidia-installer doesn't have that luxury and must test-load the module to make sure it works.

If installing the nvidia driver while X is running with a different driver proves reliable, then I'll look at what it would take to add a graphical installer front-end.
AaronP is offline   Reply With Quote
Old 04-29-09, 02:35 PM   #11
mooninite
Registered User
 
Join Date: May 2006
Posts: 477
Default Re: Easy nVidia driver update and installation

AaronP,

Could you build something into the nvidia module that allows temporary suspension of resources of the module? It could "suspend" the X session long enough to allow access to the card resources required by the new module, load/unload the new module, then let the old module resume the session. This is done without unloading the original nvidia.ko from the kernel.

I imagine the screen would go black for 1-2 seconds during this process.
mooninite is offline   Reply With Quote
Old 04-29-09, 02:55 PM   #12
AaronP
NVIDIA Corporation
 
AaronP's Avatar
 
Join Date: Mar 2005
Posts: 2,487
Default Re: Easy nVidia driver update and installation

Quote:
Originally Posted by mooninite View Post
AaronP,

Could you build something into the nvidia module that allows temporary suspension of resources of the module? It could "suspend" the X session long enough to allow access to the card resources required by the new module, load/unload the new module, then let the old module resume the session. This is done without unloading the original nvidia.ko from the kernel.

I imagine the screen would go black for 1-2 seconds during this process.
I actually thought about that for a while, and the answer is not really -- we could probably test-load the module with a different name, but one of the things it tests is whether the device probe routine is called correctly, and that wouldn't work. Also, even if we could suspend things for a while, there's no way to unhook and replace the X driver in a running X server so you'd still have to completely restart the X server anyway. Finally, while a VT switch will work to clear out the X driver and direct-rendering OpenGL and VDPAU clients, there's nothing similar that would work for CUDA apps, so having any of those running would still prevent the kernel module from being unloaded.
AaronP is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Similar Threads
Thread Thread Starter Forum Replies Last Post
Graphics driver installation problem (your comments will be highly appreciated) apuurboo NVIDIA GeForce 400/500 Series 0 06-16-12 07:35 AM
Graphics driver installation problem (your comments will be highly appreciated) apuurboo NVIDIA GeForce 400/500 Series 0 06-13-12 07:58 AM
Stubborn screen res problem Alpsoandso NVIDIA Linux 6 05-03-12 06:00 PM
Redhat 8.0 NVIDIA works - INSTRUCTIONS STEEL1 NVIDIA Linux 267 04-15-03 06:48 PM
Unofficial nVidia HOWTO [RPM version] Rob C. NVIDIA Linux 78 04-09-03 07:44 AM

All times are GMT -5. The time now is 01:56 PM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.