[SOLVED] Slackware 14.1 latest Nvidia driver not finding kernel.h file
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Slackware 14.1 latest Nvidia driver not finding kernel.h file
So I've been having some trouble with my current Slackware 14.1 install when trying to install the Nvidia drivers for my GTX 760. The install was initially 14.0, and was upgraded some time ago, mostly flawlessly.
My current steps are blacklisting the nouveau drivers in /etc/modprobe.d, killing X, and running the Nvidia installer (NVIDIA-Linux-x86_64-337.19.run). After agreeing to the terms and telling it to start, I'm presented with this error. The important part part obviously being that "The kernel header file '/lib/modules/3.10.30/source/include/linux/kernel.h' does not exist."
A quick investigation shows the I am definitely running kernel 3.10.30 (or at least according to uname -r), and the folder "/lib/modules/3.10.30/source/" does exist with several sub folders in it. However, none of them are an "include" folder.
A quick search for a nearby include folder found:
Code:
$ find /lib/modules/3.10.30/source -name include
./drivers/staging/tidspbridge/include
./tools/testing/ktest/examples/include
./tools/perf/util/include
./tools/perf/arch/x86/include
./tools/include
but creating a symlink in "source" to those didn't appear to help any.
I've installed the Nvidia drivers on all of this same hardware back on a Slackware 13.37 install (with an older driver) so I'm pretty sure that stuff should all be working. I imaging something either went wrong during the upgrade, or I'm just an idiot doing something wrong. Either way, hopefully someone else has a suggestion for anything I can do to get this running.
Thanks guys, figured it would be something like that. Any idea where the best place is to get that package, and how I would go about installing it? I was looking here, but the only options are for kernel 3.10.17 for Slackware 14.1, or 3.14.3 for Slackware-current. That is, assuming I'm looking for the "kernel-source-<version>_smp-noarch-1.txz" under slackware<version>/slackware/k/.
Use the packages intended for your Slackware version. So you should run a 3.10.17 (not 3.10.30) kernel, then install the corresponding kernel-source.
If you insist on compiling your own kernel, then put yourself the corresponding kernel source (donwloded from kernel.org) in its place, that is to say /usr/src, and make the symlink linux => usr/src/linux-<your version> in that folder.
Shoot, so my best bet here is to upgrade or downgrade my kernel? Could be worse I guess...
Any idea why this might have happened in the first place? I upgraded with the instructions here from a fresh 14 install? It doesn't really matter, I'm just hoping to avoid having it happen again in the future.
no idea how you got to 3.10.30 when slackware 14.1 is on 3.10.17 (from current of the past?)
anyway the nvidia installer needs the kernel source of the kernel that will be running the resulting kernel module
(it needs the kernel headers to be precise but the version must be right, even more so since the kernel checks the module version when loading it)
PS there is a work-around that some distros use, but i advise against it
All right, so now I'm just trying to avoid breaking everything, so bare with me here. I tried downloading the source for my 3.10.30 kernel (ftp://ftp.kernel.org/pub/linux/kerne...3.10.30.tar.gz) and extracting it. I then copied the contents of its "include" folder to /lib/modules/3.10.30/source/include/, but now I get this error when running the Nvidia installer. Am I on the right track here, or should I just bite the bullet and install a fresh kernel?
No one here has any idea which kernel you're booting (generic or huge) from via lilo. Download the one relevant to your needs along with the kernel-modules and kernel-source package.
Install both (don't upgrade). Make sure lilo and friends are all good with it, and reboot into this kernel before running your nvidia installer again.
Disclaimer - As some mentioned, it's easier to use Official
That said, I choose to accept the tradeoffs for compiling my own kernels. nVidia drivers state that they require "fully qualified" kernel source which basically means everything matches as if you had run "make modules&&make modules_install" as well as employing the resulting System.map and boot that kernel. So, why not just do that?
There perhaps aren't as many advantages to "rolling your own" as their used to be but there are still some rather powerful advantages like Low Latency and Scheduling that are kept low to match pretty much all hardware. If you have a decently modern (and well-balanced) box why not take advantage of these options as well as end driver compile problems?
Alien Bob's custom kernel page walks you through step-by-step if you're new to that game.
All right, so now I'm just trying to avoid breaking everything, so bare with me here. I tried downloading the source for my 3.10.30 kernel (ftp://ftp.kernel.org/pub/linux/kerne...3.10.30.tar.gz) and extracting it. I then copied the contents of its "include" folder to /lib/modules/3.10.30/source/include/
That's not what you were told to do.
If you go that way, instead, you should have
in /usr/src, a subdirectory linux-3.10.30 containing the whole kernel-source unpacked from the tarball you downloaded from kernel.org, and a symlink linux => linux-3.10.30
in /lib/modules/3.10.30, the modules of course, and two symlinks: build => /usr/src/linux-3.10.30 and source => /usr/src/linux-3.10.30
All right, I guess the problem here is solved, though perhaps a little overkill. I went with enorbet's solution of building a new kernel (because if I only made easy decisions I wouldn't be here in the first place) and followed the instructions here and everything went pretty flawlessly (besides some stupid mistakes on my part). The kernel build and moved everything where it needed to be and lsmod shows that the nvidia driver is running and the nouveau driver is nowhere to be seen.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.