I took a different approach and attempted to install the driver using the run command instead of the nvidia installer (posted in the README of the driver) and this is the output:
You Appear to be compiling the Nvidia kernel module with a compiler different from the one that was used to compile the running kernel. This may be perfectly fine, but there are cases where this can lead to unexpected behaviour & system crashes.
If you know what you are doing and want to override this check, you can do so by setting IGNORE__CC__MISMATCH.
In any other case set the CC environment variable to the name of the compiler that was used to compile the kernel.
How would I go about doing the last item mentioned, setting the CC environment variable??
Should I give up or anyone have any ideas??