Ubuntu 16.04 NVidia Driver works until reboot

9,815

Solution 1

After wasting about 10 hours of my life over this for the past few weeks, I've finally found out what the problem was.

I went back to my original way of installing the driver as in the question.

After powering on my machine, I was in 640x480 mode, so I opened a shell and typed...

> lspci -nnk | grep -iA2 vga

After a fresh reboot it was listing...

bret@bret-Precision-WorkStation-T5500:~$ lspci -nnk | grep -iA2 vga
03:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM107 [GeForce GTX 750 Ti] [10de:1380] (rev a2)
        Subsystem: NVIDIA Corporation GM107 [GeForce GTX 750 Ti] [10de:1380]
        Kernel modules: nvidiafb, nouveau, nvidia_352

After stopping lightdm, re-installing the driver and starting it again, the command output was...

03:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM107 [GeForce GTX 750 Ti] [10de:1380] (rev a2)
        Subsystem: NVIDIA Corporation GM107 [GeForce GTX 750 Ti] [10de:1380]
        **Kernel driver in use: nvidia**

I then remembered what I did when I originally set up the machine with Ubuntu 14.11, I had to blacklist the other two modules by adding...

# Blacklist modules that conflict with NVidia driver...
blacklist nouveau
blacklist nvidiafb

to /etc/modprobe.d/blacklist.conf

Now when I reboot, everything works.

Solution 2

This can happen if you update your nvidia driver and the old one is not completely removed. Have faced this and similar ones many times as I had to install/update/reinstall for Deep Learning,CUDA related work.

Step 1

If you are able to get a command line login via Cntrl +Alt + F1 ( or F2 depending on your Distro) proceed to Step 2.

Else Edit Grub and get into console mode login -- This is the simplest and surfire way

Step 2

Purge current driver on Nvidia driver

sudo apt-get purge nvidia*

Step 3

reboot

Step 4

Check if GUI is working - should work

Else-- Note if you have tried starting GUI from sudo via startx then there would be permission problems, and you need to change the permission of.Xauthority

Step 5

Assuming you are in the GUI or having a network. Install the latest drivers for your card from https://www.nvidia.com/Download/index.aspx. Note sometimes it is better to take a slightly older and more stable version of the driver as the new driver may not work with the old card.

 sudo add-apt-repository ppa:graphics-drivers
 sudo apt-get update
 sudo apt-get install nvidia-430

like - https://medium.com/techlogs/install-the-right-nvidia-driver-for-cuda-in-ubuntu-2d9ade437dec

Step 6

reboot and test using nvidia-smi command enter image description here

That's all should solve your problem. If you are having the same problem then try to install a lower more stable version of the driver. For example, I first tried with nvidia-430 and it did not work then tried with nvidia-410 and it was fine.

Share:
9,815

Related videos on Youtube

BretC
Author by

BretC

I've been mucking about with computers for over 30 years now. My first computer was a commodore VIC 20, moved on to a speccy then a BBC model B, then an A3010 Archimedes then the eventual PC/Linux stuff. I haven't touched an assembler for years, but could probably still get away with some 6502 or ARM assembly. For example, calling A90720EEFF makes a BBC B go "beep". Learned C/C++ when I was younger and then moved on to Java at Univeristy and most of the work I've had since my career started has involved Java in some way. I've worked in lots of different industry sectors (payment systems, certification, finance, online gaming, travel). These days, I'm contracting specialising in Java and Oracle Coherence. Apart from being a techie I also do other stuff, but I won't bore you!

Updated on September 18, 2022

Comments

  • BretC
    BretC over 1 year

    I am currently having problems with my Nvidia driver after upgrading Ubuntu to the latest version. I get 640x480 and a log-in loop.

    If I drop to a shell and re-install the driver by executing these commands:

    sudo service lightdm stop
    sudo bash NVIDIA-Linux-x86_64-367.44.run
    

    I can do...

    sudo service lightdm start
    

    And everything works again - full resolution, can log in.

    After rebooting, I end up with 640x480 and the log in loop again.

    I am sure when I originally set up the machine a few years ago, I had to do something else, but I cannot remember what it was.

    Any help appreciated.

    The card model is a GeForce GTX 750Ti this looks like the same issue as Login Loop, Video Driver Problem, Reinstalling Driver Fixes until Reboot which has no answer, so I'll keep this question up to date with my progress...

    Update 1

    Followed Graphics issues after/while installing Ubuntu 16.04/16.10 with NVIDIA graphics by doing...

    sudo apt-get purge nvidia-*
    sudo add-apt-repository ppa:graphics-drivers/ppa
    sudo apt-get update
    sudo apt-get install nvidia-370
    sudo reboot
    

    I got some warnings about uninstalling the old driver during the last command...

    WARNING: Your driver installation has been altered since it was initially
             installed; this may happen, for example, if you have since installed
             the NVIDIA driver through a mechanism other than nvidia-installer
             (such as your distribution's native package management system).
             nvidia-installer will attempt to uninstall as best it can.  Please see
         the file '/var/log/nvidia-uninstall.log' for details.
    

    ... and then it outputs some errors like this...

    ERROR: Unable to create '/usr/lib32/nvidia-370/libGLESv1_CM_nvidia.so.370.28'
           for copying (No such file or directory)
    

    ...but it looks like this is due to the uninstall.

    Now after a reboot, I do not get the log in loop, but I still only have 640x480 as the only available screen size

    I'm going round in circles on this one...

    • Pilot6
      Pilot6 over 7 years
      This is a wrong way of installing Nvidia drivers. Install from Ubuntu repos or a PPA.
    • BretC
      BretC over 7 years
      @Pilot6 have tried that (tried quite a lot of things during spare time over the last few weeks), the only way I can get into my desktop at the moment is by doing the above steps every time after a reboot, it's getting annoying... Read hundreds of posts by people with simliar issues...
    • TheWanderer
      TheWanderer over 7 years
    • BretC
      BretC over 7 years
      @Zacharee1 - think I've tried this before too, but I'll go through it again... I'll close this as a duplicate if so, thanks
    • BretC
      BretC over 7 years
      Looks like this user askubuntu.com/questions/755700/… has had the same problem... As there are no answers, I am dreading the nuclear option of "reinstall everything and hope it works" :(
    • MatrixManAtYrService
      MatrixManAtYrService over 3 years
      In my experience (superuser.com/a/1613950) nvida GPU's can "remember" things across the reboot boundary. To be sure you're working with a properly initialized card, either power off and back on, or reboot twice after installing the driver. I know it sounds crazy--but as it turns out it actually is crazy.
  • BretC
    BretC over 7 years
    This jogged my memory... askubuntu.com/questions/35273/… - I also removed a file that was left by an old nvidia v352 driver in modprobe.d - not sure if this made any difference
  • Admin
    Admin over 7 years
    As commented above: This is a wrong way of installing Nvidia drivers. Install from Ubuntu repos or a PPA
  • Josh Desmond
    Josh Desmond about 4 years
    I tried this today (2020-05-06) with Ubuntu 20.04, Kernel version 5.4.0-29, a GeForce GTX 1060 6GB/PCIe/SSE2, and the manually downloaded NVIDIA-Linux-x86_64-440.82.run. So far after reboot nothing seems wrong. --- Note that, to "install the driver", I booted to recovery mode, entered the root shell, navigated to the downloaded driver install file, made the file executable with chmod +x ./NVIDIA-Linux-x86_64-440.82.run, and ran it with the command sudo ./NVIDIA-Linux-x86_64-440.82.run, and then accepted every prompt that came up.