Should I install all gpu drivers from beginning if I have another kernel installed?


I’m a newbie to GPU programming and usage, I was supposed to run a real-time object detection application in a GPU enabled laptop with all drivers installed and working fine with Linux kernel -4.15

I then installed a new kernel 4.20 retaining previous kernel 4.15 where I have GPU enabled.

But when I boot into kernel 4.20 and have nvidia-smi I’m getting this

NVIDIA-SMI has failed because it couldn’t communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running[/code]

nvidia-settings gave me

ERROR: NVIDIA driver is not loaded
ERROR: Unable to load info from any available system

But everything works fine if I boot into previous kernel-4.15. What needs to be done should I follow the steps to install drivers fresh to new kernel 4.20 ?

I have NVIDIA Corporation GP106M [GeForce GTX 1060 Mobile](rev a1)

My GPU with lspci | grep -i nvidia
01:00.0 VGA compatible controller: NVIDIA Corporation GP106M [GeForce GTX 1060 Mobile] (rev a1)

No output with all these commands
dpkg -l | grep nvidia
dmesg |grep NVRM
lsmod |grep nv

You should use the driver package provided by your distro.

The *.run file is offered for experienced Linux users.

And yes, usually you have to recompile NVIDIA drivers for each new kernel but if you use a distro provided driver package everything will be done automatically.