# cannot unload nvidia module from kernel [solved]

## KLG

hello i have a 3 days old gentoo system  :Wink:  and after i was done emerging the whole universe, i thougt ti was time to use gnome...

gnome doesn't work due to resolution problems but this is not the case, i ll deal with it later

I have a GeForce Go 6800 (laptop card) and i thought that it woul be better to use the new nvidia driver!

i downloaded it and tried to:

# sh NVIDIA-Linux-x86-1.0-7667-pkg1.run  (of course in the appropriate directory)

but i get the following message

An nvidia kernel module 'nvidia' appears to already loaded in your kernel. This may be because it is in use (for example, by the X-server) but may also happen because your kernel was configured without support for module unloading. ..... If u have done all that and the problem occurs, then an error may have occured that has corrupted the nvidia kernel module's usage count...the simplest remedy is to reboot.

Now here is what i have done to fix it and completely failed:

- enabled module unloading from kernel

- deleted "nvidia" from /etc/modules.autoload.d/kernel-2.6

- unmerged nvidia-kernel 

- unmerged nvidia-glx

-deleted /dev/nvidia and /dev/nvidia0

- and of course x server is not n use because i can;t even opeb gnome

any help ??????????

plz plz plzLast edited by KLG on Sat Jul 16, 2005 5:43 pm; edited 1 time in total

----------

## KLG

A different approach

i do 

```
cat /proc/driver/nvidia/version 
```

and i see ...nvidia kernel module 1.0-6629

even though if i have enmerge everything ????

then I 

```

lsmod | grep nvidia

```

and get 

nvidia       3464252   -

when i 

```
 rmmod nvidia 
```

i get 

FATAL: KErnel does not have unload support!!!

But i told it to have, whats going on?

----------

## dgaffuri

Silly question, but are you sure you properly installed your kernel after rebuild? It happened at least a dozen times to me (e.g. copy to boot but boot is not mounted)

----------

## KLG

after 

make menuconfig

i do

make && make modules_install

am i missing something?

(i dont use bzImage, but i boot using vmlinuz (/boot/vmlinuz ro root=/dev/sda2 )

please be as more specific as possible, because as u can understand i am totaly n00b   :Very Happy: 

----------

## dgaffuri

You have to run

```
make install
```

or to manually copy vmlinuz to your boot partition. Do you use GRUB or LILO? Be careful to keep the old image and an entry in your bootloader configuration so you may boot it if something goes wrong. If you use GRUB i'll show you my /boot partition and grub.conf content.

```
# ls -l /boot

total 11107

lrwxrwxrwx  1 root root      27 Jul 13 02:18 System.map -> System.map-2.6.12-gentoo-r4

-rw-r--r--  1 root root  815785 Jul 13 02:18 System.map-2.6.12-gentoo-r4

-rw-r--r--  1 root root  812244 Jul  8 02:10 System.map-2.6.12-gentoo-r4.old

lrwxrwxrwx  1 root root      31 Jul 13 02:18 System.map.old -> System.map-2.6.12-gentoo-r4.old

lrwxrwxrwx  1 root root       1 May 28 13:41 boot -> .

lrwxrwxrwx  1 root root      23 Jul 13 02:18 config -> config-2.6.12-gentoo-r4

-rw-r--r--  1 root root   36222 Jul 13 02:18 config-2.6.12-gentoo-r4

-rw-r--r--  1 root root   35633 Jul  8 02:10 config-2.6.12-gentoo-r4.old

lrwxrwxrwx  1 root root      27 Jul 13 02:18 config.old -> config-2.6.12-gentoo-r4.old

-rw-r--r--  1 root root 1265137 Jul 11 01:49 fbsplash-livecd-2005.1-1024x768

drwxr-xr-x  2 root root    1024 Jul 11 01:49 grub

drwx------  2 root root   12288 May 26 02:35 lost+found

lrwxrwxrwx  1 root root      24 Jul 13 02:18 vmlinuz -> vmlinuz-2.6.12-gentoo-r4

-rw-r--r--  1 root root 1549955 Jul 13 02:18 vmlinuz-2.6.12-gentoo-r4

-rw-r--r--  1 root root 1533127 Jul  8 02:10 vmlinuz-2.6.12-gentoo-r4.old

lrwxrwxrwx  1 root root      28 Jul 13 02:18 vmlinuz.old -> vmlinuz-2.6.12-gentoo-r4.old
```

The symbolic links to vmlinuz and vmlinuz.old and the rename of the old kernel to blabla.old are managed by make install in your kernel dir. Your grub.conf must have two entries one for the current kernel and one for the old one. Here's mine:

```
title   Gentoo Linux 2.6.12-r4

root    (hd0,2)

kernel  /vmlinuz root=/dev/hda6 lapic video=vesafb:ywrap,mtrr,1024x768-32@60 splash=silent,fadein,theme:livecd-2005.1 quiet CONSOLE=/dev/tty1

initrd  /fbsplash-livecd-2005.1-1024x768

title   Last Gentoo Linux 2.6.12-r4

root    (hd0,2)

kernel  /vmlinuz.old root=/dev/hda6 lapic video=vesafb:ywrap,mtrr,1024x768-32@60 splash=silent,fadein,theme:livecd-2005.0 quiet CONSOLE=/dev/tty1

initrd  /fbsplash-livecd-2005.1-1024x768
```

Please, double check before overriding your current kernel. Feel free to post your doubts.

----------

## KLG

ok i run

make install   :Embarassed:  (shame on me)

and now I get also the same msg when i try to install nvidia drivers, and

when i 

lsmode | grep nvidia

i get:

nvidia  3464634 0 [permanent]

of course when i:

rmmod nvidia

i get:

ERROR:Removing 'nvidia' device or resource busy

----------

## dgaffuri

I really don't know, maybe the module is still in /lib/modules/<your kernel> stuff and it's loaded automatically when hardware is detected at boot time (you should check dmesg output).

Anyway, version 7767 is available as a portage package too, but is masked. You have to

```
echo "media-video/nvidia-kernel ~x86" >>/etc/portage/package.keywords
```

if you want to unmask it. Than you can install it using emerge (remember to unmask and update nvidia-glx too).

BTW, do you have specific problems with 6629?

----------

## KLG

THANKS!!!!!!!

i went into 

/lib/modules/<my kernel)/video

and i found nvidia.ko

i deleted it, and i am fine. the new driver is installe!!!

I downloaded 7667 because i thought i would recognize my laptop's graphics card (me and my windows way of doing things.... first do then ask)

Anyway this topic is [SOLVED]!!!!

Thank u for your help

----------

## dgaffuri

You're welcome! Still don't understand why unmerging nvidia-kernel didn't removed the module, anyway  :Confused:  .

----------

