Enable nvidia driver in UEFI mode in Ubuntu 16.04

Solution 1:

As of 18.04 this (installing nvidia driver with UEFI) is done automatically by Device Manager (Read it carefully where it says to type password into MOK to add drivers, on restart. I missed it first time.)

For a DIY version of the same How to install nvidia driver with secure boot enabled? Although you may have to disable nouveau more forcefully by blacklisting it https://gist.github.com/Rambou/c6769caee19b0b9915d8342b86c3ef72

You can check which driver your gpu is using with: sudo lshw -c video which will contain a line that says: configuration: driver=nvidia latency=0 (or will say nouveau instead of nvidia if hasn't succeeded)