I am using Fedora 35 with a GeForce RTX 3070.
This issue seems very similar to nvidia installer can't find stdarg.h · Issue #6 · NVIDIA/nvidia-installer · GitHub, so I am going to try answering the questions from there.
It is rather unlikely that my compiler install is corrupted, compiling any other software (including the current stable driver, version 510.54) works.
/usr/bin/cc points to /usr/bin/gcc (v. 11.2.1).
This issue persists across multiple different kernel versions, and regardless of whether or not I build with DKMS (attached logfiles are from a non-DKMS build).
A logfile from a normal build looks like this:
nvinstall-normal.log (286.0 KB)
If I create a symlink to stdarg.h and stddef.h in the kernel’s include directory, the include errors go away. Instead, I get symbol redefinition warnings (those go away when I replace the symlinks with empty files) and other errors inside some macro expansions (see the end of the logfile for the symlink build).
A logfile from a build using symlinks in the kernel’s include directory looks like this:
nvinstall-symlinks.log (1.6 MB)