Nvidia driver unable to be installed into the computer (Nvidia Quadro P400)

I am unable to install any nvidia driver into the system (newer or older). The PC is recently installed with Ubuntu last month. I am on Ubuntu 18.04.3 and for my graphics driver, as mentioned in the title and indicated using lpsci | grep NVIDIA

$ lpsci | grep NVIDIA
01:00.0 VGA compatible controller: NVIDIA Corporation GP107GL [Quadro P400] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GP107GL High Definition Audio Controller (rev a1)

nvidia-smi gives me this:

$ nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.

Nvidia X-server options when opened also gave me a blank window with help and exit on it only.

So far, I have tried removing and reinstalling method by:

sudo apt-get purge 'nvidia*'
sudo add-apt-repository ppa:graphics-drivers
sudo apt-get update
sudo reboot

I have also tried going to the Software & Updates > Additional Drivers > selecting one of the Nvidia drivers and applying changes. Oddly, none of the drivers listed there has the “(propietary, tested)” text accompanying it.

I have also tried blacklisting Nouveau and installing Nvidia driver afterwards obtained from the nvidia website (the .run file). At the end of that, I obtained "ERROR: unable to load the ‘nvidia-drm’ kernel module.

None of those have worked.

I am on a machine that also have windows installed (if that’s relevant). I am trying to run R studio with a two monitor setup. Apparently from other posts I found on the internet, the software needs to not use the Nouveau display driver in order to prevent it from crashing constantly which is the problem that I am having currently. However, having to use one of the improperly installed NVIDIA driver would mean not using a second monitor because when I switched into one of those drivers on the Software & Updates > Additional Drivers tab, the second monitor goes black.

I’d appreciate help with this problem. Please do tell me on how I could improve my post.

nvidia-bug-report.log.gz (118 KB)

Please make sure secure boot is disabled.
Please run nvidia-bug-report.sh as root and attach the resulting .gz file to your post. Hovering the mouse over an existing post of yours will reveal a paperclip icon.
[url]https://devtalk.nvidia.com/default/topic/1043347/announcements/attaching-files-to-forum-topics-posts/[/url]

Apologies for the late reply.

I have disabled secure boot using the method 2 on UEFI/SecureBoot/DKMS - Ubuntu Wiki

Upon rebooting, I have made the driver work now. nvidia-smi works. The NVIDIA x-server settings work. The second monitor also works now. I was very cautious on disabling the secure boot but it seems that it is the thing that is disallowing the driver from working.

Is it safe to re-enable the secure boot now? Will it work like this if I re-enable it?

I have also included the bug report on my main post.

If you re-enable secure boot, the driver will fail to load again. To have secure boot enabled, module signing has to be set up. The easiest way would be to reinstall Ubuntu. Enable secure boot, then start Ubuntu and during install, check the option to “Install Third-Party Software”. This will guide you through the module signing setup.

I don’t really need to re-enable secure boot I think so it is fine. I’m asking that for future reference. I should accept your first reply as the answer so thank you for your help!