13

According to the man page of lsmod the command shows “what kernel modules are currently loaded”.

I wrote a script that uses modinfo to show what kernel object (.ko) files are actually in use:

#!/bin/sh
for i in `lsmod | awk '{print $1}' | sed -n '1!p'`; do
echo "###############################$i###############################"
echo ""
modinfo $i
echo ""
echo ""
done

Now I found out that modinfo nvidia shows the following output:

ERROR: modinfo: could not find module nvidia

Do you guys have any explanation for this?

0

2 Answers 2

14

Your nvidia module is perfectly loaded and working. The problem lies in modinfo.

modinfo fetch the list of known modules by reading the /lib/modules/$(uname -r)/modules.* files, which are usually updated with depmod.

If depmod -a has not been run after installing the nvidia module, then modinfo does not knows about it. This does not prevent anybody from loading the module with insmod and lsmod will show it just fine if loaded.

3
  • I ran sudo depmod -a but modinfo still does not know about the nvidia module, but lsmod shows it. How can this be?
    – Hakaishin
    Commented Oct 29, 2018 at 14:01
  • @Hakaishin I'm on ubuntu 16.04 with the nvidia-410 drivers installed, and it appears the name of my kernel module is nvidia_410. So try modinfo nvidia_410 or similar. Commented Jun 20, 2019 at 21:09
  • Imagine making an OS where you compile in modules and totally forget everything about them and leave it all buggy designed, so you can't see any info about some random subset of the modules?
    – doug65536
    Commented Mar 10, 2023 at 4:15
0

If you've recently uninstalled your nvidia driver, you may have unistalled the module from your system, but it's still in your initrd. You can check which are in your initrd with lsinitrd. Or just try reinstalling your kernel to see if it no longer shows up in lsmod.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .