NVIDIA vGPU software graphics driver fails after Linux kernel upgrade with DKMS enabled
Description
After the Linux kernel is upgraded (for example by running sudo apt full-upgrade) with Dynamic Kernel Module Support (DKMS) enabled, the nvidia-smi command fails to run. If DKMS is enabled, an upgrade to the Linux kernel triggers a rebuild of the NVIDIA vGPU software graphics driver. The rebuild of the driver fails because the compiler version is incorrect. Any attempt to reinstall the driver fails because the kernel fails to build.
When the failure occurs, the following messages are displayed:
-> Installing DKMS kernel module:
ERROR: Failed to run `/usr/sbin/dkms build -m nvidia -v 580.65.06 -k 5.3.0-28-generic`:
Kernel preparation unnecessary for this kernel. Skipping...
Building module:
cleaning build area...
'make' -j8 NV_EXCLUDE_BUILD_MODULES='' KERNEL_UNAME=5.3.0-28-generic IGNORE_CC_MISMATCH='' modules...(bad exit status: 2)
ERROR (dkms apport): binary package for nvidia: 580.65.06 not found
Error! Bad return status for module build on kernel: 5.3.0-28-generic (x86_64)
Consult /var/lib/dkms/nvidia/ 580.65.06/build/make.log for more information.
-> error.
ERROR: Failed to install the kernel module through DKMS. No kernel module was installed;
please try installing again without DKMS, or check the DKMS logs for more information.
ERROR: Installation has failed. Please see the file '/var/log/nvidia-installer.log' for details.
You may find suggestions on fixing installation problems in the README available on the Linux driver download page at www.nvidia.com.
Workaround
When installing the NVIDIA vGPU software graphics driver with DKMS enabled, use one of the following workarounds:
- Before running the driver installer, install the
dkms
package, then run the driver installer with the -dkms option. - Run the driver installer with the --no-cc-version-check option.
Status
Not a bug.
Ref. #
2836271