Nvidia 8.0 driver unable to locate the kernel source openSuse 13.2

Everything was working a couple of days ago. Apparently the installation of virtualbox using zypper somehow (??) resulted in the un-installation of my Nvidia drivers, because now when I run any Cuda code, including the samples, it just fails. So I tried to re-install the Nvidia drivers using the exact same method that was working last Friday.
fourier:~# ./cuda_8.0.61_375.26_linux.run

It asks all the same question it was asking last Friday, but now it says
Installing the NVIDIA display driver…
The driver installation is unable to locate the kernel source. Please make sure that the kernel source packages are installed and set up correctly.
If you know that the kernel source packages are installed and set up correctly, you may pass the location of the kernel source with the ‘–kernel-source-path’ flag.

Of course, the kernel-source is installed on this system, and I’d be pretty surprised if its location had changed, due to the use of zypper to install VirtualBox??:
fourier:~ # zypper se kernel
Loading repository data…
Reading installed packages…

S | Name | Summary | Type
–±-------------------------------±--------------------------------------------------------±-------
i | devel_kernel | Linux Kernel Development | pattern
i | kernel-default | The Standard Kernel | package
i | kernel-default-devel | Development files necessary for building kernel modules | package
| kernel-desktop | Kernel optimized for the desktop | package
i | kernel-desktop-devel | Development files necessary for building kernel modules | package
i | kernel-devel | Development files needed for building kernel modules | package
| kernel-docs | Kernel Documentation | package
i | kernel-firmware | Linux kernel firmware files | package
i | kernel-macros | RPM macros for building Kernel Module Packages | package
i | kernel-source | The Linux Kernel Sources | package
i | kernel-syms | Kernel Symbol Versions (modversions) | package
i | kernel-xen | The Xen Kernel | package
i | kernel-xen-devel | Development files necessary for building kernel modules | package
i | nfs-kernel-server | Support Utilities for Kernel nfsd | package
i | patterns-openSUSE-devel_kernel | Linux Kernel Development | package

So the kernel-source module is isntalled, but I do not know how to query its location. Maybe VirtualBox modved it?

So I uninstalled virtualbox the same way it had been installed, using zypper. This succeeded, but the same error still persists.

I am trying a reboot next. I’ll post back here to let you know if that fixes the problem, but I doubt it. Have already rebooted once after virtualbox install and once more during the foregoing problems. No help from that so far.

I rebooted again, following the virtualbox uninstall, and this did not help.
It still says
Installing the NVIDIA display driver…
The driver installation is unable to locate the kernel source. Please make sure that the kernel source packages are installed and set up correctly.
If you know that the kernel source packages are installed and set up correctly, you may pass the location of the kernel source with the ‘–kernel-source-path’ flag.

I’m not that familiar with OpenSUSE. Since you used a package manager (zypper) to install virtualbox, this process in my experience installs a variety of packages (dependencies) in addition to the specific thing you have asked it to install.

It’s entirely possible that the virtualbox package on OpenSUSE depends on a particular kernel version, and the package manager installed that updated kernel version on your system, as part of installing virtualbox. Package managers usually tell you what they are doing, so if you know what to look for, you could easily spot whether this is happening as a result of your request to install virtualbox. Removing virtualbox later would normally not remove or downgrade the kernel version.

When you have a GPU driver installed, it is keyed (compiled against) a particular kernel version. Updating the kernel version will break the driver install.

Furthermore, the virtualbox dependency would almost certainly not have been on kernel source or headers, just the kernel itself.

My suggestion would be:

  1. Update your kernel version to the latest
  2. Install the kernel development packages for that kernel (e.g., latest version)
  3. Re-try the GPU driver install.