Failure to configure nvidia-dkms-440 on Ubuntu 19.10 when default compiler is changed

When attempting to run an update on my system today I received an error that the nvidia-dkms-440 package had failed to properly configure. Scanning the log at /var/lib/dkms/nvidia/440.64/build/make.log it appeared that the issue was that the build portion of the configuration was attempting to build the kernel modules with Clang, rather than GCC. For unrelated development reasons I had used the update-alternatives command to specify clang instead of gcc for cc and c++.

Once I realized this I was able to resolve the issue locally by running update-alternatives again to switch back, but I feel I should be able to configure my system defaults without having it negatively impact my video drivers. If the nvidia-dkms-440 package depends on a particular compiler version used to build the kernel, then it should explicitly depend on that compiler and should ensure that it’s used, rather than relying on cc to be pointing to it.

1 Like

Same issue when upgrading nvidia-dkms 440.59 to 440.64 on Arch Linux. With gcc and gcc-libs as of 9.2.0 this works, but the up-to-date version is 9.3.0. I would like to upgrade GCC, but every update that triggers DKMS rebuilds (which are quite frequent on Arch Linux) would need a temporary GCC downgrade to 9.2.0 first. This is awkward.

The clean solution for me would be to rebuild the kernel with the new compiler. Trying that.

Yep, that worked:

  1. Upgraded GCC
  2. Checked out the right kernel package version
  3. Incremented kernel package release number
  4. Rebuilt kernel package (also producing an associated headers package),
  5. Upgraded the system to the rebuilt kernel+headers packages, thereby triggering DKMS rebuilds, no longer a problem with the installed nvidia-dkms 440.59
  6. Upgrade to nvidia-dkms 440.64, again triggering DKMS rebuilds. No problems.

So now my compilers and drivers are up-to-date again.

The downside of course is that compiler upgrades need to be followed by kernel rebuilds.