Blacklisting Nouveau not working on Ubuntu 14.04

11,501

You may need to edit grub to prevent the kernel from ever loading nouveau at boot. Run the following commands:

cp /etc/default/grub ~/grubbackup
sudo sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="nouveau.blacklist=1 /g' /etc/default/grub
sudo update-grub

Reboot.


The file should look like this:

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="nouveau.blacklist=1 quiet splash"
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480

# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"

# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"

You can run the following command to verify the contents of the file to be safe before you reboot:

cat /etc/default/grub

If you need to make changes, you can run the following command to edit the file:

sudo nano /etc/default/grub

Press CTR+o to save the file and then press CTRL+x to exit nano.

Also, don't forget to update grub after making changes:

sudo update-grub
Share:
11,501

Related videos on Youtube

Sandman007
Author by

Sandman007

Updated on September 18, 2022

Comments

  • Sandman007
    Sandman007 over 1 year

    I know there is plenty of documentation on blacklisting the Nouveau driver. However the normal methods are not working for me. I tried adding the below lines in the /etc/modprobe.d/blacklist.conf file, however this does not work. Nouveau still gets loaded anyway.

    blacklist nouveau
    blacklist lbm-nouveau
    options nouveau modeset=0
    alias nouveau off
    alias lbm-nouveau off
    

    I tried to disable the kernel modules using this command:

    echo options nouveau modeset=0 | sudo tee -a /etc/modprobe.d/nouveau-kms.conf
    

    followed by:

    update-initramfs -u
    

    but it doesn't work. Nouveau still gets loaded anyway.

    • Wagner Patriota
      Wagner Patriota almost 10 years
      oh sure, the only thing in common is the blacklist... it worked to me just writing those lines and rebooting...
    • Sandman007
      Sandman007 almost 10 years
      @Wagner Patriota. I just realized what you are talking about. I feel as if you didn't even read my post which is why I was so confused. If you read the OP I had stated that I already added those blacklist commands in my blacklist.conf.
    • Wagner Patriota
      Wagner Patriota almost 10 years
      Yes, I know! I read it! I am just showing that I did the same thing [almost] and for me it worked. I posted because my "block-list" is different than yours.
    • Sandman007
      Sandman007 almost 10 years
      @Wagner. My apologies,I forgot to mention that I had tried that list as well as I found them on the internet somewhere else. I just tried it again for good measure and no dice. Thanks for the suggestions though.
    • Sandman007
      Sandman007 almost 10 years
      @Wagner. Ok I think I really do have it disabled and I am rendering the desktop on just my intel gpu now (Mesa?), as I have an optimus system. I came to conclusion as I did an "lsmod | grep nouveau". Nothing outputs. I also ran grep nouveau /var/log/Xorg.0.log. I then checked the log. It says nothing about loading nouveau. I sit safe to assume nouveau is in fact not loading at start and loading the GUI strictly with MESA?
    • Wagner Patriota
      Wagner Patriota almost 10 years
      I am not 100% sure. But I think so. Everything related to the current instance of your X Server is on /var/log/Xorg.0.log. You are using the device (Mesa in your case) the log says. As far as I know this is what's happening.
    • Sandman007
      Sandman007 almost 10 years
      @Wagner. Ok so I just installed the Nvidia337 drivers and I got stuck on the boot animation screen just like before. I tty'd and purged the driver and I am back so that tells me nouveau is still being loaded :( :(
    • Wagner Patriota
      Wagner Patriota almost 10 years
      I am not using Desktop version. I am using the Ubuntu Server version actually. try install both drivers from apt-get and from NVIDIA website. For me, the one is working is the version from the website. [337 is beta, did not work for me. I got the last release version]
    • Sandman007
      Sandman007 almost 10 years
      @Wagner I am trying to use the 337-beta drivers from xorg repository which I know worked fine on 13.04. I also tried 331 from the driver manager in Ubuntu. both end up with me forcing a terminal.
    • Wagner Patriota
      Wagner Patriota almost 10 years
      Sorry, I can't help. :-( I am not an expert. I just shared the experience I had with NVIDIA drivers until now. 337 didn't work for me. I have GeForce GTX 650 Ti. In Ubuntu 13 I used to just to "apt-get install nvidia-current" and it worked! With Ubuntu 14, I installed from NVIDIA using the instructions from the post I sent... it's all I have... sorry :-(
    • Sandman007
      Sandman007 almost 10 years
      @WagnerPatriota Its Ok. I am sure I'll find something in the next few days, and I'll post back when I do. Thanks again for your help!
    • mchid
      mchid about 8 years
      @WagnerPatriota That's because the driver for your card is 352, 355, 358, and 361 does anybody look these things up? geforce.com/drivers
    • Ashu
      Ashu almost 6 years
      Exactly the same situation as mine. I have Nvidia GTX 1060 and tried to install nvidia-396(recommended one) from PPA. Stubborn nouveau is not going away and i did everything what 'Sandman007' did. I am using Ubuntu 18.04 LTS Desktop version.
    • mchid
      mchid almost 6 years
      @Ashu You know that you can install the 390 driver which is also recommended for your card and this version is available if you enable the "restricted" repository and the name of the metapackage is nvidia-driver-390.
    • mchid
      mchid almost 6 years
      @Sandman007 Using this method, you cannot blacklist a kernel module which is already in use (loaded at boot time). This is why the module must be blacklisted in grub to prevent the kernel from loading the module at boot time.
    • Ashu
      Ashu almost 6 years
      @mchid. Mine is resolved...i tried a lot of stuff(didn't kept track of everything)...so unfortunately i cannot comment what really solved my issue. Thanks for the help/suggestions.
  • Ashu
    Ashu almost 6 years
    is it possible for you to post the contents of grub file rather than the sed command(sorry i am not good at sed). Right now that line reads like this:GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" with your changes i believe it should be GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nouveau.blacklist=1". Am I right? When playing with boot and O/S I just want to be extra cautious and careful to save countless hours to recover later. Please clarify.
  • mchid
    mchid almost 6 years
    @Ashu Additionally, you should also be able to bypass this setting, if the configuration does not work, by booting into recovery or safe mode.
  • Ashu
    Ashu almost 6 years
    mine worked with putting that extra nouveau.blacklist=1 for the GRUB_CMDLINE_LINUX_DEFAULT. But glad we have some dedicated and committed discussion for nvidia cards to make them work with Ubuntu.