View Full Version : NVIDIA_kernel with gcc 3.2 based linux kernel
Since installing a new redhat beta, I've found myself left with the stock XFree86 nvidia driver.
This is due to NVidia releasing a binary-only version of their kernel module which was compiled under something less than gcc 3.2. Gcc 3.2 introduces a slew of changes, the most notable one is that it isn't backwards compatible with pre 3.2 compiled code. So, unless someone privledged with the source code recompiles the driver, I'm stuck.
Anyone have an idea when we can expect an updated driver?
Thunderbird
08-20-02, 02:04 AM
That backwards compatibility that doesn't work is mainly for C++. Did you already try to compile the nvidia kernel module from "source"? (it is partly opensource mainly the "glue")
After doing a rpmbuild --rebuild NVIDIA_kernel-1.0-2960.src.rpm, I try to install it:
[root@localhost i386]$ rpm -ivh NVIDIA_kernel-1.0-2960.i386.rpm
Preparing... ########################################### [100%]
1:NVIDIA_kernel ########################################### [100%]
/lib/modules/2.4.18-11/kernel/drivers/video/NVdriver: The module you are trying to load (/lib/modules/2.4.18-11/kernel/drivers/video/NVdriver) is compiled with a gcc version 2 compiler, while the kernel you are running is compiled with a gcc version 3 compiler. This is known to not work.
/lib/modules/2.4.18-11/kernel/drivers/video/NVdriver: insmod /lib/modules/2.4.18-11/kernel/drivers/video/NVdriver failed
/lib/modules/2.4.18-11/kernel/drivers/video/NVdriver: insmod NVdriver failed
Compiling from the source does the same thing.
The 2.4.18-11 kernel is actually something like 2.4.19-pre10-ac2, which ships with the (null) redhat beta. I imagine the 2.4.19 will be the basis for the next public offering from redhat and will be compiled with gcc 3.2 as well.
do a /cat/proc/version, and look at the compiler version, redhat is know to use
a different compiler for kernel compiles than the installed system compiler.
if that's the case, compile the kernel on your own, or compile the driver with the
version you got from the command.
do a websearch for gcc 2.96 redhat and kgcc, even linus (who says almost nothing about
distributions) was, errm "not amused")
HTH
Please re-read my previous post.. The kernel IS compiled with gcc 3.2. This is not a case of regarding the 2.96.x compiler issues.
I know I could just reinstall an older version of gcc, recompile the kernel, and get on with my life, but the fact is that things are moving forward. Vendors are retooling their OS's with more current technology. For vendors who supply binary-only software, they could get caught up in the mix of needing to revamp their product as well.
I read all the post above more than just carefulle, but havn't seen the place
which says the kernel was compiled with gcc 3.2. (not looked at the rpm sequence) :D
but have you compiled the driver as Thunderbird suggested?
Thunderbird
08-20-02, 10:44 AM
You will have to wait for nvidia to release something new I think. Parts of the kernel module are gcc 2.x that causes the problem. Normally you don't compile a kernel using gcc 3.x. It doesn't really create faster C code than 2.x. For c++ code it is a big improvement.
Thunderbird: it compiles with gcc 3.2 without a hassle, just confirmed it on my own machine.
my last setup was completely gcc 3.x build, but one of my harddisks blew off, before I had
any chance to make a backup :(
cheers
Thunderbird
08-20-02, 11:16 AM
I think the solution to the problem might be very easy then. I think he re-used the nvidia kernel module source of a kernel module he compiled for his previous kernel. When redoing make in the dir something like "make clean" doesn't happen. To really recompile the kernel module you should remove all object files (.o files) and the NVdriver and another file (don't know the name by head).
I thought that also, _but_ he did a rpm build... seems that redhat still ships with
different compilers. rpm --rebuild _should_ use just the gcc in the path.....
maybe it would work if he would "export CC="gcc -V 3.2" prior the build
as I did, because my default compiler is still 2.95.x
_redhat_ grrr (without running into a flame war, I hope)
I agree that it will compile just fine. Note that nvidia supplies a file called Module-nvkernel in their srpm and tgz files. This is their binary kernel module, and is not recompilable by the end user. Like thunderbird said, the opensource part of the driver is the 'glue', not the guts.
To see the error I'm getting, compile your kernel with gcc3.2, install it, and try to load the binary nvidia module. You'll get the same error message I posted above. Or, you could install the latest redhat beta called (null) and have an identical install base to what I'm using. (null) will probably be released as Redhat 8.0 in the coming month or two.
All of my work is being done with a freshly installed system and newly downloaded files. There isn't a chance of a tainted build here from leftover files.
Further evidence of the compiler version:
root@localhost [116]# rpm -qa|grep gcc
gcc-java-3.2-1
gcc-gnat-3.2-1
libgcc-3.2-1
gcc-g77-3.2-1
gcc-c++-3.2-1
gcc-3.2-1
root@localhost [119]# gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --disable-checking --host=i386-redhat-linux --with-system-zlib --enable-__cxa_atexit
Thread model: posix
gcc version 3.2 (Red Hat Linux Rawhide 3.2-1)
To catch other possible questions, cc is symlinked to gcc by default and there is no kgcc.
I can confirm that the NVidia module works perfectly with a gcc 3.2 compiled kernel and module:
$ cat /proc/driver/nvidia/version
NVRM version: NVIDIA NVdriver Kernel Module 1.0-2960 Tue May 14 07:41:42 PDT 2002
GCC version: gcc version 3.2 20020809 (Debian prerelease)
$ cat /proc/version
Linux version 2.4.19 (root@phobos) (gcc version 3.2 20020809 (Debian prerelease))
$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-linux/3.2/specs
Configured with: /mnt/data/gcc-3.1/gcc-3.2-3.2ds0/src/configure -v --enable-languages=c,c++,java,f77,proto,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-java-gc=boehm --enable-objc-gc i386-linux
Thread model: posix
gcc version 3.2 20020809 (Debian prerelease)
-adnans
Ug. Darn modules... After forcing it to load with 'insmod -f NVdriver', it squaked about licensing and gcc, then it finally loaded. I doubt the module will load on its own if I ever reboot my machine again, but atleast I know the workaround now.
The error just seemed to glaringly point in gcc's direction as the root of the problem. Odd.
% cat /proc/driver/nvidia/version
NVRM version: NVIDIA NVdriver Kernel Module 1.0-2960 Tue May 14 07:41:42 PDT 2002
GCC version: gcc version 3.2 (Red Hat Linux Rawhide 3.2-1)
compiled the kernel (2.4.19) with gcc 3.2, intel e100 driver, emu10k1
cvs checkout _and_ (!) the NVdriver, loaded without any squirks,
no need to force the driver in, the warning about the license is normal.
as I said before: _redhat_ brrrr :D
cheers
btw: glxgears runs with approx. 7800 fps
robibe_79uk
08-23-02, 05:59 AM
Ok, I'm pretty much a linux newbie, just finding my way around the basics. Been using it for a month or so now (have completely ditched Windows) and love it.
However, I've got problems now!!
Decided to start running Red Hat Linux Null (which I have to say looks much better than 7.2!) but, of course, my NVdriver doesn't work!
This is my first foray into compilation of stuff, apart from the pretty standard application things. I've got a fair idea of what I have to do... it's just actually doing it!
I've got the kernel-source RPM installed for Null (2.4.18-11) and have downloaded the tar.gz of the NVidia drivers. The make completes okay, but I get the error message "this was compiled using gcc 2 and you need version 3" basically.
So, on a completely fresh install, how do I go about getting the NVidia drivers to compile against this (and any, going forward) kernel that isn't supported by NVidia's distribution?
If I can get it working in the meantime, I'll post a mini-howto to the board if it helps people!
Thanks for all the info I've already got from the board though!
Rob
Alan666
08-23-02, 03:28 PM
I am using GCC 3.2 with the Redhat 7.3.94 beta. I have compiled the nVIDIA kernel module with GCC 3.2 from the source RPM. The module refuses to load.
1:NVIDIA_kernel ########################################### [100%]
/lib/modules/2.4.18-11smp/kernel/drivers/video/NVdriver: The module you are trying to load (/lib/modules/2.4.18-11smp/kernel/drivers/video/NVdriver) is compiled with a gcc
version 2 compiler, while the kernel you are running is compiled with
a gcc version 3 compiler. This is known to not work.
/lib/modules/2.4.18-11smp/kernel/drivers/video/NVdriver: insmod /lib/modules/2.4.18-11smp/kernel/drivers/video/NVdriver failed
/lib/modules/2.4.18-11smp/kernel/drivers/video/NVdriver: insmod NVdriver failed
I have tried setting the CC environment variable as suggested. That does not work.
I have checked for old object files. There are none.
Evidently the driver can be "forced", but that is a hacky solution.
Any plans to build a version of the source RPMs that will install cleanly? (I use a dual athalon system so I tend to build from source.)
Originally posted by robibe_79uk
So, on a completely fresh install, how do I go about getting the NVidia drivers to compile against this (and any, going forward) kernel that isn't supported by NVidia's distribution?
modutils 2.4.19 will load the NVdriver without the -f option. It will still print out a warning because the NVidia module is not GPL, but that can be ignored. So it really looks like a Redhat problem. BTW, the nv_drv.o that Redhat ships with null only supports Geforce4 based cards at 320x200, which really sucks.
-adnans
Thunderbird
08-24-02, 09:23 AM
RH created this "problem" themself. Since it isn't a great idea to use drivers compiled using a different gcc version, RH made a patch for modutils. The version of modutils RH uses now is 2.4.18-2. A short time ago they used 2.4.18-1. The only difference between those versions is a patch that checks for gcc 2.x code in modules when they're being loaded under a 3.x built kernel.
To realfix for the problem will be new driver packages from nvidia since mixing drivers compiled using different gcc versions can cause strange problems.
For now the fix is to switch back to modutils 2.4.18-1 from RH or to compile a modutils from source (for example 2.4.19).
vBulletin® v3.7.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.