I’m trying to install nvidia driver on Ubuntu Linux 20.

The issue – I’m getting the following error during installation.

If you are using a Linux 2.6 kernel, please make sure you have configured kernel sources matching your kernel installed on your system. If you specified a separate output directory using either the "KBUILD_OUTPUT" or the "O" KBUILD parameter, make sure to specify this directory with the SYSOUT environment variable or with the equivalent nvidia-installer command line option.

Depending on where and how the kernel sources (or the kernel headers) were installed, you may need to specify their location with the SYSSRC environment variable or the equivalent nvidia-installer command line option.

Solutions ( NOT WORKING ) 1. tried to pass the –kernel-source-path option

sudo sh NVIDIA-Linux-x86_64-319.17.run --kernel-source-path /lib/modules/5.11.0-34-generic/build

2. tried setting SYSSRC env. variable

export SYSSRC /lib/modules/5.11.0-34-generic/build
sudo sh NVIDIA-Linux-x86_64-319.17.run

As far I understand it tries to compile the driver against the current running kernel version 5.11.0-34-generic but for some reason it can’t find the kernel.h file or the whole source directory, Maybe I mis-configure something. I also tried cloning the Linux kernel repository, checked out the matching branch and set the –kernel-source-path to this directory but it didn’t work.

Anyone can help please.

Here is the readme file url, http://us.download.nvidia.com/XFree86/Linux-x86_64/319.17/README/index.html