Nvidia driver not loaded Ubuntu 18.04 with NVIDIA® GeForce® RTX 2070 SUPER™ Max-Q

When I run nvidia-smi I receive the following error:

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

When I run nvidia-settings I receive the following error:

ERROR: NVIDIA driver is not loaded
ERROR: Unable to load info from any available system
(nvidia-settings:11905): GLib-GObject-CRITICAL **: 16:50:01.416: g_object_unref: assertion (184.2 KB) ‘G_IS_OBJECT (object)’ failed
** Message: 16:50:01.418: PRIME: No offloading required. Abort
** Message: 16:50:01.418: PRIME: is it supported? no

Output of dkms status is:

nvidia, 465.19.01: added

I do not have a file under the name /etc/modprobe.d/blacklist-nvidia.conf

The output of lspci -v | grep VGA is:

00:02.0 VGA compatible controller: Intel Corporation Device 9bc4 (rev 05) (prog-if 00 [VGA controller])
01:00.0 VGA compatible controller: NVIDIA Corporation Device 1e91 (rev a1) (prog-if 00 [VGA controller])

The output of prime-select query is nvidia

There is no output to lspci -v | grep 3D

On a Ubuntu only MSI GS66 Stealth
Running Ubuntu 18.04.5 LTS
Kernel: 5.4.0
CPU: Intel® Core™ i7-10750H CPU @ 2.60GHz × 12
Intel Graphics: Intel® UHD Graphics (CML GT2)
Nvidia GPU: NVIDIA® GeForce® RTX 2070 SUPER™ Max-Q
GNOME: 3.28.2

I have attached the bug report nvidia-bug-report.log.gz (184.2 KB)

*** ls: -r–r–r-- 1 root root 0 2021-04-20 16:43:10.471391437 -0500 /proc/version
Linux version 5.4.0-72-generic (buildd@lgw01-amd64-021) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #80~18.04.1-Ubuntu SMP Mon Apr 12 23:26:25 UTC 2021


gcc version 5.5.0 20171010 (Ubuntu 5.5.0-12ubuntu1)


gcc version 5.5.0 20171010 (Ubuntu 5.5.0-12ubuntu1)

Your kernel was build with gcc version 7.5, but your systems default is set to 5.5.
Please set that to 7.5 using update-alternatives and then build and install the nvidia driver via dkms.

Thank you for the quick response! What do you mean install using dkms?

see dkms help
something like:
sudo dkms install nvidia/465.19.01

Thank you so much Mart! This has worked.