best way to disable nouveau

General support questions
robertw
Posts: 189
Joined: 2012/04/25 13:26:59

best way to disable nouveau

Post by robertw » 2018/11/14 00:24:14

hi guys,

i have googled on how to disable or blacklist nouveau and i dont know the best way to do it and i would like to know your opinions

1st-

edit the line "GRUB_CMDLINE_LINUX" in file "/etc/default/grub"

GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet rd.driver.blacklist=nouveau nouveau.modeset=0"'

make a new file "/etc/modprobe.d/blacklist.conf" and append 1 line to it

blacklist nouveau

2nd

or make a new file "/etc/modprobe.d/blacklist.conf" and append 2 lines to it

blacklist nouveau
options nouveau modeset=0

what do you think

thanks,
rob

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: best way to disable nouveau

Post by TrevorH » 2018/11/14 09:40:05

None of those will work as-is.

If you edit /etc/default/gruib then you also need to run grub2-mkconfig afterwards and point it to (and overwrite) your existing grub.cfg file.

If you create a new /etc/modprobe.d/ conf file or you modify an existing one then you need to rebuild the initramfs for the current kernel afterwards.

None of which answer the underlying question which is: why do you want to do that? If it's to install the nvidia proprietary drivers then none of those are the best solution. The best solution for that case is to use the packaged nvidia drivers from the ELRepo yum repository which do it all for you.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

robertw
Posts: 189
Joined: 2012/04/25 13:26:59

Re: best way to disable nouveau

Post by robertw » 2018/11/14 11:19:31

thanks Trevor,

if i do it via Elrepo can i then edit the xorg.conf file as wont it be managed by the package Elrepo?

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: best way to disable nouveau

Post by TrevorH » 2018/11/14 11:26:50

I don't know if the ELRepo version uses an xorg.conf file at all. The default in CentOS 7 (when not using the nvidia proprietary drivers at least) is not to use one and to auto-detect everything.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

robertw
Posts: 189
Joined: 2012/04/25 13:26:59

Re: best way to disable nouveau

Post by robertw » 2018/11/14 11:35:01

the reason why im asking Trevor is because i need to then edit that file because i need to sort out some tearing issues as my VFX department use Nuke and you can sort it out by editing the xconf file

Mike_Rochefort
Posts: 215
Joined: 2016/03/16 02:34:19

Re: best way to disable nouveau

Post by Mike_Rochefort » 2018/11/14 15:23:50

In VFX here as well :D

I’m pretty sure it does use the XOrg config file, I don’t see how the ELRepo maintainers could alter that functionality when the driver itself relies on it. I still haven’t gotten around to testing it, but I will at some point so I can enable coolbits on all my cards. I recently transitioned from the proprietary driver to ElRepo and I’m giving it a go. What screen tearing issue are you running into?

Also, you can edit grub options using grubby, like so

Code: Select all

grubby ––update-kernel=ALL ––args="rd.driver.blacklist=nouveau nouveau.modeset=0"
. No need for grub2-mkconfig after, just regen initramfs and reboot.

Cheers,
Mike
Solution Architect @RedHat | RHCE
Former SysAdmin @BlueSkyStudios and @Pixar
Feature animation and VFX enthusiast
--
Report CentOS Stream 8 bugs: https://da.gd/c8s-bugs
Report CentOS Stream 9 bugs: https://da.gd/c9s-bugs

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: best way to disable nouveau

Post by jlehtone » 2018/11/14 19:14:19

robertw wrote:
2018/11/14 11:35:01
the reason why im asking Trevor is because i need to then edit that file because i need to sort out some tearing issues as my VFX department use Nuke and you can sort it out by editing the xconf file
I think the /etc/X11/xorg.conf added/generated by ELRepo packages packages is very minimal.
If it is proper conf-file (according to RPM), then package updates will not totally wipe your customizations.


However, there is folder /etc/X11/xorg.conf.d
Files in there do add/override the configuration. That I do know for a fact.
(I add driver option 'Stereo' in separate file.)

You can have files there that do not "belong" to any package.
(For convenience, I've added my customizations into rpm-packages, in my local repo. Ansible would be an alternative.)

robertw
Posts: 189
Joined: 2012/04/25 13:26:59

Re: best way to disable nouveau

Post by robertw » 2018/11/15 00:46:43

TrevorH wrote:
2018/11/14 09:40:05
If you create a new /etc/modprobe.d/ conf file or you modify an existing one then you need to rebuild the initramfs for the current kernel afterwards.
do you do this via the dracut command ie -

dracut /boot/initramfs-$(uname -r).img $(uname -r) --force

but its wierd as i have got another file i added to block all usb storage and that works and i didnt need to run the dracut command -

Method 1 – Fake install

In this method, we add a line ‘install usb-storage /bin/true’ which causes the ‘/bin/true’ to run instead of installing usb-storage module & that’s why it’s also called ‘Fake Install’ . To do this, create and open a file named ‘block_usb.conf’ (it can be something as well) in the folder ‘/etc/modprobe.d’,

$ sudo vim /etc/modprobe.d/block_usb.conf

& add the below mentioned line,

install usb-storage /bin/true

Now save the file and exit.

all i did was reboot the centos 7 machine and i could no longer see any usb storage i plugged in

robertw
Posts: 189
Joined: 2012/04/25 13:26:59

Re: best way to disable nouveau

Post by robertw » 2018/11/18 01:55:13

mmmm... not having any luck, i ned to run the "dracut -f" even if the file is in the modprobe folder and even after a reboot

i tried another way but didnt work

echo 'omit_drivers+="nouveau"' >> /etc/dracut.conf.d/nouveau.conf

reboot and its still there

so i have just done this

echo 'install nouveau /bin/false' >> /etc/modprobe.d/nouveau.conf

Mike_Rochefort
Posts: 215
Joined: 2016/03/16 02:34:19

Re: best way to disable nouveau

Post by Mike_Rochefort » 2018/11/18 09:48:23

This really should just be a five step process (including reboot), has been everytime I’ve done it:

Code: Select all

grubby ––update-kernel=ALL ––args="rd.driver.blacklist=nouveau nouveau.modeset=0"
mv /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak
echo "blacklist nouveau" > /etc/modprobe.d/nouveau-blacklist.conf 
dracut /boot/initramfs-$(uname -r).img $(uname -r)

reboot
Cheers,
Mike
Last edited by Mike_Rochefort on 2019/01/12 16:36:52, edited 1 time in total.
Solution Architect @RedHat | RHCE
Former SysAdmin @BlueSkyStudios and @Pixar
Feature animation and VFX enthusiast
--
Report CentOS Stream 8 bugs: https://da.gd/c8s-bugs
Report CentOS Stream 9 bugs: https://da.gd/c9s-bugs

Post Reply