Technical Guides

Showing results for 
Search instead for 
Did you mean: 

Installation of NI Device Driver results in "kernel headers not found" error

Installing NI Device Drivers results in an error during "dkms autoinstall" step:
"Your kernel headers for kernel <version> cannot be found at /lib/modules/<version>/build or /lib/modules/<version>/source
You can use the --kernelsourcedir option to tell DKMS where it's located."


NI Linux Drivers use DKMS (Dynamic Kernel Module Support) and the kernel-devel packages to provide drivers built for your system’s kernel version.

This method requires that the kernel version of the system matches the version of the kernel-devel package (to be) installed.

The version of the kernel and the version of the kernel-devel package may become mismatched after a system update:

  • RedHat/CentOS: sudo yum update
  • OpenSUSE: sudo zypper update


By performing a system update, there is a possibility that the kernel (along with the kernel-devel package) may also be updated.
While a new kernel version may be installed, it will not take effect until after a system reboot.
ex: On system (re)boot, an option is provided to the user as to which kernel version to use (typically the latest version is chosen by default)
Note: This ability to boot into different kernel versions is a function of the Linux startup process


If the "dkms autoinstall" step is erroring with "Your kernel headers for kernel <version> cannot be found...", reboot your system and ensure that the latest kernel version is selected.


If a specific kernel version is required, the corresponding kernel-devel package can be installed via:

  • RedHat/CentOS:
    • sudo yum install kernel-devel-<desired kernel version>
  • OpenSUSE:
    • sudo zypper install kernel-devel-<desired kernel version>

Note: You can determine your system’s kernel version using "uname -r" command

Can Wong