PDA

View Full Version : Video Card does not work with different Kernel


Junkyard81
04-07-03, 10:39 PM
Here is my problem, any help would really be appreciated:

I have the NVIDIA GeForce 4 (Ti 4200 I believe) video card. I am running Mandrake 9.0 without any problems.

For a class I am taking, I have to recompile the Linux Kernel (without any changes). I am able to recompile and boot, however my GUI interface will not load when I boot.

I had this problem when I first installed by GeForce 4 video card. To solve it, I had install the drivers. Everything worked after that, no problem.

However, when I attempt to install the drivers when I have the other kernel loaded, it does not work. First it detects the drivers are installed and asks me to uninstall them or I can not continue with the installation. I uninstall them and then I have furthur problems and the install exits.

My question is, if I want this to work for another kernel, EXACTLY what steps do I need to take? I am not very good at using Linux, and I am not very familar with advanced terms or processes.

This help would greatly be appreciated.

Andy Mecham
04-07-03, 11:18 PM
When you change your kernel, you'll usually have to rebuild any kernel drivers you have. The NVIDIA driver is one that you'll have to rebuild.

What errors did you get when you tried to install? Please post a copy of /var/log/nvidia-installer.log.

--andy

pbharris
04-07-03, 11:18 PM
hello,
load the old config which should be in /usr/src/linux/ and use make xconfig .

Junkyard81
04-08-03, 12:43 AM
Andy, how do you rebuild the kernel drivers, specifically the NVIDIA drivers? Are you suggesting to reinstall them? As far as errors, I would have to reinstall the drivers on my new kernel to find out. The only reason I did not do that again was b/c my working linux kernel won't have a GUI anymore (since it uninstalls the current drivers first). I will then need to reinstall them in my original linux through the console to get a working GUI, and it's just a hastle. If you need me to, I can do that though.

pbharris - That location does not exist for me. I have a /usr/src/RPM but nothing else. Under RPM though there are a couple of directories that are empty and one that has nothing useful.

bwkaz
04-08-03, 08:51 AM
You need to be booted to your new kernel to be able to correctly build (yes, build == reinstall) the drivers for it!

Yes, this means you cannot boot to a GUI. I know. That shouldn't be that big of a deal -- the installer won't run if X is running anyway.

Junkyard81
04-08-03, 01:10 PM
Ok, I think we are getting closer to solving this. I am able to attempt to install the drivers without having to reinstall them for my working kernel.

I do boot with my new kernel, without a working X display, and attempt to install the kernel. I manually specifiy the directory /usr/include for the "kernel.h" file. Here is the log: What is the next step? Thanks to anyone that can help.

nvidia-installer log file '/var/log/nvidia-installer.log'
creation time: Tue Apr 8 13:58:42 2003

option status:
license pre-accepted : false
update : false
force update : false
expert : false
uninstall : false
driver info : false
no precompiled interface: false
no ncurses color : false
query latest driver ver : false
no OpenGL header files : false
no questions : false
silent : false
XFree86 install prefix : /usr/X11R6
OpenGL install prefix : /usr
Installer install prefix: /usr
kernel include path : /usr/include
kernel install path : (not specified)
proc mount point : /proc
ui : (not specified)
tmpdir : /tmp
ftp site : ftp://download.nvidia.com

Using: nvidia-installer ncurses user interface
-> License accepted.
-> There appears to already be a driver installed on your system (version: 1.0-
4349). As part of installing this driver (version: 1.0-4349), the existing
driver will be uninstalled. Are you sure you want to continue? ('no' will
abort installation) (Answer: Yes)
-> No precompiled kernel interface was found to match your kernel; would you li
ke the installer to attempt to download a kernel interface for your kernel f
rom the NVIDIA ftp site (ftp://download.nvidia.com)? (Answer: Yes)
-> No matching precompiled kernel interface was found on the NVIDIA ftp site;
this means that the installer will need to compile a kernel interface for
your kernel.
-> Using the kernel include path '/usr/include' as specified by the
'--kernel-include-dir' commandline option.
-> Kernel include path: '/usr/include'
-> Cleaning kernel module build directory.
executing: 'cd ./usr/src/nv; make clean'...
rm -f nv.o os-agp.o os-interface.o os-registry.o nv-linux.o nv_compiler.h *
.d NVdriver nvidia.o
-> Building kernel module:
executing: 'cd ./usr/src/nv; make nvidia.o SYSINCLUDE=/usr/include'...
echo \#define NV_COMPILER \"`cc -v 2>&1 | tail -1`\" > nv_compiler.h
cc -c -Wall -Wimplicit -Wreturn-type -Wswitch -Wformat -Wchar-subscripts -Wp
arentheses -Wpointer-arith -Wcast-qual -Wno-multichar -O -MD -D__KERNEL__ -
DMODULE -D_LOOSE_KERNEL_NAMES -DNTRM -D_GNU_SOURCE -D_LOOSE_KERNEL_NAMES -D_
_KERNEL__ -DMODULE -DNV_MAJOR_VERSION=1 -DNV_MINOR_VERSION=0 -DNV_PATCHLEVE
L=4349 -DNV_UNIX -DNV_LINUX -DNV_INT64_OK -DNVCPU_X86 -I. -I/us
r/include -Wno-cast-qual nv.c
cc1: warning: changing search order for system directory "/usr/include"
cc1: warning: as it has already been specified as a non-system directory
In file included from /usr/include/linux/prefetch.h:13,
from /usr/include/linux/list.h:6,
from /usr/include/linux/module.h:11,
from nv-linux.h:28,
from nv.c:14:
/usr/include/asm/processor.h:55: `CONFIG_X86_L1_CACHE_SHIFT' undeclared here
(not in a function)
/usr/include/asm/processor.h:55: requested alignment is not a constant
In file included from /usr/include/linux/module.h:296,
from nv-linux.h:28,
from nv.c:14:
/usr/include/linux/version.h:2:2: #error "==================================
====================="
/usr/include/linux/version.h:3:2: #error "You should not include /usr/includ
e/{linux,asm}/ header"
/usr/include/linux/version.h:4:2: #error "files directly for the compilation
of kernel modules."
/usr/include/linux/version.h:5:2: #error ""
/usr/include/linux/version.h:6:2: #error "glibc now uses kernel header files
from a well-defined"
/usr/include/linux/version.h:7:2: #error "working kernel version (as recomme
nded by Linus Torvalds)"
/usr/include/linux/version.h:8:2: #error "These files are glibc internal and
may not match the"
/usr/include/linux/version.h:9:2: #error "currently running kernel. They sho
uld only be"
/usr/include/linux/version.h:10:2: #error "included via other system header
files - user space"
/usr/include/linux/version.h:11:2: #error "programs should not directly incl
ude <linux/*.h> or"
/usr/include/linux/version.h:12:2: #error "<asm/*.h> as well."
/usr/include/linux/version.h:13:2: #error ""
/usr/include/linux/version.h:14:2: #error "To build kernel modules please do
the following:"
/usr/include/linux/version.h:15:2: #error ""
/usr/include/linux/version.h:16:2: #error " o Have the kernel sources instal
led"
/usr/include/linux/version.h:17:2: #error ""
/usr/include/linux/version.h:18:2: #error " o Make sure that the symbolic li
nk"
/usr/include/linux/version.h:19:2: #error " /lib/modules/`uname -r`/build
exists and points to"
/usr/include/linux/version.h:20:2: #error " the matching kernel source dir
ectory"
/usr/include/linux/version.h:21:2: #error ""
/usr/include/linux/version.h:22:2: #error " o Now copy /boot/vmlinuz.version
.h to"
/usr/include/linux/version.h:23:2: #error " /lib/modules/`uname -r`/build/
include/linux/version.h"
/usr/include/linux/version.h:24:2: #error ""
/usr/include/linux/version.h:25:2: #error " o When compiling, make sure to u
se the following"
/usr/include/linux/version.h:26:2: #error " compiler option to use the cor
rect include files:"
/usr/include/linux/version.h:27:2: #error ""
/usr/include/linux/version.h:28:2: #error " -I/lib/modules/`uname -r`/buil
d/include"
/usr/include/linux/version.h:29:2: #error ""
/usr/include/linux/version.h:30:2: #error " instead of"
/usr/include/linux/version.h:31:2: #error ""
/usr/include/linux/version.h:32:2: #error " -I/usr/include/linux"
/usr/include/linux/version.h:33:2: #error ""
/usr/include/linux/version.h:34:2: #error " Please adjust the Makefile acc
ordingly."
/usr/include/linux/version.h:35:2: #error "=================================
======================"
In file included from nv-linux.h:28,
from nv.c:14:
/usr/include/linux/module.h:298: parse error before "UTS_RELEASE"
In file included from nv-linux.h:29,
from nv.c:14:
/usr/include/linux/version.h:2:2: #error "==================================
====================="
/usr/include/linux/version.h:3:2: #error "You should not include /usr/includ
e/{linux,asm}/ header"
/usr/include/linux/version.h:4:2: #error "files directly for the compilation
of kernel modules."
/usr/include/linux/version.h:5:2: #error ""
/usr/include/linux/version.h:6:2: #error "glibc now uses kernel header files
from a well-defined"
/usr/include/linux/version.h:7:2: #error "working kernel version (as recomme
nded by Linus Torvalds)"
/usr/include/linux/version.h:8:2: #error "These files are glibc internal and
may not match the"
/usr/include/linux/version.h:9:2: #error "currently running kernel. They sho
uld only be"
/usr/include/linux/version.h:10:2: #error "included via other system header
files - user space"
/usr/include/linux/version.h:11:2: #error "programs should not directly incl
ude <linux/*.h> or"
/usr/include/linux/version.h:12:2: #error "<asm/*.h> as well."
/usr/include/linux/version.h:13:2: #error ""
/usr/include/linux/version.h:14:2: #error "To build kernel modules please do
the following:"
/usr/include/linux/version.h:15:2: #error ""
/usr/include/linux/version.h:16:2: #error " o Have the kernel sources instal
led"
/usr/include/linux/version.h:17:2: #error ""
/usr/include/linux/version.h:18:2: #error " o Make sure that the symbolic li
nk"
/usr/include/linux/version.h:19:2: #error " /lib/modules/`uname -r`/build
exists and points to"
/usr/include/linux/version.h:20:2: #error " the matching kernel source dir
ectory"
/usr/include/linux/version.h:21:2: #error ""
/usr/include/linux/version.h:22:2: #error " o Now copy /boot/vmlinuz.version
.h to"
/usr/include/linux/version.h:23:2: #error " /lib/modules/`uname -r`/build/
include/linux/version.h"
/usr/include/linux/version.h:24:2: #error ""
/usr/include/linux/version.h:25:2: #error " o When compiling, make sure to u
se the following"
/usr/include/linux/version.h:26:2: #error " compiler option to use the cor
rect include files:"
/usr/include/linux/version.h:27:2: #error ""
/usr/include/linux/version.h:28:2: #error " -I/lib/modules/`uname -r`/buil
d/include"
/usr/include/linux/version.h:29:2: #error ""
/usr/include/linux/version.h:30:2: #error " instead of"
/usr/include/linux/version.h:31:2: #error ""
/usr/include/linux/version.h:32:2: #error " -I/usr/include/linux"
/usr/include/linux/version.h:33:2: #error ""
/usr/include/linux/version.h:34:2: #error " Please adjust the Makefile acc
ordingly."
/usr/include/linux/version.h:35:2: #error "=================================
======================"
In file included from nv.c:14:
nv-linux.h:31:40: missing binary operator before '('
nv-linux.h:33:42: missing binary operator before '('
nv-linux.h:43:42: missing binary operator before '('
nv-linux.h:45:42: missing binary operator before '('
nv-linux.h:47:42: missing binary operator before '('
nv-linux.h:51:4: #error This driver does not support 2.6.x or newer kernels!
In file included from /usr/include/asm/hardirq.h:6,
from /usr/include/linux/interrupt.h:45,
from nv-linux.h:79,
from nv.c:14:
/usr/include/linux/irq.h:65: `CONFIG_X86_L1_CACHE_SHIFT' undeclared here (no
t in a function)
/usr/include/linux/irq.h:65: requested alignment is not a constant
In file included from /usr/include/linux/irq.h:69,
from /usr/include/asm/hardirq.h:6,
from /usr/include/linux/interrupt.h:45,
from nv-linux.h:79,
from nv.c:14:
/usr/include/asm/hw_irq.h: In function `x86_do_profile':
/usr/include/asm/hw_irq.h:203: warning: implicit declaration of function `sm
p_processor_id'
In file included from /usr/include/linux/interrupt.h:45,
from nv-linux.h:79,
from nv.c:14:
/usr/include/asm/hardirq.h: At top level:
/usr/include/asm/hardirq.h:16: `CONFIG_X86_L1_CACHE_SHIFT' undeclared here (
not in a function)
/usr/include/asm/hardirq.h:16: requested alignment is not a constant
In file included from nv-linux.h:79,
from nv.c:14:
/usr/include/linux/interrupt.h:128: `CONFIG_X86_L1_CACHE_SHIFT' undeclared h
ere (not in a function)
/usr/include/linux/interrupt.h:128: requested alignment is not a constant
nv-linux.h:135:40: missing binary operator before '('
nv-linux.h:226:64: missing binary operator before '('
nv.c: In function `nvos_proc_remove_all':
nv.c:624: dereferencing pointer to incomplete type
nv.c:625: dereferencing pointer to incomplete type
nv.c:626: dereferencing pointer to incomplete type
nv.c:627: warning: implicit declaration of function `remove_proc_entry'
nv.c:627: dereferencing pointer to incomplete type
nv.c:627: dereferencing pointer to incomplete type
nv.c:1349:65: missing binary operator before '('
nv.c: In function `nv_kern_mmap':
nv.c:1352: warning: implicit declaration of function `pgprot_writecombine'
nv.c:1352: incompatible types in assignment
make: *** [nv.o] Error 1
-> Error.
ERROR: Unable to build the NVIDIA kernel module.
ERROR: Installation has failed. Please see the file
'/var/log/nvidia-installer.log' for details. You may find suggestions
on fixing installation problems in the README available on the Linux
driver download page at www.nvidia.com.

Andy Mecham
04-08-03, 01:12 PM
You can't use /usr/include, as the error says. You need to point the installer to configured kernel sources for the kernel you're trying to compile for.

--andy

Junkyard81
04-08-03, 01:19 PM
I'm sure this is a really bad question, but please bare with me becuase I am not very experienced with Linux. How do I point it to that and where are those files?

This might help. Our professor made us download a file named "linux-2.4.19.tar.gz". I am not sure if you are familiar with that. We were told to configure it (make xconfig), then run dep, make bzImage, make modules, make modules_install and then copy the kernel (the bzImage and System.map files) to /boot/vmlinuz-2.4.19-os.

Now, is the location where I unzipped the original tarred file and ran the xconfig the place where the header files are? Or are they in the /boot directory? Thank you very much..

bwkaz
04-08-03, 03:31 PM
The former.

If you decompressed it into your home directory (or something), then the correct path to use would be /home/username/linux-2.4.19 for the include path thingy.

However, note that when you make modules_install, it creates a symlink in the /lib/modules/2.4.19 (or whatever the current kernel being installed is named) directory, named build, that points at the base of where the sources came from. This is automatically tried by the installer (or at least... it used to be) when you don't specify a directory. So try getting rid of the directory -- as long as you haven't deleted the linux-2.4.19 directory, you should be OK. If not, post the nvidia-installer.log again (the new one).

Junkyard81
04-08-03, 04:15 PM
You said get rid of the directory. I'm assuming you mean do not specify it on the command line. When I do that, I get many more errors. I was doing it like that originally. It says it can not find the files it needs, such as "kernel.h". It then aborts. Do you still want me to try to run it like that and post the log file?

bwkaz
04-08-03, 04:49 PM
Errr... no, not if it can't find header files.

Go into /lib/modules/2.4.19, and look for a build symlink. ls -ld build should give you something like build -> /path/to/linux-2.4.19

If it doesn't give you that, then create the symlink yourself -- ln -s /path/to/linux-2.4.19 build (as root) -- and try the installer again.

Junkyard81
04-08-03, 06:08 PM
bwkaz, your help was incredible. I did as you said (with some trial and error in between) and now everything works. I appreciate your patience and help so much.

I have an off topic question, which you do not have to respond to if you do not feel the need. In my default linux kernel, the sound does not work. However, it does work when I log in as "root". I posted that somewhere before and they said it is a classic bug in Mandrake (or linux, not sure which one).

However, when I recompiled the kernel mentioned above, and booted with a working video card, the sound worked. How can I make my sound work for my default linux kernel? Also, what would be the differences b/w the kernel I just compiled and the default linux kernel? My sound card is nothing special. It is an old Montego II sound card.

Thank you again for your help.