How to install the latest Nvidia drivers on Ubuntu 16.04 Xenial Xerus - LinuxConfig.org

Большое спасибо за совет

Very big thanks for advise, camrade.

Blade Okelly

this isnt working for me, the installation prompt me to disable UFEI secure, i did disable but the driver is not been used, any idea?

Cédric VAN FRACHEM -> Blade Okelly

If, like me, your are booting with UEFI and do not want to change that (for example because you have a dual boot with an other OS), you have to sign the proprietary modules each time they are recompiled (each time you upgrade your kernel version) so that they are allowed to be loaded in the kernel. This is done in two steps,

  1. The FIRST TIME you need to create a key that you will use for ALL signatures :
    sudo su -
    openssl req -new -x509 -newkey rsa:2048 -keyout UEFI.priv -outform DER -out UEFI.der -nodes -days 36500 -subj “/CN=myself/”

mokutil --import UEFI.der

Then, at reboot time, you will be prompted to type again the password for importing this key in your BIOS. If you are not prompted, you may have to enter the BIOS by using function keys at boot time.

  1. You can sign your nvidia kernel modules (each time they change) by typing :
    sudo su -
    for module in $(lsmod | cut -f 1 -d\ | grep nvidia) ; do echo “checking signature of $module…” ; modprobe $module || ( echo “need to be signed. signing $module…” && /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./UEFI.priv ./UEFI.der $(modinfo -n $(modprobe $module |& sed ‘s/.’"’"’(.)’"’"’.*/\1/g’)) && modprobe $module || echo “failed to sign $module” ) ; done

Then reboot and your modules will be loaded in kernel no problem (and keep this line handy to re-run everytime you see apt-get recompiles your kernel in a new version…

Hope this helps,

Soltiz.

yakoudbz -> Cédric VAN FRACHEM

The script with the for loop didn’t worked for me because $(lsmod | cut -f 1 -d\ | grep nvidia) was giving

nvidia_uvm
nvidia_drm
nvidia_modeset
nvidia

But the driver where named with the driver’s version number

nvidia_375_uvm
nvidia_375_drm
nvidia_375_modeset
nvidia_375

So I did it manually ($(uname -r) gives 4.8.0-30-generic on my machine, change with your version…):

/usr/src/linux-headers-4.8.0-30-generic/scripts/sign-file sha256 ./UEFI.priv ./UEFI.der /lib/modules/4.8.0-30-generic/updates/dkms/nvidia_375_uvm.ko

/usr/src/linux-headers-4.8.0-30-generic/scripts/sign-file sha256 ./UEFI.priv ./UEFI.der /lib/modules/4.8.0-30-generic/updates/dkms/nvidia_375_drm.ko

/usr/src/linux-headers-4.8.0-30-generic/scripts/sign-file sha256 ./UEFI.priv ./UEFI.der /lib/modules/4.8.0-30-generic/updates/dkms/nvidia_375_modeset.ko

/usr/src/linux-headers-4.8.0-30-generic/scripts/sign-file sha256 ./UEFI.priv ./UEFI.der /lib/modules/4.8.0-30-generic/updates/dkms/nvidia_375.ko

yakoudbz -> Cédric VAN FRACHEM

I imported the key in the BIOS correctly but the next step didn’t work for me. If I install the nvidia driver with secure boot unabled, $(lsmod | cut -f 1 -d\ | grep nvidia) ; doesn’t even show anything. If I install it with secure boot disabled, the command you gives a good looking output checking ... but I get the following error when trying to run nvidia-settings:

ERROR: nvidia-settings could not find the registry key file. This file should have been installed along with this driver at /usr/share/nvidia/nvidia-application-profiles-key-documentation. The application profiles will continue to work, but values cannot be prepopulated or validated, and will not be listed in the help text.
Please see the README for possible values and descriptions.

Could you help me please ?

Toralf -> Cédric VAN FRACHEM

Thanks! This really helped me out!

Toralf -> Cédric VAN FRACHEM

Signed up for Disqus just to say THANK YOU! :grinning: Your answer literally saved me after hours of research and wondering why everyone just disables Secure boot …

nixie

This instruction is for driver that available from the depository, but my nvidia driver is not there, I need to get from geforce web site, file ends with .run

Found web instruction that I need ti kill x server first, very confusing, been going around reinstallin ubuntu 16.04 for the third tine now.

YogYog -> nixie

this worked for me 2016-09-12

lolkm -> nixie

Run the following
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update

Then make sure your driver is in the repo example:
apt search nvidia-367

if it is there

sudo apt-get nvidia-367

Mitch -> lolkm

Dude, this needs to be on the forum. I’ve been working with this problem for a long time now, called nvidia and everything (frustrated all the while) and got nothing. This solution worked and made my day. Thanks man.

Jono

Apparently my drivers were already at the latest version (also on 361). But my NVIDIA configuration menu appears to have no configuration files in it, my second monitor isn’t picked up, and my only resolution available is 1024. Any ideas? (I’ve just done a dist upgrade from 15.10 to 16.04) and rebooted twice.