# Failed to calculate dependencies

## karl

I was re-building my kernel for sound support and then lost my GUI (startx, kdm).  The first hint of a problem is when I reboot, I get a "Failed to calculate dependencies" message:

* Loading key mappings...

* Calculating module dependencies...

* Failed to calculate dependencies

* Loading module NVdriver

* Bringing lo up

Did a google search, can't find a reference to that message anywhere.  Anyone have more information about what it means and/or any logs I can look at?  The real question here is, how are these module dependencies calculated, based on what that is, and are there any diagnostics anywhere when these calculations fail.   :Question: 

The rest of this may or may not be relevant, once the above is resolved I hope the below will work itself out as well, since it has to do with a module after all.  :Rolling Eyes: 

I'm running gentoo linux on a Dell Inspiron 8200 with a Dell UltraSharp monitor and 64MB DDR 4XAGP NVIDIA GeForce4 440 Go 3D Video card.  When I run startx I get the following:

(--)  NVIDIA(0): MMIO registers at 0XFC000000

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

(EE) NVIDIA(0): *** Aborting ***

(II) UnloadModule: "nvidia"

(II) UnloadModule: "vgaw"

(II) Unloading /usr/X11R6/lib/modules/libvgahw.a

(EE) Screen(s) found, but none have a usable configuration.

Here's the relevent info from my /usr/X11R6/bin/xf86config file:

Section "Module"

Load "dbe"

 SubSection "extmod"

  Option "omit xfree86-dga"

 EndSubSection"

Load "type1"

Load "freetype"

Load "glx"

Section "InputDevice"

Identifier "Mouse1"

Driver "mouse"

Option "Protocol" "PS/2"

Option "Device" "/dev/mouse"

Section "Monitor"

Identifier "My Monitor"

HorizSync 31.5 - 82.0

VertRefresh 40-150

Section "Device"

Identifier "Standard VGA"

VendorName "Unknown"

BoardName "Unknown"

Driver "vga"

Section "Device"

Identifier "NVIDIA GeForce"

Driver "nvidia"

Section "Screen"

Identifier "Screen 1"

Device "NVIDIA GeForce"

Monitor "My Monitor"

DefaultDepth 24

Subsection "Display"

 Depth 8

 Modes "640x480" "800x600" "1024x768" "1280x1024"

 ViewPort 0 0

EndSubsection

Subsection "Display"

 Depth 16

 Modes "640x480" "800x600" "1024x768" "1280x1024"

 ViewPort 0 0

EndSubsection

Subsection "Display"

 Depth 24

 Modes "1024x768"

 ViewPort 0 0

EndSubsection

----------

## kerframil

I had a similar situation not so long ago. I'm assuming you did do a make modules modules_install? In any case, try this first (this assumes you are using gentoo-sources-r5, change paths as necessary if not):

1) mv /lib/modules/2.4.19-gentoo-r5 /lib/modules/2.4.19-gentoo-r5_backup

2) make modules modules_install

3) Reboot if everything seemed OK.

Assuming that works, unmerge and emerge the nvidia driver again. That's a separate issue - it happened to me once and re-emerging it did the trick. Of course X should be fine after that.

If the above doesn't work then:

1) Make sure you have unmerged older kernel ebuilds. Or emerge clean to clean out all old ebuilds.

2) Destroy your modules folder completely (keep a backup as shown above though). rm -rf /lib/modules/2.4.19-gentoo-r5

3) Go to /usr/src and rm -rf any old kernel trees other than r5.

4) Make sure /usr/src/linux is symlinked to /usr/src/linux-2.4.19-gentoo-r5 because you never know ...

5) Go into /usr/src/linux and make mrproper before compiling the kernel again. Note: this command will lose your kernel configuration so perhaps you may want to save the configuration before doing it, and load it back in again after the make mrproper, saving you the bother of going through the options again.

I'm sure you did it this way but just in case: make sure you: make dep ; make clean before compiling bzImage and don't forget to make your modules afterwards. However, you should be able to reboot without making the modules (as long as no critical system functionality depends on a module) just to test the kernel, before making the modules.

----------

## karl

Thanks, it is able to calculate module dependencies, however I must have missed something because now I'm getting this:

* Calculating module dependencies...

*   Loading module NVdriver...

*   Failed to load NVdriver

*  modprobe: Can't open dependencies file /lib/modules/2.4.19-gentoo-r4/modules.dep (No such file or directory)

* Bringing lo up....

.... you wouldn't by any chance know why it's looking for r4 when I built an r5 kernel?  I followed each step of your instructions... perhaps incorrectly though.  I'm thinking I might have to start from scratch at this point.

----------

## kerframil

It's really funny you should say that, because I just happened to be modprobing my modules, well I did this:

```
modprobe -nv ymfpci
```

and got this sort of thing in return:

```
/sbin/insmod /libmodules/2.4.19-gentoo-r4/kernel/drivers/sound/sound.o
```

  :Shocked: 

I don't have any problems but this kind of thing is worrying and I need to look more into this issue of module handling and dependencies too. Can anyone else save us some time here?

----------

## BackSeat

Did you do an emerge nvidia-kernel after your kernel rebuild?

If not, you need to.

BS

----------

## kerframil

 *Quote:*   

> you wouldn't by any chance know why it's looking for r4 when I built an r5 kernel?

 

Damn, I feel very stupid now. I don't know about you, karl, but it turned out that I hadn't moved my bzImage to my /boot partition after I had compiled the r5 kernel. So there I am, happy as can be thinking I'm running r5 but when I did a uname -a, the terrible truth emerged! So, I did:

```
mount /boot

mv /boot/bzImage /boot/bzImage.r4

cp /usr/src/linux/arch/i386/boot/bzImage /boot

umount /boot

shutdown -r now
```

And that was the mystery solved. Hopefully, that's what is happening to you also.

 *Quote:*   

> Did you do an emerge nvidia-kernel after your kernel rebuild?
> 
> If not, you need to.

 

Indeed ...

----------

## karl

Oh, I probably did something stupid along those lines, but I was impatient and built everything from scratch again...  By the way kerframil, I had some trouble merging samba as well, but you had a post that answered that problem as well and it's building as I'm typing this so thanks for all your (and of course backseat's contribution here) posts.

 :Very Happy: 

----------

