Monday, October 05, 2015

Installing Nvidia GTX 950 Drivers in Ubuntu 14.04.3 Linux

STEP 1.

Download the correct nvidia-driver for your Nvidia Graphic Card. You have to pick the right Graphic Card and Operating System (O.S.) (Mine was GTX 950 and LINUX 64-bit).

You can get the drivers at;
http://www.nvidia.com/Download/index.aspx?lang=en-us
If that link fails, just search web for “nvidia download linux".

Once the file is downloaded, you need to Right-click on the file you downloaded and make it Executable.




STEP 2.

Open a TERMINAL Window and type:
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && sudo apt-get install build-essential && sudo apt-get install linux-source && sudo apt-get install linux-headers-generic
 (Hit Enter)


  • That is all one line (cut and paste it all at once)


STEP 3.

It takes some time for STEP 2 to run. When it finishes, type;
   sudo gedit /etc/default/grub 
   (Hit Enter)


  • This opens the file grub in GEDIT as root.  Use gedit to change the line that has;

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"

  • Replace it with; 

GRUB_CMDLINE_LINUX_DEFAULT="nouveau.blacklist=1 quiet splash nomodeset"

  • This forces putty to use low-level graphics mode to get rid of the Blank Black Screen.


Once you've made the change to the grub file, you just save it in GEDIT
FILE-->SAVE

  • remember where you save this file too.

After saving the grub file, with the changes, close GEDIT.

Now back in the TERMINAL Window type;
   sudo update-grub2
   (Hit Enter)


STEP 4.

Type;
   sudo apt-get remove nvidia* && sudo apt-get autoremove
   (Hit Enter)

  • This uninstalls any previous version of the Nvidia drivers
Type;
   sudo reboot 
  (Hit Enter)

  • This resets (reboots) your computer


Step 5.

Once the computer reboots open a TERMINAL Window and type;
    sudo gedit /etc/modprobe.d/blacklist.conf
   (Hit Enter)

add these lines to the end:
blacklist vga16fb
blacklist nouveau
blacklist rivafb
blacklist nvidiafb
blacklist rivatv
blacklist lbm-nouveua
options nouveau modeset=0
alias nouveau off
alias lbm-nouveau off



Once you've made the change to the blacklist.conf file, you just save it in GEDIT
    FILE-->SAVE
After saving the blacklist.conf file with the changes, close GEDIT.


STEP 6.

Open a PUTTY-TERMINAL by pressing Ctrl + Alt + F1
Once TERMINAL opens type;
    sudo service lightdm stop 
    (Hit Enter)

  • This stops graphic the session so we can now install the new drivers.

type;
    cd Downloads
    (Hit Enter)

  • This assumes you downloaded your nvidia-file to the DOWNLOADS directory.  Adjust as needed

type;
     sudo ./NVIDIA-Linux-x86_64-355.11.run
    (Hit Enter)

  • Your NVIDIA-Linux-x86_64-355.11.run file may have a different name, just substitute it for mine
  • Follow the onscreen installation instructions (normally YES to all questions)


SPECIAL STEP (Skip this step usually)

  • Type: sudo nvidia-xconfig (Hit Enter) only if you did not chose “yes” to this in the installation 



STEP 7.

Still in the TERMINAL type;
   sudo reboot
   (Hit Enter)

Once your machine restarts, type;
   sudo gedit /etc/default/grub 
   (Hit Enter)

This opens the file grub in GEDIT as root.  Use gedit to change the line that has;
GRUB_CMDLINE_LINUX_DEFAULT="nouveau.blacklist=1 quiet splash nomodeset"
Replace it with;
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nomodeset"

  • This puts back what we did in STEP 3.

Once you've made the change to the grub file, you just save it in GEDIT
     FILE-->SAVE
After saving the grub file with the changes, close GEDIT.


STEP 8.

Back in TERMINAL type;
   sudo update-grub2 
   (Hit Enter)

Last one type;
   sudo reboot
   (Hit Enter)



You are DONE!!!!  
If all went well you now have Priority Nvidia Drivers installed and working.  The bad news is that every time your Linux Kernel gets updated you have to reinstall your Nvidia Drivers.  To do this reinstall, I just completed the instruction in STEP 6 only.  This worked for me.   I guess you could try doing STEP 4 first then STEP 6. if STEP 6 only didn't work.  I hope this helps and it should work for Nvidia GTX 750ti, 950, 960, 970, 980, Titan X.

On my system when my Kernel Updates I get stuck at the logon screen.  To reinstall your Nvidia Drivers you have to open a PUTTY-TERMINAL by pressing Ctrl + Alt + F1. This will open a TERMINAL Window to get you started.

UPDATE*** On the first Kernel Update I had to reinstall the Nvidia Driver but the second kernel update I did not.

If this method is not working for you or you don't want to try the "Manual" method, try this link to an article on WEB UPD8 which uses a PPA.

22 comments:

Anonymous said...

It works! Thnx!

Jeff M. said...

Good to know that it helped someone else too

Bob said...

Your instruction work like a charm UNTIL I get to the last command trying to run "NVIDIA-Linux-x86" command. I'm IN Downloads, I type it in perfectly, and it says it can't find the command, even though I check and it is definitely IN Downloads, spelled correctly, etc. So I never get to answer yes to all the questions. Furthermore, I'm still in Downloads (no instructions to leave) and trying the special step doesn't work (after all, I didn't get to answer yest to anything) because it can't find that command either.

Am I missing something? I've been going round and round with this thing for a week. I have two GTX 980s just sitting in that box, doing nothing. I want to use them on Folding@Home, but without the right drivers installed, the Client Ap won't recognize the cards. I used the version UR using (55.11) because the newest driver is reported by many as unstable, probably machine by machine.

I have the exact same version of Ubuntu you list. It puzzles the hell out of me.

Bob said...

One other thing. Once you're in that putty screen, it seems like after changing to Downloads directory many commands somehow get forgotten, because they aren't in that directory. How do you get back to the directory/folder you came from b4 changing to downloads?

Jeff M. said...

Bob,

I have three suggestions;

1. Take special note of the PERIOD after the SUDO and before the "/" in the command in Step 7 maybe it got left out ---- sudo ./NVIDIA-Linux-x86_64-355.11.run

2. Look at the pictures I've post in Step 1 in reference to "Once the file is downloaded, you need to Right-click on the file you downloaded and make it Executable." I did not explain that very well but the pictures show the process. If you do not make the file "NVIDIA-Linux-x86_64-355.11.run" executable it won't run and Step 7 will fail.

3. When I downloaded and extracted the Nvidia Drives they were saved in a folder in my Downloads directory. I copied the NVIDIA-Linux-x86_64-355.11.run file from this directory and pasted it in the Downloads directory itself to make it easier to get to. The folder (directory) that was created during the extraction process had the same name as the file I think. This may be your problem you are trying to "Run" the folder instead of the file with the same name that is inside the folder.

I hope one of these answers works for you and I hope this reply finds you. I too thought I'd be stuck with an expensive video that would be no better than onboard graphics. I've had to use the instructions I've posted about 3 times now as sometimes Kernel updates break the video driver.

Bob said...

Thanks, Jeff. I DEFINITELY had the period there, in front of the slash. I tried it both ways. I thought that maybe the period was supposed to represent the entire path for for the Downloads directory. Didn't try it that way; but I'll check to see if there is a subdirectory in Downloads designated the same as the run file, which IS in Downloads. I even put the file on my Desktop, but to no avail, so far.

I'll keep banging away at it. I had 193MB of disk space just cluttered with drivers. So at least those are gone now.

With regard to the Putty terminal, as I said, it seems like if I'm in the downloads directory the thing loses all track of commands it new when I was in whatever directory I start out in. This is different from the old DOS I used to be pretty good at.

Thanks.

Bob said...

Jeff:

I KNEW you were one of the knowledgeable and GOOD ones. I believe I have come across what was wrong with my attempts to follow your instructions. I THINK/believe that your instruction did not take into account the effects that encrypted partitions, files, and folders might play in things like those you were attempting to help me accomplish.

Since I last posted here, I uninstalled the version of Ubuntu I was using (14.04.4--I think it was) and went to one of the earliest versions of Mint (17.1--Rebecca, I believe), and started taking a careful look at the FILE/FOLDER "Tree." If you recall, I was asking things equivalent to "why is it that when I "cd" (change directory) it seems like all the commands go away?" I think I discovered why in "Rebecca."

I kept wanting to use the mouse to copy and paste (as in Windows), and it wouldn't work. Copy in Linux commands and syntax means, ALREADY, "Copy to." There is NO paste in Linux grammar and syntax, they're inseparably linked. This all came to a head when I was trying, as "root" (with ALL POSSIBLE powers and privileges) to use the Terminal to overcome the mouse restrictions in Mint. I don't think the mouse is restricted, I think those file domains are just separated in Mint. I'll soon see. Thanks for your help.

Bob said...

By the way, the examination of the tree, under Mint 17.1, left me with the same problems I had under Ubuntu. When I tried to share certain folders, they wouldn't share. I wasn't playing close attention then, but I believe the same error message came up (with Ubuntu as came up in Mint 17.1), having to do with the parentheses, I'm about to use, and everything within them, and it read something like this: error, rule violation, names of shared file/folders cannot include any of the following symbols: (!@#$%^&*~`+='";:,.?/|). You'll note that the minus sign (hyphen) is not included therein, nor is the underscore. But the things I was trying to share didn't include any of those symbols. That tells me that, beyond just displaying a name on the screen, what the file management system tries to read has nothing to do with what is on the screen. The file management system is running into encryption. At least I believe so. I'll let you know.

Bob said...

Oops! Sorry. I don't think I should have included the period up there, with all the restricted symbols. But I hope you're getting what I'm attempting to convey.

Bob said...

Wow. Thanks a lot Jeff. You know why it wasn't working for me. Of course I couldn't copy and past in that putty window, and I was typing everything PERFECTLY into that window, except like a moron I forgot to copy the ".run" onto the paper I was using. It works now. Thanks again.

Jeff M. said...

Bob,

Glad you solved it. Way to stick with it too!

and Thanks for the update

Unknown said...

Jeff,

After step6, when I reboot I immediately get stuck at the logon screen.
In the putty terminal gedit doesn't work anymore either. I can still log in inthe putty terminal. I re-installed the NVIDIA driver following the exact steps but no fixes were made.
I have the same Ubuntu distribution 14.04 and GTX 950M, but I realized that the driver I installed was NVIDIA-Linux-x86_64-349.run. Do you have any ideas on how to fix this problem?

Unknown said...

Also whenever I try to open gedit or synaptic, I get an error saying XDG_RUNTIME_DIR not set in the environment.

Jeff M. said...

Michael Parker, Try using the 'vi' editor in place of gedit. You will have to read about the vi command and its use as I don't know it very well.

Jeff M. said...

Michael Parker, Also the newest NVIDIA Driver is NVIDIA-Linux-x86_64-361.45.11.run You might try downloading and running that file (make sure you make it executable after downloading (STEP 1)).

My Kernel Updated today and I was stuck in Putty and followed the instructions today and they worked for me with the newest driver. The first time i tried it did not work but once I made the NVIDIA-Linux-x86_64-361.45.11.run file executable it worked.

Unknown said...

Thank you so much!
I have been trying since long time but your blog helped me.
It works fine ....:)

Jeff M. said...

IF YOU ARE HAVING TROUBLE GETTING YOUR NVIDIA CARD TO WORK WITH THIS METHOD, you can try this WEB UPD8 article

http://www.webupd8.org/2016/06/how-to-install-latest-nvidia-drivers-in.html

Which uses a PPA to update your drivers. Be sure to read the warnings before adding the PPA to your updates. I have not used this PPA but only because I got my card working with my method. This PPA Method is just two steps. Good Luck.

Bob B said...

Jeff:

I want to compliment you on the continuing excellence of this post. I just started with Mint 18.2, and it still works. The main difference now is the "gedit" is no longer a viable command. One can still accomplish the same thing, it's just that the "grub" file needs to be tracked down in the Directory Tree (as I still call it), then open the file as root.

For "grub" in 18.2, I believe the wording to change lacked the "no mode set," but I replaced it with the recommended wording, unchanged. It worked fine. When I go back to change it again, I'll just delete the "no mode set," since it wasn't part of the original.

Also, with Mint 17.3, the correct command for loading the driver ended up being in the Downloads directory, but "sh ~./Downloads/NVIDIA" etc. In fact, I think it can even be shortened, so long as the only NVIDIA driver one has in Downloads (of course it still must be made executable prior to loading) is "sh ~./Downloads/NVIDIA-Linux-*.run". Other than those minor changes, which were easy enough to discern from your original posting, this is still the best way I've found to make sure I don't forget anything. BRAVO!!

Bob B said...

Jeff:

Sorry, in the last post I didn't specify one thing. In the ultimate sentence, I posted ". . . , so long as the only NVIDIA driver one has in Downloads (of course . . .)" without finishing which driver that might be. It should have read " . . . , so long as the only NVIDIA driver one has in Downloads IS THE DRIVER ONE WISHES TO USE (OF COURSE IT STILL MUST . . .) If there is any other NVIDIA driver in Downloads, or wherever, the shortened command will not work, or at least I don't believe it will.

Bob

Bob B said...

Sorry Jeff:

Just one more comment. I learned a long time ago that if you are trying to install a driver from NVIDIA (probably any other, as well) that when you go into the putty screen, you have to type "sudo service mdm stop", because for Mint the display MANAGER is "mdm", not "lightdm". And, of course, the way to get back out of the putty screen is always to restart the display MANAGER with "sudo service mdm start", or "lightdm" if in Ubuntu.

Bob

Bob B said...

Sorry Jeff:

I was making many, inapplicable assumptions when I posted the previous stuff. Your original post is still great for updating everything, before going to the update manager. However, Linux 18.2 Cinnamon is a nightmare. I'm currently stuck in an endless loop wherein I can't be root in the putty terminal and open the proprietary driver from NVIDIA.

I can be IN the Downloads directory, make myself root, and even though I am still in the Downloads directory, and the NVIDIA driver is executable, what I'm now instructed is the correct command "sh ./Downloads/NVIDIA-*.run'. I'm only using that as an example, even if the entire name is typed out, flawlessly, for some reason root is unable to give the command to open or run that NVIDIA file, as if it can't even be seen.

Now, of course, you can try it in the regular terminal, which is fine until you turn off "lightdm" which is now the driver for Mint 18.2 Cinnamon, which will take you directly back to the totally useless Putty terminal. Round and Round, and nobody has mentioned this in any postings I can find. Maybe I'll switch back to an earlier driver--it just changed in the last day or so.

Just thought I'd let you know so that the misinformation I posted doesn't stay up for long. I'll let you know if I find out a solution to this mess. Thanks.

Bob B

Bob B said...

This is the command for finally loading the NVIDIA driver in Mint 17.3.
" sudo sh ~/Downloads/NVIDIA-Linux-*.run "
I could never remember it, so I put it in a doc. made the letters big, and stuck it on my wall!

Bob B : - )