Cannot install nvidia driver for ubuntu 14.04

11,529

First of all I suggest removing all nvidia drivers.

sudo apt-get purge nvidia*

For Ubuntu 14.04 the default and preferred driver is nvidia-331.

It can be installed by

 sudo apt-get install nvidia-331

As an option you can upgrade kernel and install newer drivers.

Upgrade kernel to 3.19

sudo apt-get install linux-generic-lts-vivid

reboot

Then install nvidia-346 from xorg-edgers

sudo add-apt-repository ppa:xorg-edgers/ppa
sudo apt-get update
sudo apt-get install nvidia-346 nvidia-prime nvidia-settings
sudo add-apt-repository -r ppa:xorg-edgers/ppa

Look for errors when install. In most cases the driver works well, but it depends on graphical stack version installed, your integrated adapter model, etc.

If the driver does not work and graphics does not start, press Ctrl+Alt+F1, login to console and run

sudo apt-get purge nvidia*
Share:
11,529

Related videos on Youtube

Jame
Author by

Jame

Updated on September 18, 2022

Comments

  • Jame
    Jame over 1 year

    I am using Ubuntu 14.04 (64 bit) with kernel version is 3.16.0-40-generic. And my nvidia is

    01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK107M [GeForce GT 650M] [10de:0fd1] (rev a1) (prog-if 00 [VGA controller])
    Subsystem: Samsung Electronics Co Ltd Device [144d:c0d1]
    Flags: bus master, fast devsel, latency 0, IRQ 16
    Memory at f6000000 (32-bit, non-prefetchable) [size=16M]
    Memory at e0000000 (64-bit, prefetchable) [size=256M]
    Memory at f0000000 (64-bit, prefetchable) [size=32M]
    I/O ports at e000 [size=128]
    Expansion ROM at f7000000 [disabled] [size=512K]
    Capabilities: <access denied>
    Kernel driver in use: nvidia
    

    That mean it is GeForce GT 650M. Hence, I went to nvidia search to check which nvidia is good for my laptop. I found version 346.72. However, when I install it. I cannot log-in my computer. It allway repeat log-in screen when I login. I need to uninstall it. Then it can log-in again. What is my problem? How to resolve it? I also tried do with other method such as

    $ sudo add-apt-repository ppa:xorg-edgers/ppa -y
    $ sudo apt-get update
    # install the latest version
    $ sudo apt-get install nvidia-current
    

    But it shown that (Note that I install 304 version before but I uninstall it)

    nvidia-current is already the newest version.
    You might want to run 'apt-get -f install' to correct these:
    The following packages have unmet dependencies:
     cuda-drivers : Depends: nvidia-340 (>= 340.29) but it is not going to be installed
                    Depends: nvidia-340-dev (>= 340.29) but it is not going to be installed
                    Depends: nvidia-modprobe (>= 340.29) but it is not going to be installed
                    Depends: libcuda1-340 (>= 340.29) but it is not going to be installed
                    Depends: nvidia-libopencl1-340 (>= 340.29) but it is not going to be installed
                    Depends: nvidia-opencl-icd-340 (>= 340.29) but it is not going to be installed
     nvidia-340-uvm : Depends: nvidia-340 (>= 340.29) but it is not going to be installed
    E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
    

    Update error: When i tried to uninstall current nvidia and install new nvidia 331 version it shown as

     Error! Bad return status for module build on kernel: 3.19.0-20-generic (x86_64)
    Consult /var/lib/dkms/nvidia-331/331.113/build/make.log for more information.
    
    Setting up nvidia-331-uvm (331.113-0ubuntu1~xedgers14.04.1) ...
    Loading new nvidia-331-uvm-331.113 DKMS files...
    First Installation: checking all kernels...
    Building only for 3.19.0-20-generic
    Building for architecture x86_64
    Building initial module for 3.19.0-20-generic
    Error! Bad return status for module build on kernel: 3.19.0-20-generic (x86_64)
    Consult /var/lib/dkms/nvidia-331-uvm/331.113/build/make.log for more information.
    Setting up nvidia-opencl-icd-331 (331.113-0ubuntu1~xedgers14.04.1) ...
    Setting up nvidia-prime (0.6.2) ...
    nvidia-prime start/running, process 13152
    Setting up nvidia-settings (352.09-0ubuntu0~xedgers14.04.1) ...
    Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
    Processing triggers for ureadahead (0.100.0-16) ...
    

    After remove all nvidia, I typing sudo ubuntu-drivers devices it shown

    ~# sudo ubuntu-drivers devices
    == /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
    modalias : pci:v000010DEd00000FD1sv0000144Dsd0000C0D1bc03sc00i00
    model    : GK107M [GeForce GT 650M]
    vendor   : NVIDIA Corporation
    driver   : nvidia-349 - third-party free
    driver   : nvidia-352 - third-party free recommended
    driver   : nvidia-331 - third-party free
    driver   : nvidia-340 - third-party free
    driver   : nvidia-346 - third-party free
    driver   : xserver-xorg-video-nouveau - distro free builtin
    driver   : nvidia-331-updates - distro non-free
    driver   : nvidia-304-updates - distro non-free
    driver   : nvidia-304 - third-party free
    

    After reinstall ubuntu, I based on the suggest of Plo.. I think I install successfull by checking

    $lspci -knn | egrep 'VGA|3D' -A2 
    or Graphics Controller [8086:0166] (rev 09)
        Subsystem: Samsung Electronics Co Ltd Device [144d:c0d1]
        Kernel driver in use: i915
    --
    01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK107M [GeForce GT 650M] [10de:0fd1] (rev a1)
        Subsystem: Samsung Electronics Co Ltd Device [144d:c0d1]
        Kernel driver in use: nvidia
    
    • Jame
      Jame almost 9 years
      How to remove 316 kernel by terminal? And version of nvidia is 331 or 346? Thanks
    • Pilot6
      Pilot6 almost 9 years
      You do not need to remove kernel. You can boot to any installed kernel using grub menu. So boot with 3.16 and install 331 driver, that is default in ubuntu. Check if it works. What is grub menu and how to get there you can find by using search.
    • Jame
      Jame almost 9 years
      Of course, I choose newest kernel. I removed all nvidia kernel by your command. But when I typing sudo ubuntu-drivers devices it show as in updated question. That mean it does not remove succesfull, Right?
    • Pilot6
      Pilot6 almost 9 years
      My command does not remove kernel. It removes driver. It seems that you do not understand my posts. Do you see difference between kernel and driver? If not, I suggest re-installing the system from scratch and trying to install default nvidia-331 and do not touch kernel at all.
    • Jame
      Jame almost 9 years
      Sorry. It is driver. I missing typing
    • Jame
      Jame almost 9 years
      Sir, could you tell me version 331 or 346 is good for me?
    • Pilot6
      Pilot6 almost 9 years
      The one that works is good for you. Both work for ME. Does any work for you?
    • Jame
      Jame almost 9 years
      Thank. I reinstall ubuntu and it work now. When I check, nvidia 331 is installed. How to know it is install successful?
    • Pilot6
      Pilot6 almost 9 years
      Run lspci -knn | grep VGA -A2, if it shows "Kernel driver in use: nvidia", then it is OK.
    • Jame
      Jame almost 9 years
      Good job. It show as Kernel driver in use: i915 Thanks so much
    • Pilot6
      Pilot6 almost 9 years
      i915 is for Intel. Post full output of lspci -knn | egrep 'VGA|3D' -A2
    • Pilot6
      Pilot6 almost 9 years
      Now it looks good
    • Jame
      Jame almost 9 years
      Thanks for your help. I cannot upvote your answer because I have no score
    • Pilot6
      Pilot6 almost 9 years
      Please do not add [solved] to question titles. I removed it.
  • Jame
    Jame almost 9 years
    Thank Pilot6. I tried with first command to remove nvidia in Ctrl+Alt+F1 but it shown as link dropbox.com/s/o07xy9isag8w56k/log?dl=0
  • Pilot6
    Pilot6 almost 9 years
    So run sudo apt-get install -f
  • Jame
    Jame almost 9 years
    Thanks. I followed your steps by step but when I login, the screen is black. I must goto Ctrl+Alt+F1 to remove all drive and it can login again. I upgrade my linux kernel to 3.19
  • Pilot6
    Pilot6 almost 9 years
    Do not install nvidia-current. It is for old adapters. You can install either a default nvidia-331, or nvidia-346 from the ppa.
  • Jame
    Jame almost 9 years
    Yes. I just debug. Because when I install newest version of nvidia. I cannot login. However, when i type ...nvidia-current. It install 304 version and i can login. I upgrade my linux version to 3.19.0-20-generic
  • Pilot6
    Pilot6 almost 9 years
    Try to remove nvidia-current and install nvidia-331.