nV News Forums

 
 

nV News Forums (http://www.nvnews.net/vbulletin/index.php)
-   NVIDIA Linux (http://www.nvnews.net/vbulletin/forumdisplay.php?f=14)
-   -   Keeping 2 drivers for 2 different kernels (http://www.nvnews.net/vbulletin/showthread.php?t=12527)

Dnzauker 05-28-03 11:03 AM

Keeping 2 drivers for 2 different kernels
 
Hello.
I have the drivers installed correctly on my Mandrake 9.1 box
Now i compiled another kernel on the same machine (for completeness sake, is a low-latency patched kernel for multimedia stuff).
If I start up the PC with the new kernel X doesn't start and tells me this in the log:

"(EE) NVIDIA(0): Failed to initialize the NVIDIA kernel module!"

Reading the docs it says that this could happen when you use a driver compiled for a kernel different from the one you usa, which seems to be exactly my case.

So, the questions are:

- Do I only have to run NVIDIA-Linux-x86-1.0-4363.run again to generate a new correct NVIDIA driver for my new kernel?

- Does this REPLACE my previous one, so that X will start only for the new kernel and won't start anymore for the old kernel?

- How can I have BOTH of my kernel make X start WITH a working NVIDIA driver?

Thank you very much.

DrOzz 05-28-03 03:48 PM

run the nvidia installer and specify the new kernel directory in the install command line...read the readme on how to specify what kernel to specifically install the drivers for..

bwkaz 05-28-03 06:14 PM

Doing what DrOzz is recommending will delete the kernel module for your other kernel, though -- they won't both work anymore, only your new kernel.

The way to get both of them working at the same time is to run the installer with the --extract-only option. This will create a directory named the same as the installer (without the .run at the end). cd into that directory, and then cd ./usr/src/nv and run make nvidia.o && make install -- this won't delete the old kernel package, but will just create a new one (you HAVE to be running the new kernel), and install it.

You can then delete the directory that the installer created when you gave it --extract-only.

stuartlevy 05-29-03 01:31 AM

Another way to prevent an install-under-kernel-B
from trashing the module already installed-under-kernel-A
is to move the installed kernel-A module first
to a place where modprobe can find it but
nvidia-installer can't, then run the nvidia-installer normally.

E.g. I have kernels "2.4.18-bigmem" and
"2.4.20-xfs". I've already run nvidia-installer
under 2.4.18-bigmem; it created a file
/lib/modules/2.4.18-bigmem/kernel/drivers/video/nvidia.o
which I want to keep.

Now I boot to 2.4.20-xfs, but before running
nvidia-installer, I say
Code:

  cd /lib/modules/2.4.18-bigmem
  mkdir misc
  mv  kernel/drivers/video/nvidia.o  misc/

Neat huh?

Moving nvidia.o out of the kernel/... subtree
also means (for better or worse) that if I
"make modules_install" on that kernel's
source tree, it won't erase nvidia.o.
That's good if I make only small changes,
but bad if I make a kernel .config change that breaks compatibility.
Find out by running "depmod -ae".
If nvidia.o has undefined symbols,
then rm /lib/modules/whatnot/misc/nvidia.o,
re-run nvidia-installer and then mv... as above.

Dnzauker 05-29-03 08:09 AM

I gave a deeper look at the docs.
Since using NVIDIA-Linux-x86-1.0-4363.run installs the new driver under /lib/modules/`uname -r`/video/nvidia.o, shouldn't it suffice to just running it again under the new kernel? Shouldn't it go automatically to the new kernel's subdir?

stuartlevy 05-29-03 11:49 AM

Quote:

[i]... Shouldn't it go automatically to the new kernel's subdir? [/b]
It could have been made to do that,
but seems to be designed to uninstall
whatever it already knows about -- whether
an RPM installation or an existing nvidia-installer one.
Generally that seems like a good idea,
but it gets in the way if you want to run multiple
kernels.

If you do use the hide-in-misc/ subterfuge
I suggest above, you'll need to remember to
remove .../misc/nvidia.o manually if you upgrade to a later
NVidia driver version. The later driver will
come with a later libGL, and the kernel
driver and libGL need to have matched versions.
I.e. you might get in the habit of saying, just to make sure,
Code:

  rm /lib/modules/*/misc/nvidia.o
  nvidia-installer -a --update ...


Dnzauker 05-29-03 04:16 PM

So, if I understood everything right, the trick is to move nvidia.o from /lib/modules/my.old.kernel/kernel/drivers/video to /lib/modules/my.old.kernel/misc, because that directory is in modprobe's path, too, but it's not recognized by NVIDIA's "auto uninstaller"?

Then I just have to boot the new kernel, run the installer and I should find a new nvidia.o in /lib/modules/my.new.kernel/kernel/drivers/video

It doesn't seem difficult. It could even be generalized for a thire or fourth kernel by playing the same trick over again, am I right?

does the other trick (manual decompressing and make/make install) give exactly the same results? This seems even easier and generalizable for n kernels.

bwkaz 05-29-03 06:34 PM

Quote:

Originally posted by Dnzauker
So, if I understood everything right, the trick is to move nvidia.o from /lib/modules/my.old.kernel/kernel/drivers/video to /lib/modules/my.old.kernel/misc, because that directory is in modprobe's path, too, but it's not recognized by NVIDIA's "auto uninstaller"?
Yes.

Quote:

Then I just have to boot the new kernel, run the installer and I should find a new nvidia.o in /lib/modules/my.new.kernel/kernel/drivers/video
Yes.

Quote:

It could even be generalized for a thire or fourth kernel by playing the same trick over again, am I right?
Yes.

Quote:

does the other trick (manual decompressing and make/make install) give exactly the same results? This seems even easier and generalizable for n kernels.
Yes. Although if you use the other method (manual decompression, make nvidia.o, make install), then you won't get the GL libraries reinstalled. This shouldn't matter, because they're the same regardless of kernel version anyway (unless you move from a RH patched kernel to a standard kernel, where the TLS stuff changes -- I don't have any idea whether or how well that would work).


All times are GMT -5. The time now is 03:09 AM.

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.