Problem installing Nvidia driver on a real time kernel

Hello,

I have a problem installing the Nvidia driver on my ubuntu precise 12.04. I use a real-time kernel(3.4.9 rtai-686-pae) for my linuxCNC application and the graphics card is GTX 1060.
I was able to install the drivers on the generic kernel but not on the RTAI kernel.

while installing the driver, I get the error saying “Unable to find the kernel source tree for the currently running kernel…”
And next " An error occurred while performing the step: Building kernel modules". See /var/log/Nvidia-installer.log for details"

I need help on installing the Nvidia drivers on the real-time kernel.

Thank you!

You need the matching -devel and -headers packages for that kernel.

Where do I find the matching -devel packages?. And I have installed the right header packages for the kernel

You should find them at the same place where you got the -image and -modules packages from. Otherwise, you’ll have to download the specific kernel sources and compile it yourself.