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
  • 20,535

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,149