83

When installing CUDA in Ubuntu 16.04 by executing cuda_8.0.44_linux.run,

I got the following error message in /var/log/nvidia-installer.log

enter image description here

Then I checked /etc/modprobe.d/nvidia-installer-disable-nouveau.conf and got

enter image description here

Any suggestion to disable Nouveau Kernel Driver?

I found this 2012 discussion but didn't work for me.

3 Answers3

122

According to the NVIDIA developer zone: Create a file:

sudo nano /etc/modprobe.d/blacklist-nouveau.conf

With the following contents:

blacklist nouveau
options nouveau modeset=0

Regenerate the kernel initramfs:

sudo update-initramfs -u

Finally, reboot:

sudo reboot

Read more at: http://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#ixzz4rQODN0jy

Eliah Kagan
  • 117,780
Boern
  • 1,335
  • 3
    This one worked perfectly, but i also had to remove the X0 lock files from /tmp. – adelindev Jul 09 '18 at 23:28
  • It worked, thanks! BTW, in Arch Environment, the update-initramfs -u is different. You will need to find your kernel preset in /etc/mkinitcpio.d/ (e.g. linux417.preset), and run sudo mkinitcpio -p linux417, and reboot. All done! – MewX Jul 17 '18 at 03:32
  • Works perfectly in Ubuntu 18.04.03. Thank you very much! – sdd Jun 13 '20 at 11:28
  • Didn't work on 18.04 for me, nvidia installer still complains about this nuveau. – stiv Jan 08 '21 at 06:30
  • Thx, it works on ubuntu server 20.04 – eval Feb 27 '22 at 20:48
  • 1
    FYI on Fedora, this worked for me!

    (1) Downloaded the NVIDIA drivers/script for my video card. Executed it. It then generated files in /usr/lib/modprobe.d/nvidia-installer-disable-nouveau.conf and /etc/modprobe.d/nvidia-installer-disable-nouveau.conf with the above contents. (2) Then, I had to run dracut --regenerate-all -f on Fedora as sudo update-initramfs -u does not work on Fedora. (3) Reboot and that's it!

    – code Dec 31 '22 at 10:24
  • 1
    Note: for anyone who is new to Linux and confused because some say blacklist-nouveau.conf meanwhile the other article says nouveau-default.conf, the answer is that the file name is not important. You can just name it with anything, as long as it's a conf file. The most important thing is you put it in /etc/modprobe.d directory – Hzz Feb 26 '24 at 17:39
34

maybe it is too late ,but hope can help for others. the follow tips worked for ubuntu 16.04 and elementary os 0.4.

  1. remove all nvidia packages ,skip this if your system is fresh installed

    sudo apt-get remove nvidia* && sudo apt autoremove
    
  2. install some packages for build kernel:

    sudo apt-get install dkms build-essential linux-headers-generic
    
  3. now block and disable nouveau kernel driver:

    sudo vim /etc/modprobe.d/blacklist.conf
    

Insert follow lines to the blacklist.conf:

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

save and exit.

  1. Disable the Kernel nouveau by typing the following commands(nouveau-kms.conf may not exist,it is ok):

    echo options nouveau modeset=0 | sudo tee -a /etc/modprobe.d/nouveau-kms.conf
    
  2. build the new kernel by:

    sudo update-initramfs -u
    
  3. reboot

George Udosen
  • 36,677
  • 3
    Is item 4 necessary? It looks to be a repeat of "options nouveau modeset=0" that was added to /etc/modprobe.d/blacklist.conf mentioned in your item 3. – Sun Bear Feb 27 '17 at 04:32
  • I did this, then CTRL+ALT+F1, sudo service lightdm stop,then was able to run the installer. I don't know if it was essential to do this, but I did and I was able to run the installer successfully. Thanks! – Julian Cienfuegos May 02 '17 at 00:52
  • 2
    This just killed my system.

    After rebooting now i see an endless blackscreen, not even a darn cursor ;(

    – revolutionary Oct 13 '17 at 14:56
  • Better change sudo vim /etc/modprobe.d/blacklist.conf to gksu gedit /etc/modprobe.d/blacklist.conf :D – Mariusz Jaskółka Oct 16 '17 at 06:45
  • 1
    @revolutionary that's odd, you must not have a fallback driver. do you have a spare vga monitor anywhere?? – Tcll Oct 16 '17 at 14:49
  • @Tcll same here. My screen wont pass the Grub Bootloader. What to do now? – Isengo Oct 23 '17 at 17:58
  • @revolutionary what did you do to fix it? – Isengo Oct 23 '17 at 17:58
  • 1
    well, you can't undo your changes and rerun sudo update-initramfs -u to re-enable nouveau... I did just that like an idiot and had to reinstall xubuntu because I screwed everything up to where any nvidia driver installation failed. best thing I can recommend for @revolutionary is to grab a vga monitor (lcd, crt, doesn't matter). that should at least run off the fallback mode and help get you somewhere. – Tcll Oct 24 '17 at 00:59
  • Luckily I'm installing on a GCloud Compute Virtual Instance, but I definitely think this answer hurt more than it helped. Now I'm flooded with warnings like WARNING: Unable to find a suitable destination to install 32-bit compatibility libraries. Your system may not be set up for 32-bit compatibility. 32-bit compatibility files will not be installed; if you wish to install them, re-run the installation and set a valid directory with the --compat32-libdir option. Downvote from me – Nathan majicvr.com Sep 02 '19 at 09:55
  • @frank, sorry for that, the anwser may outdated, yes, you should down vote it – WesleyHsiung Sep 12 '19 at 02:10
  • after following all the steps given from this method you can install Nvidia from the .run file which can be download from the Nvidia official site and follow the on screen instruction. – Ghostranger Feb 27 '21 at 19:57
1

Unlike the other answers, I assert that the blacklist keyword will not actually blacklist the driver.

Let me explain what that keyboard actually does. blacklist does not blacklist the driver at all. The most it can do is offer a gentle suggestion. What you are writing is not a rule, but rather a guideline for one small portion of the boot process. Ubuntu can decide to break your blacklist guidelines at any time. You can clearly see that blacklist nouveau does not actually what it claims to do, because you can still do modprobe nouveau with the guideline in place. Don't offer any options to nouveau for any ifs and buts, if nouveau is blocked like you want, it won't even get to see its options.

What you actually need is the install [module] /bin/false line:

  1. echo 'install nouveau /bin/false' | sudo tee /etc/modprobe.d/blacklist-nouveau.conf
  2. sudo update-initramfs -u
  3. reboot
  4. sudo modprobe nouveau - Yes, please actually try this. You will instantly see the night and day difference that install nouveau /bin/false makes compared to the useless blacklist nouveau.
Daniel T
  • 4,594
  • The only content in my blacklist-nouveau needs then to be 'install nouveau /bin/false' - is that correct? – TheGlasses Feb 18 '24 at 22:45
  • @TheGlasses That is correct. That is the only thing you need, and you will know it's working when the modprobe output changes – Daniel T Feb 18 '24 at 22:57