Nvidia Proprietary kernel module won't compile
I am having a problem that seems to occur sporadically, where I have a custom kernel I build from a tarball I downloaded off kernel.org, 18.104.22.168. It boots smoothly, I have the initrd generated for it, and when I try to install the nvidia driver v256.53 & v260.19.12 it errors. I have gotten it to compile with the same kernel and same configuration before, so I think I missing some piece of software. The error I get is "the source tree is not clean, run make mrproper". When I do that I get an error message saying version.h is missing, the kernel is not configured. SO then I clean the source tree, copy a backup of version.h into the tree, and then I get an error saying the kernel source cannot be found. Every time I have gotten it to build has been right after I built the kernel and not cleaned out the source tree. What am I missing?
Welcome to LQ!
Sounds like you're building your kernel in the wrong directory and
removing your headers or something. Try this kernel guide.
Even after building a custom kernel you can have all original
source, header files, etc as thus:
Your system has many version.h files ...
You should post your /var/log/Xorg.0.log and/or /var/log/nvidia-installer.log so
we can look at the specific error.
I finally got it to work. What I did was backed up the .config file, ran make mrproper, copied .config back into the source tree, ran make prepare then make modules, then I ran the nvidia installer and it worked without a hitch.
You are using some strange commands to build a kernel. There are many files that
come with the Linux kernel source. README in particular is one that you need to
read before going further. With your 22.214.171.124 version kernel you DO NOT run
"make prepare" or "make modules". Where did you even get those ideas? There is
no "make prepare" command and the modules are built with "make".
After unpacking your new kernel source, or patching your old source, you run as
a normal user "make <some_option>config". After configuring the kernel, save
the file, then you run only "make" and "make modules_install" -- and that last
command only if you have configured anything as a module (M) in the kernel.
IF, and that is one big IF, you only did what you wrote in your last post, then
it is a miracle IF you installed the Nvidia driver with a new kernel; because
what you report defies all logic.
Actually, there is *some* logic to what the OP was doing in posts #1 and #3, but between those two posts, the sequence of operations was pretty much all out of whack. As Bruce says, it sort of defies logic, it's something of a fluke that the driver build worked in the end.
Bruce: there is a `make prepare` function with the kernel, all it does is check/refresh/whatever the version files for the kernel (version.h and utsrelease.h) and runs a script called `checksyscalls.sh`. Some old sketchy out-of-tree drivers (like modem drivers) used to suggest running `make prepare` if one was having trouble building the driver due to missing the version.h file. I haven't needed the `make prepare` command in a long time.
To clarify my previous post, "there is no 'make prepare' command listed in the
kernel source README file." It is called by "make" from Makefile when someone
has fubared their config ... which is what he had done.
My point was there is a proper way to build a kernel, and the OP forsook it in
favor of some other method.
If we had actually seen the logs from his fubar, and his kernel source directory,
and his nVidia driver version and kernel version no doubt we would have a little
better idea of the true picture ... but it's miraculously [SOLVED].
As I like to say, "All's well that ends!"
However, one day he might like to build another custom kernel ...
Gotcha Bruce RE the `make prepare`.
yes, I'm happy that it's solved, but you're right, OP will want to get the command sequence sorted out or else will have difficulties of this nature again. :)
I'm sorry for the confusion I created, what I did was for installing the nvidia kernel module only, to build my kernal I unpack it in /usr/src/linux, run make xconfig to configure it, then execute make;make install;make modules;make modules_install. Then I boot the new kernel, run geninitrd and reboot again. After that process is when I would run the NVIDIA installer, and sometimes it would work just fine, and others I would run into the errors I described in my initial post. If you would like I can recreate those errors and post the subsequent logs for your perusal.
YDIW ... still
Now I am certain of your problem. Since my first computer build in 1984
I have seen this problem many, many times. You have failed to read the
instructions and follow them ...
I think we read in the paragraph that begins with:
Do NOT use the /usr/src/linux area!
where you destroyed your headers and created your initial problem.
The kernel README file does not mention an initial ramdisk image. Your "geninitrd"
must obviously stand for "generate initrd", which would mean generate initial ramdisk.
If your / filesystem, or the disk controller that your / filesystem mounts on are built
as modules (M) in your kernel, then you will need an initrd. There are a few other esoteric
options where you would need an initrd. If brenainn requires an initrd, then you must issue
"geninitrd" BEFORE you reboot with the new kernel. If you don't, how will the kernel
have an initrd, and how will it boot if it requires an initrd? Either in your case it does
not require an initrd, or you won't boot the new kernel.
I tried to read about PLD and geninitrd at the PLD website, but their page for English
documentation does not load. The FAQ does not seem to have anything related to a
kernel rebuild. The only other English kernel documentation on the site was out of date.
I don't read or think in Polish so can't help further with that issue.
|All times are GMT -5. The time now is 11:09 PM.|