When I try to compile the NVkernel, I got this message:
You appear to be compiling the NVdriver 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 and
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.
I would fall for the temptation and set IGNORE_CC_MISMATCH and hope for the best.
My assumption is that the error message is showing that a different version of gcc is used rather than a complet different compiler. You could post gcc version and Linux distribution.