16

I would like to install the latest nvidia driver (367.27) for my GeForce 940MX.

Why I want to switch

Currently, I have 361.42 installed from the official repositories. However, this one has problems with TensorFlow (issue 2810).

What I did

  1. Download the latest driver from http://www.nvidia.com/Download/index.aspx
  2. Close everything, log out, switch to console (Ctrl + Alt+F2)
  3. Shut of lightdm (sudo service lightdm stop)
  4. Execute the downloaded script (sudo sh NVIDIA-Linux-x86_64-367.27.run)

What I expected

I thought this would simply update the driver.

What happened

After accepting the EULA, I got an error. It asked me if I wanted to continue the installation or abort it. I aborted and had a look at the error message:

$ cat /var/log/nvidia-installer.log     
nvidia-installer log file '/var/log/nvidia-installer.log'
creation time: Fri Jul 15 13:41:43 2016
installer version: 367.27

PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

nvidia-installer command line:
    ./nvidia-installer

Unable to load: nvidia-installer ncurses v6 user interface

Using: nvidia-installer ncurses user interface
-> Detected 8 CPUs online; setting concurrency level to 8.
-> License accepted.
-> Installing NVIDIA driver version 367.27.
-> Running distribution scripts
   executing: '/usr/lib/nvidia/pre-install'...
-> done.
-> The distribution-provided pre-install script failed!  Are you sure you want to continue? (Answer: Abort installation)
ERROR: Installation has failed.  Please see the file '/var/log/nvidia-installer.log' for details.  You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com.

How can I fix this problem?

How I rolled back

After ignoring the warning and installing it, I didn't get any graphics. Just a black screen. So I undid the installation:

  1. Press shift while startup
  2. Go into a root shell
  3. Make it writable by mount -o remount,rw / (- is ? and / is - in the american layout)
  4. sh NVIDIA-Linux-x86_64-367.27.run --uninstall
Martin Thoma
  • 19,277
  • I doubt that message indicates a critical error - it seems to continue happily after that using nvidia-installer ncurses user interface (without the 'v6'). Was there anything else in the error message that you remember (did it mention DKMS or signing by any chance?) – steeldriver Jul 15 '16 at 12:13
  • No. In fact, when I continued the installation everything worked. Until I tried to start the GUI again. Then I had no graphics :-/ – Martin Thoma Jul 15 '16 at 12:51
  • That sounds like a different question (compatibility of the particular driver with your graphics card?) – steeldriver Jul 15 '16 at 13:46
  • I downloaded the driver from the nvidia website and I chose the correct graphics card. So compatibility of the driver with the graphics card should not be the problem (I did not uninstall the old nvidia driver ... I'm not sure why I should do this, but some tutorials suggest it) – Martin Thoma Jul 15 '16 at 13:48
  • 2
    Possible duplicate of How do I install the Nvidia drivers?. ppa:graphics-drivers/ppa usually has the latest nVidia drivers though the newest version of the 367 branch is in the official repositories now. – David Foerster Sep 13 '16 at 10:19
  • Any luck since July? I have the same message with Ubuntu 16.10 and driver 375. – user643722 Jan 13 '17 at 18:37
  • 1
    Figures of Ubuntu support. Two years later and no one properly answered you. – mmstick Feb 23 '18 at 04:22

3 Answers3

18

On my system (Ubuntu), the "/usr/lib/nvidia/pre-install" file does nothing except for running exit 1. A comment above the exit 1 says "Trigger an error exit status to prevent the installer from overwriting Ubuntu's nvidia packages."

So, the pre-install script is designed to fail. It only serves to require the user to acknowledge before proceeding. So @steeldriver's comment above, "I doubt that message indicates a critical error" -- is correct.

In my view, this is a confusing way to craft an installer. I would hope that Nvidia could change the script to be more intuitive.

David J.
  • 361
6

On Ubuntu 16.04 (and 18.04, according to comments), I had previously installed nvidia-driver packages, which may have left this file, preventing the installer form running.

My fix to this problem was to rm /usr/lib/nvidia/pre-install, which let the installer continue.

CharlesB
  • 209
0

I just had the same problem (with a GeForce 1060 Mobile), and I fixed it by using the PPA drivers as mentioned in answer: How do I install the Nvidia drivers?

In my case, even after installing the module wouldn't load until I disabled secure boot as indicated here: Why do I get "Required key not available" when install 3rd party kernel modules or after a kernel upgrade?

elias
  • 1,159