PDA

View Full Version : problem installing nv kernel for RH kernel 2.4.18_19


Hero_Shema
01-24-03, 01:21 AM
I have a problem with my GeForce4 Ti4600 kernel driver for red hat 8. I'm running kernel 2.4.18-19.0 First, I tried to install the rpm (NVIDIA_kernel-1.0-4191.rh80up_2.4.18_18.8.0.i686.rpm). I got this error:

[modprobe: can't locate module nvidia. Failed to install nvidia.o]

Thus, I figured out It might have been that I needed a specific rpm, a rh80up-2.4.18-19.0 that matches my kernel version, which doesn't exist. So, I tried to install by SRPM (NVIDIA_kernel-1.0-4191.src.rpm). However, I got the following error:

[install: can't stat 'nvidia.o': no such file or directory]



So finally, I tired to install by the tar file (NVIDIA_kernel-1.0-4191.tar.gz). I got so many compilation errors in nv.c!!! The error message was:

[errors in nv.c
make: ***[nv.o] Error1]

Which makes me think may be it has to do with the compiler version. May be I should use the same exact compiler version used to compile my rh kernel to compile the nv drivers!!!

Can any one give me an insight of what is the problem? I've followed the instructions in the nvidia documentation; not very helpful unfortunately

Chalnoth
01-24-03, 02:44 AM
Usually this is because the kernel source is not installed, or at least not installed properly.

First, what I would do is find the kernel-source*.rpm package at Redhat's FTP site. Attempt to reinstall the nVidia kernel source rpm's afterwards.

I had to reinstall the kernel source manually after running the Redhat 8.0 update agent for the first time.

bwkaz
01-24-03, 07:52 AM
The errors you have posted are the result of other errors. i.e., we can see that there was an error in nv.c which prevented nv.o from being built, which caused an "error 1" in make. But without seeing exactly what those errors were, there is no way to find out how to fix them, I'm sure that makes sense.

The problem is very likely that you don't have kernel-source installed or have it installed but not configured. But there's really no way to know for sure without the full error output of make.

Hero_Shema
01-24-03, 02:56 PM
To bwkaz:

Well, there were about 2000 errors in that nv.c file!!!! My guessing is that the functions in the file might be dependent on libraries in the kernel that does not exist for some reason!

to Chalnoth:

What is the kernel source? I have the rh kernel it self installed. Why do I need the source? How would I configure the kernel source and configure it to do what?

Thx in advance folks.

bwkaz
01-24-03, 06:36 PM
If you're getting about 2000 errors, then you almost assuredly don't have kernel-source installed. And incidentally, it's not libraries in the kernel (the kernel doesn't even have libraries as such), it's the definition of various internal-to-the-kernel functions that the nVidia drivers need to be able to get the declarations for. To do this, they need the header files from a configured kernel-source package that matches (version-wise and configuration-wise) the running kernel.

kernel-source should be somewhere on RedHat's FTP site. Get the -19.8.0 version. Once you install it, it will very likely create a /usr/src/linux directory (actually, linux will be a symlink to linux-2.4.18-19.8.0, but that's not important), so cd to that directory. Then, do a cd configs/, and see what's there. Copy the config file that matches your hardware to .., then cd .. and run make mrproper oldconfig dep to do the configuration. It should be all automatic. When you get a shell prompt back, go to the nVidia kernel directory and do a make clean NVdriver, then if that works, do a make install as root.

Hero_Shema
02-01-03, 04:50 AM
Well, I'm following the advice and trying to install the kernel source rpm. I simply used:

rpmbuild --rebuild kernel-2.4.18-19.8.0.src.rpm

I got about zillions of warnings from the compiler + it took too long that I had to kill the process ( i had to go to bed at some point). Many of the warnings were for declared but never used variables, ...etc. I would imagine something like a kernel source is written by pros, and that you shouldn't even see one warning!!! Did I do something wrong or is this normal?

bwkaz
02-01-03, 07:34 AM
What does rpm -qa | grep source tell you? Anything?

jjsimas
02-01-03, 09:26 AM
uhh kernel source is the rpm named something like

kernel-source...x.y.z...rpm

not

kernel...x.y.z...src.rpm

jason

Hero_Shema
02-02-03, 12:21 AM
Ok, so I follwed bwkaz's instructions and every thing went smooth until the part where I need to go to the nVidia kernel directory and do a make clean NVdriver. Make displays the command on the screen (rm -f nv.o os-agp.o .......... nvidia.o). Then, make displays this error message:

make: No rules to make target 'NVdriver'. Stop.

Just in case you want to make sure I did cd to the correct dir, that was:

/usr/src/redhat/BUILD/NVIDIA_kernel-1.0-4191

Any ideas?

bwkaz
02-02-03, 07:48 AM
Oh, yeah. You're using the newer driver. Do a make clean nvidia.o instead; that should work.

Hero_Shema
02-02-03, 06:55 PM
So i did cd to the nVidia kernel directory /usr/src/redhat/BUILD/NVIDIA_kernel***
and typed: make clean nvidia.o
Here's what I got:

In file included from nv-linux.h:24,
from nv.c:14:
/usr/include/linux/modversions.h:1:2: #error Modules should never use kernel-headers system headers,
/usr/include/linux/modversions.h:2:2: #error but rather headers from an appropriate kernel-source package.
/usr/include/linux/modversions.h:3:2: #error Change -I/usr/src/linux/include (or similar) to
/usr/include/linux/modversions.h:4:2: #error -I/lib/modules/$(uname -r)/build/in clude
/usr/include/linux/modversions.h:5:2: #error to build against the currently-running kernel.
In file included from nv-linux.h:83,
from nv.c:14:
/lib/modules/2.4.18-19.8.0/build/include/linux/highmem.h: In function `bh_kmap':
/lib/modules/2.4.18-19.8.0/build/include/linux/highmem.h:20: warning: pointer of type `void *' used in arithmetic
make: *** [nv.o] Error 1

bwkaz
02-02-03, 10:38 PM
You still haven't installed the kernel-source-$(uname -r) package, have you.

You NEED this package installed before the NVIDIA_kernel package will compile!

If you have, then for some reason, there is no build symlink in /lib/modules/$(uname -r), and there is no /usr/src/linux symlink either. You'll need one of those, and it's going to have to point at wherever the kernel sources have been installed to (usually /usr/src/linux-<version>). If that directory doesn't exist, then you haven't installed kernel-source.

Hero_Shema
02-03-03, 12:56 AM
To bwkaz:
ok, this is a little weired! I could swear that I did do the configuration for the config file for the kernel and tried to install the nvidia driver afterwords. Any way, so i did install the kernel source again. Then, I did a make clean nvidia.o, which worked fine. However, When i ran the 'make install' command, I got this:

lib/modules/2.4.18-19.8.0/kernel/drivers/video/nvidia.o: kernel-module version mismatch
/lib/modules/2.4.18-19.8.0/kernel/drivers/video/nvidia.o was compiled for kernel version 2.4.18-19.8.0custom
while this kernel is version 2.4.18-19.8.0.
/lib/modules/2.4.18-19.8.0/kernel/drivers/video/nvidia.o: insmod /lib/modules/2.4.18-19.8.0/kernel/drivers/video/nvidia.o failed
/lib/modules/2.4.18-19.8.0/kernel/drivers/video/nvidia.o: insmod nvidia failed
make: *** [package-install] Error 255

How come!!! The nvidia kernel module came from the source package NVIDIA_kernel-1.0-4191.src.rpm.

What's the deal?

Chalnoth
02-03-03, 02:24 AM
--

bwkaz
02-03-03, 07:41 AM
Originally posted by Hero_Shema
/lib/modules/2.4.18-19.8.0/kernel/drivers/video/nvidia.o was compiled for kernel version 2.4.18-19.8.0custom
while this kernel is version 2.4.18-19.8.0. Arrrgh... I don't like RedHat...

They changed the version info in their kernel-source package. Edit the /usr/src/linux-2.4.18-19.8.0/Makefile, change EXTRAVERSION=-19.8.0custom to EXTRAVERSION=-19.8.0, do a make mrproper oldconfig dep again, change to the NVIDIA_kernel directory, and do a make clean nvidia.o again. That one should work.

Hero_Shema
02-03-03, 09:51 PM
To bwkaz:

rpm -ivh NVIDIA_kernel-1.0-4191.i386.rpm
Preparing... ########################################### [100%]
package NVIDIA_kernel-1.0-4191 is already installed
file /lib/modules/2.4.18-19.8.0/kernel/drivers/video
/nvidia.o from install of NVIDIA_kernel-1.0-4191 conflicts with file from package NVIDIA_kernel-1.0-4191

So I deleted nvidia.o from the lib/modules drivers/video directory. I'm still getting the same message. I couldn't cd into the old nVidia kernel directory to do a make clean nvidia.o as I deleted it accidently :-( SO All I did was deleting the nvidia.o file from the drivers/video directory. What should I do?

bwkaz
02-04-03, 06:52 AM
rpm -e $(rpm -qa | grep NVIDIA_kernel) will probably remove the package that's installed (but you'll want to do an rpm -qa | grep NVIDIA_kernel first, to make sure it isn't deleting anything else by accident -- everything the -qa prints will get removed). Then you can rpm -ivh the .src.rpm and cd back into the right directory.