Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

How to get rid of nouveau modules?

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
26 posts
  • 1
  • 2
  • Next
Author
Message
Blind_Sniper
Guru
Guru
Posts: 373
Joined: Fri Apr 20, 2018 9:48 am

How to get rid of nouveau modules?

  • Quote

Post by Blind_Sniper » Sat Aug 15, 2020 12:32 pm

I switched from nvidia to nouveau driver to check for some videocard issue.
Now I want to switch back to nvidia-drivers.
I rebuilt kernel with old .config (it was saved before switching to nouveau and copied back now):

Code: Select all

make clean && make && make modules_install
and re-installed nvidia driver:

Code: Select all

emerge -av nvidia-drivers
nvidia-xconfig
During kernel rebuild I noticed that a zillion "nouveau*.o" object files was rebuilt again and nouveau kernel modules was installed to /lib/modules directory, though my kernel config is free of any nouvea stuffs:

Code: Select all

cat /usr/src/linux/.config |grep NOUVEAU
# CONFIG_DRM_NOUVEAU is not set
the same for make.conf:

Code: Select all

cat /etc/portage/make.conf |grep VIDEO_CARDS
VIDEO_CARDS="nvidia"
and xorg.conf:

Code: Select all

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection
When rebooting after rebuild kernel loading nouveau driver instead of nvidia. Only blacklisting prevents nouveau loading.
Where is that trigger which causes nouveau kernel modules rebuild, and how do I get rid of nouveau completely?
GNU is Not Usable
Top
alamahant
Advocate
Advocate
Posts: 4034
Joined: Sat Mar 23, 2019 12:12 pm

  • Quote

Post by alamahant » Sat Aug 15, 2020 2:53 pm

Hi
Maybe you should run

Code: Select all

emerge -uDNav @world
emerge -a --depclean
:D
Top
Blind_Sniper
Guru
Guru
Posts: 373
Joined: Fri Apr 20, 2018 9:48 am

  • Quote

Post by Blind_Sniper » Sat Aug 15, 2020 2:54 pm

I did it after switching back to nvidia.
GNU is Not Usable
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56094
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Sat Aug 15, 2020 2:59 pm

Blind_Sniper,

Its easy to build one kernel and run another.

Code: Select all

cat /usr/src/linux/.config |grep NOUVEAU
# CONFIG_DRM_NOUVEAU is not set
That good. That's the kernel build location.

What is the date/time on /usr/src/linux/.config ?
Lose a point for a useless cat.

What is the date/time in

Code: Select all

uname -a
thats the build time of the currently running kernel.
For the currently running kernel to be derived from the .config you think it was, the unawe -a time must be newer than the .config time.
Is it?
If not you are not running the kernel you think you are.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Blind_Sniper
Guru
Guru
Posts: 373
Joined: Fri Apr 20, 2018 9:48 am

  • Quote

Post by Blind_Sniper » Sat Aug 15, 2020 3:14 pm

Code: Select all

uname -a
Linux localhost 5.4.48-gentoo #2 SMP Sat Aug 15 13:15:37

Code: Select all

ls -l /boot
total 10124
drwxr-xr-x 6 root root    4096 Jul  4 11:13 grub
-rw-r--r-- 1 root root 5169712 Apr  5 11:12 kernel-5.4.20
-rw-r--r-- 1 root root 5186096 Aug 15 14:17 kernel-5.4.48

Code: Select all

ls -l /usr/src//linux/.config
-rw-r--r-- 1 root root 93968 Jun 28 14:17 /usr/src//linux/.config
it's really newly built kernel, and it was built on old backuped .config
GNU is Not Usable
Top
halcon
l33t
l33t
User avatar
Posts: 736
Joined: Sun Dec 15, 2019 8:54 pm

  • Quote

Post by halcon » Sat Aug 15, 2020 3:23 pm

Blind_Sniper,
what is the output of that command?

Code: Select all

# ls -a /proc | grep config
Top
Blind_Sniper
Guru
Guru
Posts: 373
Joined: Fri Apr 20, 2018 9:48 am

  • Quote

Post by Blind_Sniper » Sat Aug 15, 2020 3:31 pm

Code: Select all

ls -a /proc | grep config
config.gz
GNU is Not Usable
Top
alamahant
Advocate
Advocate
Posts: 4034
Joined: Sat Mar 23, 2019 12:12 pm

  • Quote

Post by alamahant » Sat Aug 15, 2020 3:39 pm

Do you have a

Code: Select all

/etc/modules-load.d/nvidia.conf
What is the output of

Code: Select all

equery list '*' | grep nouveau
Have you update the initramfs?

:D
Last edited by alamahant on Sat Aug 15, 2020 4:07 pm, edited 3 times in total.
Top
Blind_Sniper
Guru
Guru
Posts: 373
Joined: Fri Apr 20, 2018 9:48 am

  • Quote

Post by Blind_Sniper » Sat Aug 15, 2020 3:58 pm

I have no /etc/modules-load.d/nvidia.conf file at all.
equery list '*' | grep nouveau shows empty output

this command proves that I running righ now newly built kernel without nouveau support:

Code: Select all

zcat /proc/config.gz  | grep NOUVEAU
# CONFIG_DRM_NOUVEAU is not set
there is nouveau.ko module in /lib/modules/5.4.48-gentoo/kernel/drivers/gpu/drm/nouveau directory.
May be it'a a module which kernel loads on boot?

Added: I can remove that drm module, but I want to know why kernel loads nouveau, if it configured to not to use nouveau modules?
Added: I do not use initramfs
GNU is Not Usable
Top
alamahant
Advocate
Advocate
Posts: 4034
Joined: Sat Mar 23, 2019 12:12 pm

  • Quote

Post by alamahant » Sat Aug 15, 2020 4:13 pm

If you deleted both the nouveau.ko in /lib/modules and the /usr/src/linux/drivers/gpu/drm/nouveau directory and also the kernel in /boot and run again

Code: Select all

make modules_install
make install
Then create the nvidia.conf file containing "nvidia" and reboot?
But before you do this check if nvidia module is present

Code: Select all

modprobe nvidia
lsmod | grep nvidia

Top
Blind_Sniper
Guru
Guru
Posts: 373
Joined: Fri Apr 20, 2018 9:48 am

  • Quote

Post by Blind_Sniper » Sat Aug 15, 2020 4:21 pm

deleted nouveau.ko under /lib directory and ran this:

Code: Select all

# make modules_install
  INSTALL drivers/acpi/video.ko
  INSTALL drivers/gpu/drm/nouveau/nouveau.ko
  INSTALL drivers/gpu/drm/ttm/ttm.ko
  INSTALL drivers/net/tun.ko
  INSTALL drivers/platform/x86/mxm-wmi.ko
  INSTALL drivers/platform/x86/wmi-bmof.ko
  INSTALL drivers/platform/x86/wmi.ko
  INSTALL drivers/ptp/ptp.ko
  INSTALL drivers/video/backlight/backlight.ko
  INSTALL drivers/video/backlight/generic_bl.ko
  INSTALL fs/efivarfs/efivarfs.ko
  DEPMOD  5.4.48-gentoo
nouveau.ko was copied again to /lib.
where this module came from? I did make clean before kernel rebuilding. I disabled nouveau in .config, wtf it wants?

modprobe nvidia
if I didn't blacklist nouveau I cannot load nvidia module, modprobe reports that there is no such device. And lsmod shows that nouveau is loaded.
if I blacklisting nouveau, nvidia loading just fine without any modprobe.
Last edited by Blind_Sniper on Sat Aug 15, 2020 4:25 pm, edited 1 time in total.
GNU is Not Usable
Top
halcon
l33t
l33t
User avatar
Posts: 736
Joined: Sun Dec 15, 2019 8:54 pm

  • Quote

Post by halcon » Sat Aug 15, 2020 4:25 pm

Blind_Sniper wrote:Added: I can remove that drm module, but I want to know why kernel loads nouveau, if it configured to not to use nouveau modules?
Maybe, the reason is here:
Blind_Sniper wrote:

Code: Select all

make clean && make && make modules_install
You omitted

Code: Select all

make modules
AFAIK, make modules_install does not include make modules, that is, nothing is built. And all those modules are from the previous kernel version?

I use always CONFIG_LOCALVERSION for my kernels (for example, CONFIG_LOCALVERSION="-v46"), increasing it at each re-build, and my modules can not be mixed:

# ls -a /lib/modules/
. 4.19.72-gentoo-v41 4.19.86-gentoo-v43 4.19.97-gentoo-v45
.. 4.19.72-gentoo-v42 4.19.86-gentoo-v44 5.6.3-gentoo-v46
#

EDIT:
Blind_Sniper wrote:where this module came from?
I wonder too why make clean didn't remove them (evidently?)
Last edited by halcon on Sat Aug 15, 2020 4:31 pm, edited 1 time in total.
Top
Blind_Sniper
Guru
Guru
Posts: 373
Joined: Fri Apr 20, 2018 9:48 am

  • Quote

Post by Blind_Sniper » Sat Aug 15, 2020 4:31 pm

halcon wrote: You omitted

Code: Select all

make modules
AFAIK, make modules_install does not include make modules, that is, nothing is built. And all those modules are from the previous kernel version?
I using gentoo for decade now and never did "make modules". If it would be mandatory, I wouldn't have nouveau module built and wouldn't fight against it now trying to prevent it to be loaded, isn't it?
GNU is Not Usable
Top
halcon
l33t
l33t
User avatar
Posts: 736
Joined: Sun Dec 15, 2019 8:54 pm

  • Quote

Post by halcon » Sat Aug 15, 2020 4:33 pm

Blind_Sniper wrote:I using gentoo for decade now and never did "make modules".
If so, I have no idea... But... There is another proof (the comment by not-a-user, Apr 5 '17 at 8:13).

Then, it's said, prior to 2.6, you need make modules, while after 2.6, make will also do make modules... Maybe something changed again?

EDIT:
I personally am using these commands (also for decade) and never had issues:

Code: Select all

make bzImage
make modules
make modules_install
Top
alamahant
Advocate
Advocate
Posts: 4034
Joined: Sat Mar 23, 2019 12:12 pm

  • Quote

Post by alamahant » Sat Aug 15, 2020 5:59 pm

It comes from here

Code: Select all

/usr/src/linux/drivers/gpu/drm/nouveau 
Just delete this directory together with the module in /lib/modules.
Even better delete

Code: Select all

/lib/modules/<kernel-version>
/boot/vmlinuz-<version>
/usr/src/linux/drivers/gpu/drm/nouveau
And rerun

Code: Select all

cd /usr/src/linux
make modules_install
make install
emerge -1av nvidia-drivers
It will be impossible for any trace to remain.
You mention you rebuilt the kernel with
make clean && make && make modules_install
You forgot to run "make install"
Best solution rebuild a totally new kernel after deleting the whole kernel directory in /usr/src
It shouldnt take long.
Is your .config that big?
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56094
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Sat Aug 15, 2020 7:28 pm

Blind_Sniper,

Rebuild and reinstall your kernel but with an extra step.

Begin with

Code: Select all

make clean
That ensures that there is no build rubbish left over from earlier kernel builds.

Is your system clock correct?
If its ever done a step backwards, make will get confused but make clean sidesteps that by forcing everything to be rebuilt.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

  • Quote

Post by Tony0945 » Sat Aug 15, 2020 7:41 pm

alamahant wrote:Is your .config that big?
After blowing it all way, just run "bzcat /prog/config.gz >>/usr/src/linux/.config" for a starting point.
Another point: Does "eselect kernel list" point to the right kernel?
I think updating the boot menu was covered above? I use reFind which defaults to the latest built kernel, but a lot of people have forgotten to update grub after building.
Top
Blind_Sniper
Guru
Guru
Posts: 373
Joined: Fri Apr 20, 2018 9:48 am

  • Quote

Post by Blind_Sniper » Sun Aug 16, 2020 4:08 pm

@NeddySeagoon,
I mentioned it above twice that I ran "make clean".
OK, now I did it again:

Code: Select all

make clean && make && make modules_install
Here is the rest of make output:

Code: Select all

.....
.....
  LD [M]  drivers/ptp/ptp.ko
  CC [M]  drivers/video/backlight/backlight.mod.o
  LD [M]  drivers/video/backlight/backlight.ko
  CC [M]  drivers/video/backlight/generic_bl.mod.o
  LD [M]  drivers/video/backlight/generic_bl.ko
  CC [M]  fs/efivarfs/efivarfs.mod.o
  LD [M]  fs/efivarfs/efivarfs.ko
  INSTALL drivers/acpi/video.ko
  INSTALL drivers/gpu/drm/nouveau/nouveau.ko
  INSTALL drivers/gpu/drm/ttm/ttm.ko
  INSTALL drivers/net/tun.ko
  INSTALL drivers/platform/x86/mxm-wmi.ko
  INSTALL drivers/platform/x86/wmi-bmof.ko
  INSTALL drivers/platform/x86/wmi.ko
  INSTALL drivers/ptp/ptp.ko
  INSTALL drivers/video/backlight/backlight.ko
  INSTALL drivers/video/backlight/generic_bl.ko
  INSTALL fs/efivarfs/efivarfs.ko
  DEPMOD  5.4.48-gentoo
Still builds and installs nouveau!
Once nore:

Code: Select all

grep 'NOUVEAU' /usr/src/linux/.config
# CONFIG_DRM_NOUVEAU is not set
Then

Code: Select all

cp arch/x86_64/boot/bzImage /boot/kernel-5.4.48
reboot
After reboot:

Code: Select all

#lsmod
Module                  Size  Used by
nouveau              2121728  1
wmi                    24576  1 nouveau
video                  40960  1 nouveau
ttm                    94208  1 nouveau
backlight              16384  2 video,nouveau
vboxnetadp             28672  0
vboxnetflt             32768  0
vboxdrv               413696  2 vboxnetadp,vboxnetflt
Checking for kernel build date:

Code: Select all

# uname -a
Linux localhost 5.4.48-gentoo #4 SMP Sun Aug 16 18:17:17
built today.

Seems "make clean " cleans only already built modules/binaries, but some of configuration files still presented in /usr/src and instructing make command to build nouveau modules.
GNU is Not Usable
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56094
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Sun Aug 16, 2020 4:31 pm

Blind_Sniper,

Lets do it again. Do the steps that follow.

Code: Select all

cd /usr/src/linux
ls drivers/gpu/drm/nouveau/nouveau.ko
make clean
ls drivers/gpu/drm/nouveau/nouveau.ko
make -j<cores>
ls drivers/gpu/drm/nouveau/nouveau.ko
At every step drivers/gpu/drm/nouveau/nouveau.ko should be missing.
If its missing before the make clean, then you are not booting the kernel you have been building.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Blind_Sniper
Guru
Guru
Posts: 373
Joined: Fri Apr 20, 2018 9:48 am

  • Quote

Post by Blind_Sniper » Sun Aug 16, 2020 4:59 pm

OK, I'll do it again, (4th build), but if you will see again my prev post, you will notice, that make built and installed nouveau.ko.
It explicitely mentioned in make output:

Code: Select all

INSTALL drivers/gpu/drm/nouveau/nouveau.ko
And I do run exactly just built kernel, output of uname proves it:

Code: Select all

# uname -a
Linux localhost 5.4.48-gentoo #4 SMP Sun Aug 16 18:17:17
It's a today kernel. I have only two kernels, the old one (v5.4.20) built on April 5, and the new one built today, August 16


OK, meanwhile my new kernel is ready again:

Code: Select all

localhost /root # cd /usr/src/linux
localhost /usr/src/linux # ls drivers/gpu/drm/nouveau/nouveau.ko
drivers/gpu/drm/nouveau/nouveau.ko
localhost /usr/src/linux # make clean
  CLEAN   arch/x86/entry/vdso
  CLEAN   arch/x86/kernel/cpu
  CLEAN   arch/x86/kernel
  CLEAN   arch/x86/realmode/rm
  CLEAN   arch/x86/lib
  CLEAN   certs
  CLEAN   drivers/scsi
  CLEAN   drivers/tty/vt
  CLEAN   kernel
  CLEAN   lib
  CLEAN   net/wireless
  CLEAN   arch/x86/boot/compressed
  CLEAN   arch/x86/boot
  CLEAN   arch/x86/tools
  CLEAN   modules.builtin.modinfo
localhost /usr/src/linux # ls drivers/gpu/drm/nouveau/nouveau.ko
ls: cannot access 'drivers/gpu/drm/nouveau/nouveau.ko': No such file or directory

localhost /usr/src/linux # make -j5
localhost /usr/src/linux # ls drivers/gpu/drm/nouveau/nouveau.ko
drivers/gpu/drm/nouveau/nouveau.ko
It again built nouveau. If you do not trust my text reports, I can screencast my desktop while building kernel.
GNU is Not Usable
Top
Tony0945
Watchman
Watchman
Posts: 5127
Joined: Tue Jul 25, 2006 12:19 am
Location: Illinois, USA

  • Quote

Post by Tony0945 » Sun Aug 16, 2020 5:14 pm

Are you using "make menuconfig"? or directly editing .config ?
Just a thought.
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56094
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Sun Aug 16, 2020 5:22 pm

Blind_Sniper,

Yes, I noticed. I wanted to prove that each step did what was expected, or not.

The build system is either not using the .config file or the .config file is corrupt and the

Code: Select all

make silentoldconf 
at the start of make makes it legal but not what you want.
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Blind_Sniper
Guru
Guru
Posts: 373
Joined: Fri Apr 20, 2018 9:48 am

  • Quote

Post by Blind_Sniper » Sun Aug 16, 2020 6:51 pm

@Tony0945, I using make menuconfig. Some options missing in .config file and can be activated only via menuconfig, so I couldn't enable that options by direct editing.

@NeddySeagoon,
I using this .config for a while now, I saved it before enabling nouveau and copied it back when I tried nouveau decided that nouveau doesn't fit my needs..

If .config corrupted, I could try to remove that "silentoldconf" to prevent it to be given as a template. Where this file located?
GNU is Not Usable
Top
Blind_Sniper
Guru
Guru
Posts: 373
Joined: Fri Apr 20, 2018 9:48 am

  • Quote

Post by Blind_Sniper » Sun Aug 16, 2020 7:02 pm

Though I doubt that it's a some "silentoldcofig". Why? Because grep shows that DRM_NOUVEAU is not set. Both, grep .config and zgrep /proc/config.gz showsit. If silentoldcongig would enable it, zgrep would show DRM_NOUVEAU=m
GNU is Not Usable
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56094
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Sun Aug 16, 2020 9:59 pm

Blind_Sniper,

Agreed, as you are looking at the config file after make has been run.
That only leaves that make is not using the .config file.

If you have the config embedded in the kernel

Code: Select all

cd /usr/src/linux
scripts/extract-ikconfig /path/to/kernel 
should extract it.

... but that is what you see in /proc/config.gz too, which is correct.

Make a copy of the .config outside of the kernel tree as the next step mill remove it.

Code: Select all

cd /usr/src/linux
make mrproper
That's make squeaky_clean :)

Copy the .config back

Open the Makefile in your favourite editor and edit the EXTRAVERSION at the top of the file.

Code: Select all

# SPDX-License-Identifier: GPL-2.0
VERSION = 5
PATCHLEVEL = 8
SUBLEVEL = 0
EXTRAVERSION = -gentoo-r1
NAME = Kleptomaniac Octopus
It doesn't matter what is it. This will change the version magic that the kernel uses to identify its modules.

Build and reboot into this kernel.

Code: Select all

uname -a
will show the new kernel name.
Any old modules that happen to be lying around will not load but dmesg will tell you all about it.
Look for version magic mismatch errors.

If nouveau is still there, its gettting built against the new kernel with the changed version magic.

Hmm. Do you use config fragments?
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
Post Reply

26 posts
  • 1
  • 2
  • Next

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic